17 #ifndef STROMX_CVSUPPORT_IMAGE_H 18 #define STROMX_CVSUPPORT_IMAGE_H 21 #include "stromx/cvsupport/Config.h" 22 #include <stromx/runtime/ImageWrapper.h> 69 static void save(
const std::string& filename,
const runtime::Image & image);
78 explicit Image(
const unsigned int width,
const unsigned int height,
const PixelType pixelType);
81 explicit Image(
const std::string & filename);
100 explicit Image(
const cv::Mat & cvImage);
111 explicit Image(
const cv::Mat & cvImage,
const PixelType pixelType);
117 explicit Image(
const unsigned int size);
122 virtual const std::string &
type()
const {
return TYPE; }
123 virtual const std::string &
package()
const {
return PACKAGE; }
125 virtual Data* clone()
const;
130 virtual void initializeImage(
const unsigned int width,
131 const unsigned int height,
132 const unsigned int stride,
134 const PixelType pixelType);
136 virtual void initializeMatrix(
const unsigned int rows,
137 const unsigned int cols,
138 const unsigned int stride,
140 const ValueType valueType);
146 void open(
const std::string& filename);
152 void open(
const std::string & filename,
const Conversion access);
158 void save(
const std::string& filename)
const;
161 static const std::string TYPE;
162 static const std::string PACKAGE;
165 static PixelType pixelTypeFromParameters(
const int depth,
const int numChannels);
166 static int getCvAccessType(
const Conversion access);
167 static int cvTypeFromPixelType(
const runtime::Image::PixelType pixelType);
168 static int cvTypeFromValueType(
const runtime::Matrix::ValueType valueType);
169 static runtime::Image::PixelType pixelTypeFromCvType(
const int cvType);
171 void getDataFromCvImage(
const PixelType pixelType);
173 void allocate(
const unsigned int width,
const unsigned int height,
const Image::PixelType pixelType);
180 #endif // STROMX_CVSUPPORT_IMAGE_H Conversion
Definition: Image.h:40
virtual const std::string & type() const
Definition: Image.h:122
A version of an operator or data type.
Definition: Version.h:46
Concrete image without memory management.
Definition: ImageWrapper.h:27
Abstract data object.
Definition: Data.h:53
virtual const runtime::Version & version() const
Definition: Image.h:121
Provides functions to serialize data to strings and files.
Definition: OutputProvider.h:27
Image with support for reading and writing.
Definition: Image.h:34
Version version()
Returns the version of the stromx runtime library.
Definition: Runtime.cpp:54
The stromx class library.
Definition: AdjustRgbChannels.cpp:29
virtual const std::string & package() const
Definition: Image.h:123
Abstract image.
Definition: Image.h:28
cv::Mat getOpenCvMat(const runtime::Image &image)
Definition: Utilities.cpp:34