![]() |
stromx
0.8.0
|
Image with support for reading and writing. More...
#include <Image.h>
Public Types | |
| enum | Conversion { UNCHANGED, GRAYSCALE = 0x2, COLOR = 0x4, DEPTH_16 = 0x8 } |
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 } |
Public Member Functions | |
| Image () | |
| Image (const unsigned int width, const unsigned int height, const PixelType pixelType) | |
| Image (const std::string &filename) | |
| Image (const std::string &filename, const Conversion access) | |
| Image (const stromx::runtime::Image &image) | |
| Image (const stromx::cvsupport::Image &image) | |
| Image (const cv::Mat &cvImage) | |
| Image (const cv::Mat &cvImage, const PixelType pixelType) | |
| Image (const unsigned int size) | |
| virtual const runtime::Version & | version () const |
| virtual const std::string & | type () const |
| virtual const std::string & | package () const |
| virtual Data * | clone () const |
| virtual void | serialize (runtime::OutputProvider &output) const |
| virtual void | deserialize (runtime::InputProvider &input, const stromx::runtime::Version &version) |
| virtual void | initializeImage (const unsigned int width, const unsigned int height, const unsigned int stride, uint8_t *data, const PixelType pixelType) |
| virtual void | initializeMatrix (const unsigned int rows, const unsigned int cols, const unsigned int stride, uint8_t *data, const ValueType valueType) |
| void | open (const std::string &filename) |
| void | open (const std::string &filename, const Conversion access) |
| void | save (const std::string &filename) const |
Public Member Functions inherited from stromx::runtime::ImageWrapper | |
| 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 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 |
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::DataInterface | |
| bool | isVariant (const VariantInterface &v) const |
Static Public Member Functions | |
| static void | save (const std::string &filename, const runtime::Image &image) |
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) |
Friends | |
| STROMX_CVSUPPORT_API cv::Mat | getOpenCvMat (const runtime::Image &image) |
Additional Inherited Members | |
Protected Member Functions inherited from stromx::runtime::ImageWrapper | |
| void | setBuffer (uint8_t *const buffer, const unsigned int bufferSize) |
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) |
Image with support for reading and writing.
Conversion options when reading images.
| stromx::cvsupport::Image::Image | ( | ) |
Constructs an empty image. The image width and height is 0 and no data is associated with the image, i.e. data and buffer are 0. The pixel type is Image::NONE.
|
explicit |
Constructs an image for the given values.
|
explicit |
Allocates an image and reads its content from the image file filename.
|
explicit |
Allocates an image and reads its content from the image file filename. The image data is converted according to access.
|
explicit |
Copy constructs an image from image.
|
explicit |
Copy constructs an image from image.
|
explicit |
Creates an image from cvImage. The input image is not copied but a reference to it is held in the constructed image. Use this to convert an OpenCV matrix to an stromx::cvsupport::Image object.
|
explicit |
Creates an image from cvImage. The input image is not copied but a reference to it is held in the constructed image. Use this to convert an OpenCV matrix to an stromx::cvsupport::Image object. The pixel type of the resulting image is set to pixelType.
| WrongArgument | If the input pixelType can not be set, i.e. it would imply an incompatible pixel size in bytes. |
|
explicit |
Allocates an image with a buffer of a given size in bytes. The width of the 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.
|
virtual |
Returns a copy of the data object, i.e. a object of the same type is allocated and the data of the original object is copied to the new object. A pointer to the new object is returned.
Implements stromx::runtime::DataInterface.
|
virtual |
Deserializes a data object.
| out | The input which the data obtained from. |
| version | The version of the data class which serialized the input. |
Reimplemented from stromx::runtime::Data.
|
virtual |
Initializes the image to the given data. Note that this function does not change the image buffer but merely changes the description of the data contained in the image buffer.
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.
Reimplemented from stromx::runtime::ImageWrapper.
| void stromx::cvsupport::Image::open | ( | const std::string & | filename | ) |
Reads the image filename. The data of the current image is replaced by the data of the new image.
| void stromx::cvsupport::Image::open | ( | const std::string & | filename, |
| const Conversion | access | ||
| ) |
Reads the image filename. The data of the current image is replaced by the data of the new image. The read image data is converted according to access.
|
inlinevirtual |
Returns the package of the class of this data object.
Implements stromx::runtime::DataInterface.
|
static |
Saves the input image to filename. The file format is automatically determined from the file name.
| void stromx::cvsupport::Image::save | ( | const std::string & | filename | ) | const |
Saves the image to the file filename. The file format is automatically determined from the file name.
|
virtual |
Serializes this data object.
| out | The output which the data is sent to. |
Reimplemented from stromx::runtime::Data.
|
inlinevirtual |
Returns the name of the class of this data object.
Implements stromx::runtime::DataInterface.
|
inlinevirtual |
Returns the version of the class of this data object.
Implements stromx::runtime::DataInterface.
|
friend |
Returns an OpenCV matrix header for image.
1.8.12