public abstract

Inheritance Graph

graph BT
	PixelAccessor
	PixelAccessor --> ReferenceCounter
	click PixelAccessor "classUtil_1_1PixelAccessor"
	click ReferenceCounter "classUtil_1_1ReferenceCounter"

Description

Class for direct access to the pixels of a Bitmap .

Note: After structural modifications of a Bitmap (e.g. changes of the size or the PixelFormat ) all corresponding PixelAccessors become invalid and may no longer be used.

Note: A PixelAccessor keeps a Reference to the associated Bitmap . If there exists no other reference to the Bitmap , it will be deleted if the PixelAccessor is deleted.

Public Types

   
   
typedef Reference < PixelAccessor > Ref

Protected Functions

   
   
bool checkRange(uint32_t x, uint32_t y) const
   
bool crop(uint32_t & x, uint32_t & y, uint32_t & width, uint32_t & height) const
   
uint32_t getIndex(uint32_t x, uint32_t y) const
   
  PixelAccessor( Reference < Bitmap > bitmap)

Public Static Functions

   
   
Ref create( Reference < Bitmap > bitmap)
   
void copy( PixelAccessor * source, PixelAccessor * dest)

Public Functions

   
   
  ~PixelAccessor()
   
const AttributeFormat & getPixelFormat() const
   
const Reference < Bitmap > & getBitmap() const
   
uint32_t getWidth() const
   
uint32_t getHeight() const
   
Color4f readColor4f(uint32_t x, uint32_t y) const
   
Color4ub readColor4ub(uint32_t x, uint32_t y) const
   
float readSingleValueFloat(uint32_t x, uint32_t y) const
Retrieve a single value from the bitmap (a value from the red channel for most bitmaps).
   
uint8_t readSingleValueByte(uint32_t x, uint32_t y) const
Retrieve a single value from the bitmap (a value from the red channel for most bitmaps).
   
void writeColor(uint32_t x, uint32_t y, const Color4f & c)
   
void writeColor(uint32_t x, uint32_t y, const Color4ub & c)
   
void writeSingleValueFloat(uint32_t x, uint32_t y, float value)
Write a single value to the bitmap (e.g., a value to the red channel for monochrome bitmaps).
   
void fill(uint32_t x, uint32_t y, uint32_t width, uint32_t height, const Color4f & c)
template< typename _T >  
_T * _ptr(const uint32_t x, const uint32_t y)
template< typename _T >  
const _T * _ptr(const uint32_t x, const uint32_t y) const

Documentation

typedef
Util::PixelAccessor::Ref

public
 
 
typedef Reference < PixelAccessor > Ref

Defined in Util/Graphics/PixelAccessor.h:46


function
Util::PixelAccessor::checkRange

protected const inline
     
     
bool checkRange( uint32_t x,
  uint32_t y
) const    

Defined in Util/Graphics/PixelAccessor.h:37


function
Util::PixelAccessor::crop

protected const
     
     
bool crop( uint32_t & x,
  uint32_t & y,
  uint32_t & width,
  uint32_t & height
) const    

Defined in Util/Graphics/PixelAccessor.h:38


function
Util::PixelAccessor::getIndex

protected const inline
     
     
uint32_t getIndex( uint32_t x,
  uint32_t y
) const    

Defined in Util/Graphics/PixelAccessor.h:39


function
Util::PixelAccessor::PixelAccessor

protected inline
     
     
PixelAccessor( Reference < Bitmap > bitmap )

Defined in Util/Graphics/PixelAccessor.h:41


function
Util::PixelAccessor::create

public static
     
     
Ref create( Reference < Bitmap > bitmap )

Create a PixelAccessor for the given bitmap. According to the format of the Bitmap , an appropriate Accesor-type is chosen. If no accessor is available due to an unsupported format, nullptr is returned.

Defined in Util/Graphics/PixelAccessor.h:50


function
Util::PixelAccessor::copy

public static
     
     
void copy( PixelAccessor * source,
  PixelAccessor * dest
)    

copies all pixels from source to dest if source and dest have incompatible dimensions only those pixels are copied which are valid in both

Defined in Util/Graphics/PixelAccessor.h:80


function
Util::PixelAccessor::~PixelAccessor

public virtual
   
   
~PixelAccessor( )

Defined in Util/Graphics/PixelAccessor.h:52


function
Util::PixelAccessor::getPixelFormat

public const inline
   
   
const AttributeFormat & getPixelFormat( ) const

Defined in Util/Graphics/PixelAccessor.h:54


function
Util::PixelAccessor::getBitmap

public const inline
   
   
const Reference < Bitmap > & getBitmap( ) const

Defined in Util/Graphics/PixelAccessor.h:55


function
Util::PixelAccessor::getWidth

public const inline
   
   
uint32_t getWidth( ) const

Defined in Util/Graphics/PixelAccessor.h:56


function
Util::PixelAccessor::getHeight

public const inline
   
   
uint32_t getHeight( ) const

Defined in Util/Graphics/PixelAccessor.h:57


function
Util::PixelAccessor::readColor4f

public const inline
     
     
Color4f readColor4f( uint32_t x,
  uint32_t y
) const    

Defined in Util/Graphics/PixelAccessor.h:59


function
Util::PixelAccessor::readColor4ub

public const inline
     
     
Color4ub readColor4ub( uint32_t x,
  uint32_t y
) const    

Defined in Util/Graphics/PixelAccessor.h:60


function
Util::PixelAccessor::readSingleValueFloat

public const inline
     
     
float readSingleValueFloat( uint32_t x,
  uint32_t y
) const    

Retrieve a single value from the bitmap (a value from the red channel for most bitmaps).

Defined in Util/Graphics/PixelAccessor.h:62


function
Util::PixelAccessor::readSingleValueByte

public const inline
     
     
uint8_t readSingleValueByte( uint32_t x,
  uint32_t y
) const    

Retrieve a single value from the bitmap (a value from the red channel for most bitmaps).

Defined in Util/Graphics/PixelAccessor.h:64


function
Util::PixelAccessor::writeColor

public inline
     
     
void writeColor( uint32_t x,
  uint32_t y,
  const Color4f & c
)    

Defined in Util/Graphics/PixelAccessor.h:65


function
Util::PixelAccessor::writeColor

public inline
     
     
void writeColor( uint32_t x,
  uint32_t y,
  const Color4ub & c
)    

Defined in Util/Graphics/PixelAccessor.h:66


function
Util::PixelAccessor::writeSingleValueFloat

public inline
     
     
void writeSingleValueFloat( uint32_t x,
  uint32_t y,
  float value
)    

Write a single value to the bitmap (e.g., a value to the red channel for monochrome bitmaps).

Defined in Util/Graphics/PixelAccessor.h:68


function
Util::PixelAccessor::fill

public inline
     
     
void fill( uint32_t x,
  uint32_t y,
  uint32_t width,
  uint32_t height,
  const Color4f & c
)    

Fill the given area with the given color.

Note: Specific PixelAccessors may provide an optimized implementation

Defined in Util/Graphics/PixelAccessor.h:72


function
Util::PixelAccessor::_ptr

public inline
     
template< typename _T >    
_T * _ptr( const uint32_t x,
  const uint32_t y
)    

Direct access to the pixel data.

Note: Be careful: No boundary checks are performed!

Defined in Util/Graphics/PixelAccessor.h:84


function
Util::PixelAccessor::_ptr

public const inline
     
template< typename _T >    
const _T * _ptr( const uint32_t x,
  const uint32_t y
) const    

Defined in Util/Graphics/PixelAccessor.h:87