![]() |
stromx
0.8.0
|
Concrete image without memory management. More...
#include <ImageWrapper.h>
Public Member Functions | |
| ImageWrapper (const unsigned int bufferSize, uint8_t *const buffer) | |
| ImageWrapper () | |
| virtual const VariantHandle & | variant () 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 Version & | version () const =0 |
| virtual const std::string & | type () const =0 |
| virtual const std::string & | package () const =0 |
| virtual Data * | clone () 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) |
Concrete image without memory management.
| 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.
| stromx::runtime::ImageWrapper::ImageWrapper | ( | ) |
Constructs an empty image wrapper, i.e. is an image wrapper without associated memory buffer.
|
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().
|
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.
|
inlinevirtual |
Returns the size of the buffer.
Implements stromx::runtime::Matrix.
|
inlinevirtual |
Returns the number columns of the matrix.
Implements stromx::runtime::Matrix.
|
inlinevirtual |
Returns the address of the matrix data.
Implements stromx::runtime::Matrix.
|
inlinevirtual |
Returns the address of the matrix data as a constant pointer.
Implements stromx::runtime::Matrix.
|
inlinevirtual |
Returns the height of the image.
Implements stromx::runtime::Image.
|
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.
|
inlinevirtual |
Returns the type of the pixel data of the image.
Implements stromx::runtime::Image.
| 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.
| 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.
|
inlinevirtual |
Returns the number of rows of the matrix.
Implements stromx::runtime::Matrix.
|
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.
| buffer | The new buffer. Note that this memory is not released by the ImageWrapper. |
| bufferSize | The size of buffer in bytes. |
|
inlinevirtual |
Returns the size of a line in the image in bytes.
Implements stromx::runtime::Image.
|
virtual |
Returns the size of a single value in bytes.
Reimplemented from stromx::runtime::Matrix.
|
inlinevirtual |
Returns the value type of the data of the matrix.
Implements stromx::runtime::Matrix.
|
inlinevirtual |
Returns the data variant of this data object.
Implements stromx::runtime::DataInterface.
|
inlinevirtual |
Returns the width of the image.
Implements stromx::runtime::Image.
1.8.12