Iterator to traverse through the content of a Tile. More...
#include <Tile.hpp>
Public Types | |
typedef ValueTypeInfo < PixelFormat >::Type | format |
Format of pixels in the Tile. More... | |
Public Member Functions | |
TileIterator (Tile< PixelFormat > *tile) | |
A constructor. More... | |
TileIterator (const TileIterator< PixelFormat > &other) | |
A copy constructor. More... | |
virtual | ~TileIterator () |
A destructor. | |
TileIterator< PixelFormat > & | operator= (const TileIterator< PixelFormat > &other) |
Assignment operator. More... | |
bool | operator== (const TileIterator< PixelFormat > &other) const |
Equality operator. More... | |
bool | operator!= (const TileIterator< PixelFormat > &other) const |
Inequality operator. More... | |
TileIterator< PixelFormat > & | operator++ () |
Move the iterator to the next pixel. More... | |
TileIterator< PixelFormat > & | operator-- () |
Move the iterator to the previous pixel. More... | |
TileIterator< PixelFormat > & | moveTo (unsigned int x, unsigned int y) |
Move the iterator to a specified position. 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. More... | |
const format * | operator() (unsigned int x, unsigned int y) const |
Access pixel at the given position. 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... | |
Protected Member Functions | |
TileIterator () | |
Default constructor. More... | |
Friends | |
class | Tile< PixelFormat > |
class | ImageBufferIterator< PixelFormat > |
Iterator to traverse through the content of a Tile.
This iterator is used to access and traverse data in a Tile. It should never be constructed directly but rather it shold be obtained by a call to Tile::upperLeft(), Tile::lowerRight() or Tile::getIterator(unsigned int, unsigned int)
For performance considerations the iterator doesn't care about Tile or pixel bounds. That means that checking whether Tile/pixel bounds is up to the user.
typedef ValueTypeInfo<PixelFormat>::Type FotoSHOCKcore::TileIterator< PixelFormat >::format |
FotoSHOCKcore::TileIterator< PixelFormat >::TileIterator | ( | Tile< PixelFormat > * | tile) |
FotoSHOCKcore::TileIterator< PixelFormat >::TileIterator | ( | const TileIterator< PixelFormat > & | other) |
|
protected |
Default constructor.
This constructor is used in ImageBufferIterator to create an array of TileIterators. It should not be used anywhere else.
TileIterator< PixelFormat >::format FotoSHOCKcore::TileIterator< 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::TileIterator< 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::TileIterator< PixelFormat >::getY | ( | ) | const |
Get the y coordinate of the current position.
This function can be slow because it does division internally.
TileIterator< PixelFormat > & FotoSHOCKcore::TileIterator< PixelFormat >::moveTo | ( | unsigned int | x, |
unsigned int | y | ||
) |
Move the iterator to a specified position.
x | x coordinate |
y | y coordinate |
bool FotoSHOCKcore::TileIterator< PixelFormat >::operator!= | ( | const TileIterator< PixelFormat > & | other) | const |
Inequality operator.
Check whether the position of two iterators is the same or not.
TileIterator< PixelFormat >::format * FotoSHOCKcore::TileIterator< PixelFormat >::operator() | ( | unsigned int | x, |
unsigned int | y | ||
) |
Access pixel at the given position.
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 TileIterator< PixelFormat >::format * FotoSHOCKcore::TileIterator< PixelFormat >::operator() | ( | unsigned int | x, |
unsigned int | y | ||
) | const |
Access pixel at the given position.
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 |
TileIterator< PixelFormat >::format * FotoSHOCKcore::TileIterator< PixelFormat >::operator* | ( | ) |
Access pixel at the current iterator position.
const TileIterator< PixelFormat >::format * FotoSHOCKcore::TileIterator< PixelFormat >::operator* | ( | ) | const |
Access pixel at the current iterator position.
TileIterator< PixelFormat > & FotoSHOCKcore::TileIterator< 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.
TileIterator< PixelFormat > & FotoSHOCKcore::TileIterator< 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.
TileIterator< PixelFormat > & FotoSHOCKcore::TileIterator< PixelFormat >::operator= | ( | const TileIterator< PixelFormat > & | other) |
Assignment operator.
Performs a copy of the data.
other | the TileIterator used as a source for the data |
bool FotoSHOCKcore::TileIterator< PixelFormat >::operator== | ( | const TileIterator< PixelFormat > & | other) | const |
Equality operator.
Check whether the position of two iterators is the same or not.
TileIterator< PixelFormat >::format & FotoSHOCKcore::TileIterator< 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 TileIterator< PixelFormat >::format FotoSHOCKcore::TileIterator< 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::TileIterator< PixelFormat >::setValue | ( | unsigned int | band, |
format | value | ||
) |
Set the band value at the current iterator position.
band | number of the band |
value | new value |