Classes | Public Member Functions
sal3d::Frame::RGBPlane< T > Class Template Reference

Access to RGB colour pixel values of a Frame. More...

#include <Frame.hpp>

List of all members.

Classes

struct  RGBPixel
 Colour value for an RGB pixel. More...

Public Member Functions

 RGBPlane (const Frame &f)
 Constructor from a given Frame.
int width () const
 Width of the referred Frame.
int height () const
 Height of the referred Frame.
RGBPixel getPixel (int x, int y) const
 Get the colour value at given coordinates.
void setPixel (int x, int y, const RGBPixel &p)
 Set the colour value at given coordinates.

Detailed Description

template<typename T>
class sal3d::Frame::RGBPlane< T >

Access to RGB colour pixel values of a Frame.

This class offers read and write access to RGB pixels of a Frame, of the data type mandated by the template.

Objects of this class do not include a reference to the referred Frame, so the user should keep the Frame in memory while using related RGBPlane objects.

Traversing all the pixels in a plane can be done with efficient creating a RGBPlane object from a Frame, iterating over rows creating Row objects, and then iterating inside each Row.


Constructor & Destructor Documentation

template<typename T >
sal3d::Frame::RGBPlane< T >::RGBPlane ( const Frame f) [inline]

Constructor from a given Frame.

Get the RGBPlane accessor to a given plane of a Frame.

The Frame needs to have 3 planes.

Parameters:
fThe Frame this RGBPlane accessor will refer to

References sal3d::Frame::vpa().


Member Function Documentation

template<typename T >
RGBPixel sal3d::Frame::RGBPlane< T >::getPixel ( int  x,
int  y 
) const [inline]

Get the colour value at given coordinates.

Parameters:
xThe X coordinate of the pixel
yThe Y coordinate of the pixel
template<typename T >
void sal3d::Frame::RGBPlane< T >::setPixel ( int  x,
int  y,
const RGBPixel p 
) [inline]

Set the colour value at given coordinates.

Parameters:
xThe X coordinate of the pixel
yThe Y coordinate of the pixel
pThe RGB colour to assign to the coordinates

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