Iterator for linear access to the ImageBuffer content. More...
#include <ImageBuffer.hpp>
Public Types | |
typedef ValueTypeInfo < PixelFormat >::Type | format |
Public Member Functions | |
ImageBufferIterator (ImageBuffer< PixelFormat > *buffer) | |
A constructor. More... | |
ImageBufferIterator (const ImageBufferIterator< PixelFormat > &other) | |
A copy constructor. More... | |
~ImageBufferIterator () | |
A destructor. | |
ImageBufferIterator < PixelFormat > & | operator= (const ImageBufferIterator< PixelFormat > &other) |
An assignment operator. More... | |
bool | operator== (const ImageBufferIterator< PixelFormat > &other) const |
Equality operator. More... | |
bool | operator!= (const ImageBufferIterator< PixelFormat > &other) const |
Inequality operator. More... | |
ImageBufferIterator < PixelFormat > & | operator++ () |
Move the iterator to the next pixel. More... | |
ImageBufferIterator < PixelFormat > & | operator-- () |
Move the iterator to the previous pixel. More... | |
ImageBufferIterator < PixelFormat > & | moveTo (unsigned int x, unsigned int y) |
Move the iterator to a specified position int the image. More... | |
format * | operator* () |
Access pixel at the current iterator position. More... | |
const format * | operator* () const |
Access pixel at the current iterator position. More... | |
format * | operator() (unsigned int x, unsigned int y) |
Access pixel at the given position in the image. More... | |
const format * | operator() (unsigned int x, unsigned int y) const |
Access pixel at the given position in the image. More... | |
format & | operator[] (unsigned int n) |
Access a band of a pixel at the current iterator position. More... | |
const format | operator[] (unsigned int n) const |
Access a band of a pixel at the current iterator position. More... | |
format | getValue (unsigned int band) const |
Get the value of a band at the iterator's current position. More... | |
void | setValue (unsigned int band, format value) |
Set the band value at the current iterator position. More... | |
const unsigned int | getX () const |
Get the x coordinate of the current position. More... | |
const unsigned int | getY () const |
Get the y coordinate of the current position. More... | |
Iterator for linear access to the ImageBuffer content.
This iterator is simillar to the TileIterator.
ImageBufferIterator accesses ImageBuffer linearly. That means the image is accessed line by line.
FotoSHOCKcore::ImageBufferIterator< PixelFormat >::ImageBufferIterator | ( | ImageBuffer< PixelFormat > * | buffer) |
A constructor.
All iterators are allocated in advance. This takes more memory but it allows faster access
buffer |
FotoSHOCKcore::ImageBufferIterator< PixelFormat >::ImageBufferIterator | ( | const ImageBufferIterator< PixelFormat > & | other) |
A copy constructor.
Provides a deep copy of iterator data.
ImageBufferIterator< PixelFormat >::format FotoSHOCKcore::ImageBufferIterator< PixelFormat >::getValue | ( | unsigned int | band) | const |
Get the value of a band at the iterator's current position.
band | number of the band |
const unsigned int FotoSHOCKcore::ImageBufferIterator< PixelFormat >::getX | ( | ) | const |
Get the x coordinate of the current position.
This function can be slow because it does division internally.
const unsigned int FotoSHOCKcore::ImageBufferIterator< PixelFormat >::getY | ( | ) | const |
Get the y coordinate of the current position.
This function can be slow because it does division internally.
ImageBufferIterator< PixelFormat > & FotoSHOCKcore::ImageBufferIterator< PixelFormat >::moveTo | ( | unsigned int | x, |
unsigned int | y | ||
) |
Move the iterator to a specified position int the image.
x | x coordinate |
y | y coordinate |
bool FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator!= | ( | const ImageBufferIterator< PixelFormat > & | other) | const |
Inequality operator.
Check whether the position of two iterators is the same or not.
ImageBufferIterator< PixelFormat >::format * FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator() | ( | unsigned int | x, |
unsigned int | y | ||
) |
Access pixel at the given position in the image.
Iterator is not moved. The coordinate numbering starts from 0. For performance considerations there is no check whether the position is valid.
x | x coordinate |
y | y coordinate |
const ImageBufferIterator< PixelFormat >::format * FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator() | ( | unsigned int | x, |
unsigned int | y | ||
) | const |
Access pixel at the given position in the image.
Iterator is not moved. The coordinate numbering starts from 0. For performance considerations there is no check whether the position is valid.
x | x coordinate |
y | y coordinate |
ImageBufferIterator< PixelFormat >::format * FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator* | ( | ) |
Access pixel at the current iterator position.
const ImageBufferIterator< PixelFormat >::format * FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator* | ( | ) | const |
Access pixel at the current iterator position.
ImageBufferIterator< PixelFormat > & FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator++ | ( | ) |
Move the iterator to the next pixel.
The order in which pixels are traversed is from the left to right, from top to bottom.
ImageBufferIterator< PixelFormat > & FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator-- | ( | ) |
Move the iterator to the previous pixel.
The order in which pixels are traversed is from the right to left, from bottom to top.
ImageBufferIterator< PixelFormat > & FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator= | ( | const ImageBufferIterator< PixelFormat > & | other) |
An assignment operator.
Provides a deep copy of iterator data.
bool FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator== | ( | const ImageBufferIterator< PixelFormat > & | other) | const |
Equality operator.
Check whether the position of two iterators is the same or not.
ImageBufferIterator< PixelFormat >::format & FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator[] | ( | unsigned int | n) |
Access a band of a pixel at the current iterator position.
n | the band number. Numbering starts from 0 |
const ImageBufferIterator< PixelFormat >::format FotoSHOCKcore::ImageBufferIterator< PixelFormat >::operator[] | ( | unsigned int | n) | const |
Access a band of a pixel at the current iterator position.
n | the band number. Numbering starts from 0 |
void FotoSHOCKcore::ImageBufferIterator< PixelFormat >::setValue | ( | unsigned int | band, |
format | value | ||
) |
Set the band value at the current iterator position.
band | number of the band |
value | new value |