30 #ifndef __CLAW_IMAGE_HPP__ 31 #define __CLAW_IMAGE_HPP__ 60 private std::vector<pixel_type>
66 typedef std::vector<pixel_type>
super;
90 const_iterator
begin()
const;
91 const_iterator
end()
const;
94 inline const_reference
operator[](
unsigned int i)
const;
96 size_type
size()
const;
105 template<
typename Image,
typename Pixel>
107 public std::iterator<std::random_access_iterator_tag, Pixel>
111 typedef Image image_type;
140 unsigned int y = 0 );
142 inline bool operator==(
const self_type& that )
const;
143 inline bool operator!=(
const self_type& that )
const;
144 inline bool operator<(
const self_type& that )
const;
145 inline bool operator>(
const self_type& that )
const;
146 inline bool operator<=(
const self_type& that )
const;
147 inline bool operator>=(
const self_type& that )
const;
149 inline self_type& operator+=(
int n );
150 inline self_type& operator-=(
int n );
152 inline self_type
operator+(
int n )
const;
153 inline self_type operator-(
int n )
const;
161 template<
typename ImageT,
typename PixelT>
162 friend inline self_type
operator+(
int n,
const self_type&
self );
164 inline difference_type operator-(
const self_type& that )
const;
166 inline self_type& operator++();
167 inline self_type operator++(
int);
168 inline self_type& operator--();
169 inline self_type operator--(
int);
171 inline reference operator*()
const;
172 inline pointer operator->()
const;
177 bool is_final()
const;
207 image(
unsigned int w,
unsigned int h );
208 image( std::istream& f );
212 unsigned int width()
const;
213 unsigned int height()
const;
220 const_iterator
begin()
const;
221 const_iterator
end()
const;
233 void set_size(
unsigned int w,
unsigned int h );
235 void load( std::istream& f );
239 std::vector<scanline> m_data;
254 #endif // __CLAW_IMAGE_HPP__
super::const_reference const_reference
Const reference to a pixel.
std::random_access_iterator_tag iterator_category
The type of this category.
void partial_copy(const image &that, const math::coordinate_2d< int > &pos)
Copy an image on the current image.
ptrdiff_t difference_type
The type of the distance between two iterators.
super::const_iterator const_iterator
Const iterator in the line.
rgba_pixel pixel_type
The type representing the colors of the pixels in the image.
reference operator[](unsigned int i)
Get a pixel from the line.
super::value_type value_type
The type of the pixels.
size_type size() const
Get the length of the line.
unsigned int height() const
Gets image's height.
base_iterator< image, pixel_type > iterator
The type of the iterator on the pixels of the image.
super::size_type size_type
An unsigned integral type.
void flip()
Set the image upside down.
void swap(image &that)
Swap the content of two images.
void fill(const math::rectangle< int > r, const pixel_type &c)
Fill an area of the image with a given color.
Base class for iterators on an image.
iterator end()
Get en iterator past the last pixel.
void load(std::istream &f)
Read the image from a stream.
Some mathematical structures and functions.
A class representing a rectangle by his x,y coordinates, width and height.
pixel_type * pointer
The type of the pointers to the values accesssed by the iterator.
super::iterator iterator
Iterator in the line.
unsigned int width() const
Gets image's width.
pixel_type & reference
The type of the references to the values accesssed by the iterator.
std::vector< pixel_type > super
The type of the parent class.
void merge(const image &that)
Merge an image on the current image.
pixel_type value_type
The type of the values accessed by the iterator.
iterator begin()
Get an iterator on the first pixel.
base_iterator< const image, const pixel_type > const_iterator
The type of the iterator to access constant pixels.
super::reference reference
Reference to a pixel..
Representation of a pixel in image processing.
A class to deal with images.
This is the main namespace.
void set_size(unsigned int w, unsigned int h)
Set a new size to the image.
claw::graphic::image::base_iterator< ImageT, PixelT >::self_type operator+(int n, const typename claw::graphic::image::base_iterator< ImageT, PixelT >::self_type &self)
Get an iterator at a specific distance of the current iterator.
Inline methods for the claw::graphic::image class.