53 return super::begin();
70 return super::begin();
135 return m_data[0].size();
143 return m_data.size();
198 if(my_box.intersects(his_box))
201 unsigned int that_y = pos.
y < 0 ? -pos.
y : 0;
202 unsigned int that_x = pos.
x < 0 ? -pos.
x : 0;
203 const double max_comp(
204 std::numeric_limits<rgba_pixel::component_type>::max());
206 intersection = my_box.intersection(his_box);
208 for(
int y = 0; y != intersection.
height; ++y)
213 = (*this)[y + intersection.
position.
y].begin()
218 const double src_alpha(
first->components.alpha);
219 const double dest_alpha(dest->components.alpha
220 * (max_comp - src_alpha));
222 const double red = (double)
first->components.red * src_alpha
223 + (
double)dest->components.red * dest_alpha;
225 = (double)
first->components.green * src_alpha
226 + (
double)dest->components.green * dest_alpha;
227 const double blue = (double)
first->components.blue * src_alpha
228 + (
double)dest->components.blue * dest_alpha;
229 const double alpha = src_alpha + dest_alpha;
231 dest->components.red = std::min(red, max_comp);
232 dest->components.green = std::min(green, max_comp);
233 dest->components.blue = std::min(blue, max_comp);
234 dest->components.alpha = std::min(alpha, max_comp);
251 if(my_box.intersects(his_box))
254 unsigned int that_y = pos.
y < 0 ? -pos.
y : 0;
255 unsigned int that_x = pos.
x < 0 ? -pos.
x : 0;
257 intersection = my_box.intersection(his_box);
259 for(
int y = 0; y != intersection.
height; ++y)
264 = (*this)[y + intersection.
position.
y].begin()
267 std::copy(
first, last, dest);
277 for(
unsigned int y = 0; y !=
height() / 2; ++y)
291 if(my_box.intersects(r))
294 const double max_comp(
295 std::numeric_limits<rgba_pixel::component_type>::max());
297 for(
int y = 0; y != intersection.
height; ++y)
300 = (*this)[intersection.
position.
y + y].begin()
308 double red = (double)
first->components.red
311 = (double)
first->components.green
313 double blue = (double)
first->components.blue
315 double alpha = (double)
first->components.alpha
316 + (max_comp - src_alpha) / max_comp;
318 first->components.red = std::min(red, max_comp);
319 first->components.green = std::min(green, max_comp);
320 first->components.blue = std::min(blue, max_comp);
321 first->components.alpha = std::min(alpha, max_comp);
341 for(
unsigned int y = 0; y !=
height(); ++y)
A class for bitmap pictures.
Fuction object to get the first element of a std::pair.
This class read data from a bitmap file and store it in an image.
This class reads data from a gif file. The image is resized to the size of the screen (as defined in ...
super::size_type size_type
An unsigned integral type.
iterator begin()
Get an iterator on the first pixel.
iterator end()
Get en iterator past the last pixel.
super::iterator iterator
Iterator in the line.
super::const_iterator const_iterator
Const iterator in the line.
size_type size() const
Get the length of the line.
A class to deal with images.
void flip()
Set the image upside down.
void partial_copy(const image &that, const math::coordinate_2d< int > &pos)
Copy an image on the current image.
unsigned int height() const
Gets image's height.
rgba_pixel pixel_type
The type representing the colors of the pixels in the image.
void set_size(unsigned int w, unsigned int h)
Set a new size to the image.
unsigned int width() const
Gets image's width.
void merge(const image &that)
Merge an image on the current image.
void fill(const math::rectangle< int > r, const pixel_type &c)
Fill an area of the image with a given color.
iterator end()
Get an iterator pointing just past the last pixel.
void swap(image &that)
Swap the content of two images.
image()
Constructor. Creates an image without datas.
void load(std::istream &f)
Read the image from a stream.
base_iterator< const image, const pixel_type > const_iterator
The type of the iterator to access constant pixels.
base_iterator< image, pixel_type > iterator
The type of the iterator on the pixels of the image.
iterator begin()
Get an iterator pointing on the first pixel.
This class read data from a jpeg file and store it in an image.
This class read data from a pcx file and store it in an image.
This class read data from a png file and store it in an image.
This class read data from a targa file and store it in an image.
This class read data from a xbm file and store it in an image.
Coordinates in a two dimensional space.
value_type x
X-coordinate.
value_type y
Y-coordinate.
A class representing a rectangle by his x,y coordinates, width and height.
coordinate_2d< value_type > position
value_typeop left coordinates.
A simple class to use as exception with string message.
Image class for gif files.
void swap(claw::graphic::gif &a, claw::graphic::gif &b)
Swap the content of two gifs.
A class to deal with images.
A class for jpeg pictures.
A class for pcx pictures.
A class for png pictures.
component_type red
Red component.
struct claw::graphic::rgba_pixel::@243011111317154221214371326113376113353054140240::@062221254366262347154034240363361326201063204322 components
Component by component representation.
component_type alpha
Translucy.
component_type green
Green component.
component_type blue
Blue component.
A class for targa pictures.
A class for xbm pictures.