stromx  0.8.0
Public Member Functions | Protected Member Functions | List of all members
stromx::runtime::ImageWrapper Class Referenceabstract

Concrete image without memory management. More...

#include <ImageWrapper.h>

Inheritance diagram for stromx::runtime::ImageWrapper:
stromx::runtime::Image stromx::runtime::Matrix stromx::runtime::Data stromx::runtime::DataInterface stromx::cvsupport::Image

Public Member Functions

 ImageWrapper (const unsigned int bufferSize, uint8_t *const buffer)
 
 ImageWrapper ()
 
virtual const VariantHandlevariant () const
 
virtual uint8_t * buffer ()
 
virtual unsigned int bufferSize () const
 
virtual unsigned int rows () const
 
virtual unsigned int cols () const
 
virtual uint8_t * data ()
 
virtual const uint8_t * data () const
 
virtual unsigned int stride () const
 
virtual ValueType valueType () const
 
virtual unsigned int valueSize () const
 
virtual void initializeMatrix (const unsigned int rows, const unsigned int cols, const unsigned int stride, uint8_t *data, const ValueType valueType)
 
virtual unsigned int width () const
 
virtual unsigned int height () const
 
virtual PixelType pixelType () const
 
virtual void initializeImage (const unsigned int width, const unsigned int height, const unsigned int stride, uint8_t *data, const PixelType pixelType)
 
void resize (const unsigned int width, const unsigned int height, const PixelType pixelType)
 
void resize (const unsigned int size)
 
- Public Member Functions inherited from stromx::runtime::Image
virtual unsigned int pixelSize () const
 
virtual unsigned int numChannels () const
 
virtual unsigned int depth () const
 
virtual void initializeImage (const unsigned int width, const unsigned int height, const unsigned int stride, uint8_t *data, const PixelType pixelType)=0
 
- Public Member Functions inherited from stromx::runtime::Matrix
template<class T >
T & at (const unsigned row, const unsigned col)
 
template<class T >
const T & at (const unsigned int row, const unsigned col) const
 
template<class T >
const T value (const unsigned int row, const unsigned int col) const
 
- Public Member Functions inherited from stromx::runtime::Data
virtual void serialize (OutputProvider &out) const
 
virtual void deserialize (InputProvider &in, const Version &version)
 
- Public Member Functions inherited from stromx::runtime::DataInterface
virtual const Versionversion () const =0
 
virtual const std::string & type () const =0
 
virtual const std::string & package () const =0
 
virtual Dataclone () const =0
 
bool isVariant (const VariantInterface &v) const
 

Protected Member Functions

void setBuffer (uint8_t *const buffer, const unsigned int bufferSize)
 
virtual void allocate (const unsigned int width, const unsigned int height, const Image::PixelType pixelType)=0
 

Additional Inherited Members

- Public Types inherited from stromx::runtime::Image
enum  PixelType {
  NONE, MONO_8, MONO_16, RGB_24,
  RGB_48, BGR_24, BGR_48, BAYERBG_8,
  BAYERBG_16, BAYERGB_8, BAYERGB_16
}
 
- Public Types inherited from stromx::runtime::Matrix
enum  ValueType {
  NONE, INT_8, UINT_8, INT_16,
  UINT_16, INT_32, UINT_32, FLOAT_32,
  FLOAT_64
}
 
- Static Public Member Functions inherited from stromx::runtime::Image
static unsigned int pixelSize (const PixelType pixelType)
 
static unsigned int numChannels (const PixelType pixelType)
 
static unsigned depth (const PixelType pixelType)
 
- Static Public Member Functions inherited from stromx::runtime::Matrix
static unsigned int valueSize (const ValueType valueType)
 
- Static Protected Member Functions inherited from stromx::runtime::Image
static const runtime::VariantHandle dataVariantFromPixelType (const PixelType pixelType)
 
static Matrix::ValueType valueTypeFromPixelType (const PixelType pixelType)
 
- Static Protected Member Functions inherited from stromx::runtime::Matrix
static const runtime::VariantHandle dataVariantFromValueType (const ValueType valueType)
 

Detailed Description

Concrete image without memory management.

Constructor & Destructor Documentation

§ ImageWrapper() [1/2]

stromx::runtime::ImageWrapper::ImageWrapper ( const unsigned int  bufferSize,
uint8_t *const  buffer 
)

Constructs an image wrapper from a given memory buffer. The buffer is not owned by the image and is thus not freed upon destruction of the image wrapper.

§ ImageWrapper() [2/2]

stromx::runtime::ImageWrapper::ImageWrapper ( )

Constructs an empty image wrapper, i.e. is an image wrapper without associated memory buffer.

Member Function Documentation

§ allocate()

virtual void stromx::runtime::ImageWrapper::allocate ( const unsigned int  width,
const unsigned int  height,
const Image::PixelType  pixelType 
)
protectedpure virtual

Allocates or resizes the image to the given dimension. Must be defined in derived class which implements the memory management. Implementations of this function should call setBuffer() and initializeImage().

Since
0.2

§ buffer()

virtual uint8_t* stromx::runtime::ImageWrapper::buffer ( )
inlinevirtual

Returns the address of the buffer of the matrix. This is not necessarily a pointer to the matrix data which can be located at a different position in the buffer.

Implements stromx::runtime::Matrix.

§ bufferSize()

virtual unsigned int stromx::runtime::ImageWrapper::bufferSize ( ) const
inlinevirtual

Returns the size of the buffer.

Implements stromx::runtime::Matrix.

§ cols()

virtual unsigned int stromx::runtime::ImageWrapper::cols ( ) const
inlinevirtual

Returns the number columns of the matrix.

Implements stromx::runtime::Matrix.

§ data() [1/2]

virtual uint8_t* stromx::runtime::ImageWrapper::data ( )
inlinevirtual

Returns the address of the matrix data.

Implements stromx::runtime::Matrix.

§ data() [2/2]

virtual const uint8_t* stromx::runtime::ImageWrapper::data ( ) const
inlinevirtual

Returns the address of the matrix data as a constant pointer.

Implements stromx::runtime::Matrix.

§ height()

virtual unsigned int stromx::runtime::ImageWrapper::height ( ) const
inlinevirtual

Returns the height of the image.

Implements stromx::runtime::Image.

§ initializeMatrix()

void stromx::runtime::ImageWrapper::initializeMatrix ( const unsigned int  rows,
const unsigned int  cols,
const unsigned int  stride,
uint8_t *  data,
const ValueType  valueType 
)
virtual

Initializes the matrix to the given data. Note that this function does not change the matrix buffer but merely changes the description of the data contained in the matrix buffer.

Implements stromx::runtime::Matrix.

Reimplemented in stromx::cvsupport::Image.

§ pixelType()

virtual PixelType stromx::runtime::ImageWrapper::pixelType ( ) const
inlinevirtual

Returns the type of the pixel data of the image.

Implements stromx::runtime::Image.

§ resize() [1/2]

void stromx::runtime::ImageWrapper::resize ( const unsigned int  width,
const unsigned int  height,
const PixelType  pixelType 
)

Resizes the image and changes the pixel type of the image.

§ resize() [2/2]

void stromx::runtime::ImageWrapper::resize ( const unsigned int  size)

Resizes the buffer of the image to the given size in bytes. The width of the resized image is size and its height is 1. Its pixel type is Image::NONE. The buffer size of the image is guaranteed to be at least size.

§ rows()

virtual unsigned int stromx::runtime::ImageWrapper::rows ( ) const
inlinevirtual

Returns the number of rows of the matrix.

Implements stromx::runtime::Matrix.

§ setBuffer()

void stromx::runtime::ImageWrapper::setBuffer ( uint8_t *const  buffer,
const unsigned int  bufferSize 
)
protected

Sets a new image buffer. Note that the image data defined by width, height, pixel type and data must always be contained in the image buffer.

Parameters
bufferThe new buffer. Note that this memory is not released by the ImageWrapper.
bufferSizeThe size of buffer in bytes.

§ stride()

virtual unsigned int stromx::runtime::ImageWrapper::stride ( ) const
inlinevirtual

Returns the size of a line in the image in bytes.

Implements stromx::runtime::Image.

§ valueSize()

unsigned int stromx::runtime::ImageWrapper::valueSize ( ) const
virtual

Returns the size of a single value in bytes.

Reimplemented from stromx::runtime::Matrix.

§ valueType()

virtual ValueType stromx::runtime::ImageWrapper::valueType ( ) const
inlinevirtual

Returns the value type of the data of the matrix.

Implements stromx::runtime::Matrix.

§ variant()

virtual const VariantHandle& stromx::runtime::ImageWrapper::variant ( ) const
inlinevirtual

Returns the data variant of this data object.

Implements stromx::runtime::DataInterface.

§ width()

virtual unsigned int stromx::runtime::ImageWrapper::width ( ) const
inlinevirtual

Returns the width of the image.

Implements stromx::runtime::Image.


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