Cinder  0.9.1
Public Member Functions | List of all members
cinder::SurfaceT< T >::Iter Class Reference

#include <Surface.h>

Public Member Functions

 Iter (SurfaceT< T > &SurfaceT, const Area &area)
 
T & r () const
 
T & g () const
 
T & b () const
 
T & a () const
 
T & r (int32_t xOff, int32_t yOff) const
 
T & g (int32_t xOff, int32_t yOff) const
 
T & b (int32_t xOff, int32_t yOff) const
 
T & a (int32_t xOff, int32_t yOff) const
 
T & rClamped (int32_t xOff, int32_t yOff) const
 
T & gClamped (int32_t xOff, int32_t yOff) const
 
T & bClamped (int32_t xOff, int32_t yOff) const
 
T & aClamped (int32_t xOff, int32_t yOff) const
 
const int32_t x () const
 
const int32_t y () const
 
ivec2 getPos () const
 
bool pixel ()
 
bool line ()
 
int32_t getWidth () const
 
int32_t getHeight () const
 

Detailed Description

template<typename T>
class cinder::SurfaceT< T >::Iter

Convenience class for iterating the pixels of a Surface.

Constructor & Destructor Documentation

template<typename T>
cinder::SurfaceT< T >::Iter::Iter ( SurfaceT< T > &  SurfaceT,
const Area area 
)

Member Function Documentation

template<typename T>
T& cinder::SurfaceT< T >::Iter::r ( ) const

Returns a reference to the red value of the pixel that the Iter currently points to

template<typename T>
T& cinder::SurfaceT< T >::Iter::g ( ) const

Returns a reference to the green value of the pixel that the Iter currently points to

template<typename T>
T& cinder::SurfaceT< T >::Iter::b ( ) const

Returns a reference to the blue value of the pixel that the Iter currently points to

template<typename T>
T& cinder::SurfaceT< T >::Iter::a ( ) const

Returns a reference to the alpha value of the pixel that the Iter currently points to. Undefined in the absence of an alpha channel.

template<typename T>
T& cinder::SurfaceT< T >::Iter::r ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the red value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels.

template<typename T>
T& cinder::SurfaceT< T >::Iter::g ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the green value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels.

template<typename T>
T& cinder::SurfaceT< T >::Iter::b ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the blue value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels.

template<typename T>
T& cinder::SurfaceT< T >::Iter::a ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the alpha value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels. Undefined in the absence of an alpha channel.

template<typename T>
T& cinder::SurfaceT< T >::Iter::rClamped ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the red value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels. Clamps offset to the bounds of the Iter.

template<typename T>
T& cinder::SurfaceT< T >::Iter::gClamped ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the green value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels. Clamps offset to the bounds of the Iter.

template<typename T>
T& cinder::SurfaceT< T >::Iter::bClamped ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the blue value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels. Clamps offset to the bounds of the Iter.

template<typename T>
T& cinder::SurfaceT< T >::Iter::aClamped ( int32_t  xOff,
int32_t  yOff 
) const

Returns a reference to the alpha value of the pixel that the Iter currently points to, offset by (xOff, yOff) pixels. Clamps offset to the bounds of the Iter. Undefined in the absence of an alpha channel.

template<typename T>
const int32_t cinder::SurfaceT< T >::Iter::x ( ) const

Returns the x coordinate of the pixel the Iter currently points to.

template<typename T>
const int32_t cinder::SurfaceT< T >::Iter::y ( ) const

Returns the y coordinate of the pixel the Iter currently points to.

template<typename T>
ivec2 cinder::SurfaceT< T >::Iter::getPos ( ) const

Returns the coordinate of the pixel the Iter currently points to.

template<typename T>
bool cinder::SurfaceT< T >::Iter::pixel ( )

Increments which pixel of the current row the Iter points to, and returns false when no pixels remain in the current row.

template<typename T>
bool cinder::SurfaceT< T >::Iter::line ( )

Increments which row the Iter points to, and returns false when no rows remain in the Surface.

template<typename T>
int32_t cinder::SurfaceT< T >::Iter::getWidth ( ) const

Returns the width of the Area the Iter iterates.

template<typename T>
int32_t cinder::SurfaceT< T >::Iter::getHeight ( ) const

Returns the height of the Area the Iter iterates.


The documentation for this class was generated from the following file: