The Common Vision Blox image. More...
#include <cvb/image.hpp>
Inherited by DeviceImage, StreamImage, PanoramicMappedImage, and WrappedImage.
Public Member Functions | |
Image (Size2D< int > size, int numPlanes=1, DataType dataType=DataType::Int8BppUnsigned()) | |
Constructs an uninitialized image with the given parameters. More... | |
Image (int width, int height, int numPlanes=1, DataType dataType=DataType::Int8BppUnsigned()) | |
Constructs an uninitialized image with the given parameters. More... | |
Image (const String &fileName) | |
Loads an image with the given file name. More... | |
void * | Handle () const noexcept |
Classic API image handle. More... | |
int | PlanesCount () const noexcept |
Get the number of planes for this image. More... | |
bool | PlaneDataTypesIdentical () const noexcept |
Check if all planes have the same data type. More... | |
ImagePlane | Plane (int plane) const |
Indexed access to the individual plane information. More... | |
std::vector< ImagePlane > | Planes () const noexcept |
Access all planes for this image. More... | |
std::vector< double > | GetPixel (Point2D< int > position) const |
Gets the pixel values for all planes at a give position. More... | |
int | Height () const noexcept |
Height of the image in pixels. More... | |
int | Width () const noexcept |
Width of the image in pixels. More... | |
Cvb::ColorModel | ColorModel () const noexcept |
Color model realized by this image. More... | |
void | Save (const String &fileName) const |
Write the current content of the image into a file. More... | |
void | Save (const String &fileName, double quality) const |
Write the current content of the image into a file. More... | |
std::unique_ptr< Image > | Map (Rect< int > rect) const |
Creates a mapped image of the region of this image. More... | |
std::unique_ptr< Image > | Map (Rect< int > sourceRect, Size2D< int > targetSize) const |
Creates a mapped image of the region of that image scaled to the size. More... | |
std::unique_ptr< Image > | Map (RotationMap rotation) const |
Creates a mapped image of this whole image rotated by the given RotationMap. More... | |
std::unique_ptr< Image > | Clone () const |
Creates a new image object, that is a copy of the current instance. More... | |
void | Copy (Image &targetImage, Rect< int > sourceRect, Point2D< int > targetPosition) const |
Copies the image data from the source rectangle of this image to the target position inside the target image. More... | |
void | Copy (Image &targetImage) const |
Copies the image data from this image to the target image. More... | |
Size2D< int > | Size () const noexcept |
Size of the image in pixels. More... | |
Rect< int > | Bounds () const noexcept |
Bounding rectangle of the image in pixels. More... | |
void | RaisePixelContentChanged () const |
Inform clients listening to the pixel content changed event, that the image data has been completely updated (full area). More... | |
void | RaisePixelContentChanged (Rect< int > rect) const |
Inform clients listening to the pixel content changed event, that the image data has been updated in the given rectangle. More... | |
EventCookie | RegisterEventPixelContentChanged (std::function< void(const Image &, Rect< int >)> handler) |
Register a listener to the pixel content changed event. More... | |
void | UnregisterEventPixelContentChanged (EventCookie eventCookie) noexcept |
Manually unregister a listener from the pixel content changed event. More... | |
Point2D< double > | ImageToPixelCoordinates (Point2D< double > point) const noexcept |
Convert a point from image to pixel coordinates. More... | |
Area2D | ImageToPixelCoordinates (Area2D area) const noexcept |
Convert an Area2D from image to pixel coordinates. More... | |
Point2D< double > | PixelToImageCoordinates (Point2D< double > point) const noexcept |
Convert a point from pixel to image coordinates. More... | |
Area2D | PixelToImageCoordinates (Area2D area) const noexcept |
Convert an Area2D from pixel to image coordinates. More... | |
AffineMatrix2D | CoordinateSystem () const noexcept |
Get the coordinate system of the image. More... | |
void | SetCoordinateSystem (AffineMatrix2D affineMatrix) noexcept |
Set the coordinate system of the image. More... | |
Static Public Member Functions | |
static std::unique_ptr< Image > | Load (const String &fileName) |
Loads an image with the given file name. More... | |
static std::unique_ptr< Image > | Create (Size2D< int > size, int numPlanes=1, DataType dataType=DataType::Int8BppUnsigned()) |
Creates an uninitialized image with the given parameters. More... | |
static std::unique_ptr< Image > | Create (int width, int height, int numPlanes=1, DataType dataType=DataType::Int8BppUnsigned()) |
Creates an uninitialized image with the given parameters. More... | |
template<class RANGE > | |
static TypedRange< std::unique_ptr< Image >, ImagePtr, RANGE >::type | FromImages (MappingOption mapping, const RANGE &images) |
Create an image that is the result of concatenating a series of input images. More... | |
template<class... IMAGES> | |
static VarArgRange< std::unique_ptr< Image >, constImage &, IMAGES... >::type | FromImages (MappingOption mapping, const IMAGES &... images) |
Create an image that is the result of concatenating a series of input images. More... | |
template<class RANGE > | |
static TypedRange< std::unique_ptr< Image >, ImagePlane, RANGE >::type | FromPlanes (MappingOption mapping, const RANGE &planes) |
Create an image that is the result of concatenating a series of input planes. More... | |
template<class... PLANES> | |
static VarArgRange< std::unique_ptr< Image >, ImagePlane &&, PLANES... >::type | FromPlanes (MappingOption mapping, PLANES &&... planes) |
Create an image that is the result of concatenating a series of input planes. More... | |
static std::unique_ptr< Image > | FromHandle (HandleGuard< Image > &&guard) |
Creates an image from a classic API handle. More... | |
template<class T , class... ARGS> | |
static std::unique_ptr< T > | FromHandle (HandleGuard< Image > &&guard, ARGS &&... args) |
Creates an image from a classic API handle (typed). More... | |
static std::unique_ptr< Image > | FromPixelFormat (const Cvb::Size2D< int > &size, Cvb::PfncFormat format) |
Creates an image from a specified pixel format. More... | |
static std::unique_ptr< Image > | FromPixelFormat (int width, int height, Cvb::PfncFormat format) |
Creates an image from a specified pixel format. More... | |
Related Functions | |
(Note that these are not member functions.) | |
std::unique_ptr< Image > | AffineTransform (const Image &image, AffineMatrix2D affineMatrix, Area2D area) |
Creates an affine transformation (homogeneous matrix transformation) of an area of the given image. More... | |
std::unique_ptr< Image > | AffineTransform (const Image &image, AffineMatrix2D affineMatrix) |
Creates an affine transformation (homogeneous matrix transformation) of the whole image. More... | |
std::unique_ptr< Image > | LinearTransform (const Image &image, Matrix2D matrix) |
Creates a linear transformation (matrix transformation). More... | |
std::unique_ptr< Image > | MapTo8Bit (const Image &image, PlaneNormalization planeNormalization=PlaneNormalization::Identical) |
Take an input image and scale the pixel values to fit into the 8 bit value range. More... | |
std::unique_ptr< Image > | NormalizeMinMax (const Image &image, double targetMin, double targetMax) |
Normalize an input image using min/max normalization (the gray values of the image will be stretched or compressed to fit the input target minimum and maximum values). More... | |
std::unique_ptr< Image > | NormalizeMeanVariance (const Image &image, double targetMean, double targetVariance) |
Normalize an input image using mean/variance normalization (the gray values of the image will be stretched modified to generate a histogram as close as possible to the input target mean and variance values). More... | |
std::unique_ptr< Image > | PolarTransform (const Image &image, Point2D< double > center, double innerRadius, double outerRadius, Angle startAngle, Angle totalAngle) |
Create a polar transformation (i.e. unwrap a ring structure from inside source image into a rectangular image). More... | |
std::unique_ptr< Image > | PolarTransform (const Image &image, Point2D< double > center, double innerRadius, double outerRadius) |
Create a polar transformation (i.e. unwrap a ring structure from inside source image into a rectangular image). More... | |
std::unique_ptr< Image > | InversePolarTransform (const Image &image, Angle startAngle, double innerRadius) |
void | InversePolarTransformToDst (const Image &imageSrc, Point2D< double > center, Angle startAngle, double innerRadius, Image &imageDst) |
Create an inverse polar transformed image (i.e. transform an unwrapped image back into a ring structure). More... | |
The Common Vision Blox image.
|
inlineexplicit |
Constructs an uninitialized image with the given parameters.
[in] | size | Size of the image in pixels. |
[in] | numPlanes | Number of (color) info. |
[in] | dataType | Pixel data type. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Constructs an uninitialized image with the given parameters.
[in] | width | Width of the image in pixels. |
[in] | height | Height of the image in pixels. |
[in] | numPlanes | Number of (color) info. |
[in] | dataType | Pixel data type. |
Any | exception derived from std::exception including CvbException. |
Loads an image with the given file name.
[in] | fileName | The file name. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Bounding rectangle of the image in pixels.
Does | not throw any exception. |
|
inline |
Creates a new image object, that is a copy of the current instance.
Any | exception derived from std::exception including CvbException. |
This method performs a deep copy of the image data the current instance currently points to.
|
inlinenoexcept |
Color model realized by this image.
Does | not throw any exception. |
|
inlinenoexcept |
Get the coordinate system of the image.
Does | not throw any exception. |
|
inline |
Copies the image data from this image to the target image.
[in] | targetImage | Image to copy to. |
Any | exception derived from std::exception including CvbException. |
This is equivalent to calling CvbImage::Copy(targetImage, Bounds(), CvbPoint());
|
inline |
Copies the image data from the source rectangle of this image to the target position inside the target image.
[in] | targetImage | Image to copy to. |
[in] | sourceRect | Source rectangle in pixels to copy from. |
[in] | targetPosition | Position in the target image in pixels to copy to. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates an uninitialized image with the given parameters.
[in] | width | Width of the image in pixels. |
[in] | height | Height of the image in pixels. |
[in] | numPlanes | Number of (color) info. |
[in] | dataType | Pixel data type. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates an uninitialized image with the given parameters.
[in] | size | Size of the image in pixels. |
[in] | numPlanes | Number of (color) info. |
[in] | dataType | Pixel data type. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates an image from a classic API handle.
[in] | guard | Life time guard for C-API handle. |
Any | exception derived from std::exception including CvbException. |
The image takes ownership of the handle, so you must share it before using this function.
|
inlinestatic |
Creates an image from a classic API handle (typed).
[in] | guard | Life time guard for C-API handle. |
[in] | args | Optional further arguments. |
Any | exception derived from std::exception including CvbException. |
The image takes ownership of the handle, so you must share it before using this function. Use with extreme caution, as the handle must fulfill the requirements of the specified derived image type. As the are no checks if this is the case, you may get objects with undefined behavior.
|
inlinestatic |
Create an image that is the result of concatenating a series of input images.
[in] | mapping | Selects the relationship between the result image and the input images. |
[in] | images | Images to be concatenated; all images in the input array must have equal size. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Create an image that is the result of concatenating a series of input images.
[in] | mapping | Selects the relationship between the result image and the input images. |
[in] | images | Images to be concatenated; all images in the input array must have equal size. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates an image from a specified pixel format.
[in] | size | Size of the image in pixels. |
[in] | format | Pixel format of the image to be created. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Creates an image from a specified pixel format.
[in] | width | Width of the image in pixels. |
[in] | height | Height of the image in pixels. |
[in] | format | Pixel format of the image to be created. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Create an image that is the result of concatenating a series of input planes.
[in] | mapping | Selects the relationship between the result image and the input planes. |
[in] | planes | Planes to be concatenated. All planes in the input array must have equal size. |
Any | exception derived from std::exception including CvbException. |
|
inlinestatic |
Create an image that is the result of concatenating a series of input planes.
[in] | mapping | Selects the relationship between the result image and the input planes. |
[in] | planes | Planes to be concatenated. All planes in the input array must have equal size. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Gets the pixel values for all planes at a give position.
[in] | position | Pixel position. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Classic API image handle.
Does | not throw any exception. |
It is normally not necessary to work with this handle.
|
inlinenoexcept |
Height of the image in pixels.
Does | not throw any exception. |
Convert an Area2D from image to pixel coordinates.
[in] | area | Area in image coordinates. |
Does | not throw any exception. |
Convert a point from image to pixel coordinates.
[in] | point | Point in image coordinates. |
Does | not throw any exception. |
|
inlinestatic |
Loads an image with the given file name.
[in] | fileName | The file name. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Creates a mapped image of the region of this image.
[in] | rect | Region to create the map from. |
Any | exception derived from std::exception including CvbException. |
This is equivalent to calling CvbImage::Map(rect, rect.Size());
|
inline |
Creates a mapped image of the region of that image scaled to the size.
[in] | sourceRect | Region to create the map from. |
[in] | targetSize | Target size of the mapped image. |
Any | exception derived from std::exception including CvbException. |
As this is simply a view to another image, no interpolation is done, when the mapped pixels are accessed. Smaller sizes lead to pixel skipping, while larger sizes lead to replicated pixels.
|
inline |
Creates a mapped image of this whole image rotated by the given RotationMap.
[in] | rotation | Rotation to apply. |
Any | exception derived from std::exception including CvbException. |
This is simply a view to another image, no data is copied. Please be aware that rotating an image map will have a negative performance impact when iterating through the mapped images' pixels.
Convert an Area2D from pixel to image coordinates.
[in] | area | Area in pixel coordinates. |
Does | not throw any exception. |
Convert a point from pixel to image coordinates.
[in] | point | Point in pixel coordinates. |
Does | not throw any exception. |
|
inline |
Indexed access to the individual plane information.
[in] | plane | Index of the plane to be accessed. |
Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Check if all planes have the same data type.
Does | not throw any exception. |
|
inlinenoexcept |
Access all planes for this image.
Does | not throw any exception. |
|
inlinenoexcept |
Get the number of planes for this image.
Does | not throw any exception. |
|
inline |
Inform clients listening to the pixel content changed event, that the image data has been completely updated (full area).
Any | exception derived from std::exception including CvbException. |
|
inline |
Inform clients listening to the pixel content changed event, that the image data has been updated in the given rectangle.
[in] | rect | Affected area. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Register a listener to the pixel content changed event.
[in] | handler | Listener to pixel content changed event. |
Any | exception derived from std::exception including CvbException. |
|
inline |
Write the current content of the image into a file.
[in] | fileName | File name into which to save the image. |
Any | exception derived from std::exception including CvbException. |
The file format to be used is determined by the extension of the file name.
|
inline |
Write the current content of the image into a file.
[in] | fileName | File name into which to save the image. |
[in] | quality | at which to save the image (should be in the range 0...1) |
Any | exception derived from std::exception including CvbException. |
The file format to be used is determined by the extension of the file name. If a lossless format is used, the given quality is ignored.
|
inlinenoexcept |
Set the coordinate system of the image.
[in] | affineMatrix | The new coordinate system. |
Does | not throw any exception. |
|
inlinenoexcept |
Size of the image in pixels.
Does | not throw any exception. |
|
inlinenoexcept |
Manually unregister a listener from the pixel content changed event.
[in] | eventCookie | Event cookie obtained from registering the listener. |
Does | not throw any exception. |
|
inlinenoexcept |
Width of the image in pixels.
Does | not throw any exception. |
|
related |
Creates an affine transformation (homogeneous matrix transformation) of the whole image.
[in] | image | Source image. |
[in] | affineMatrix | Matrix to transform the image. |
Any | exception derived from std::exception including CvbException. |
|
related |
Creates an affine transformation (homogeneous matrix transformation) of an area of the given image.
[in] | image | Source image. |
[in] | affineMatrix | Matrix to transform the image, |
[in] | area | Area of the image to transform. |
Any | exception derived from std::exception including CvbException. |
|
related |
[in] | image | Source image. |
[in] | startAngle | Orientation of the start (the total azimuth will be determined from the input image). |
[in] | innerRadius | Inner radius of the ring (the outer radius will be determined from the input image). |
Any | exception derived from std::exception including CvbException. |
Linear interpolation is being used for the transformation.
|
related |
Create an inverse polar transformed image (i.e. transform an unwrapped image back into a ring structure).
[in] | imageSrc | Source image |
[in] | center | Center for the inverse transformation (i.e. the point around which the ring will be constructed). |
[in] | startAngle | Orientation of the start (the total azimuth will be determined from the input image). |
[in] | innerRadius | Inner radius of the ring (the outer radius will be determined from the input image). |
[in] | imageDst | Destination image into which the unwrap result will be painted. |
Any | exception derived from std::exception including CvbException. |
Linear interpolation is being used for the transformation.
|
related |
Creates a linear transformation (matrix transformation).
[in] | image | Source image. |
[in] | matrix | Matrix to transform the image. |
Any | exception derived from std::exception including CvbException. |
Linear interpolation is used for the transformation.
|
related |
Take an input image and scale the pixel values to fit into the 8 bit value range.
Any | exception derived from std::exception including CvbException. |
|
related |
Normalize an input image using mean/variance normalization (the gray values of the image will be stretched modified to generate a histogram as close as possible to the input target mean and variance values).
[in] | image | Image to be normalized. |
[in] | targetMean | Target mean value to achieve. |
[in] | targetVariance | Target variance value to achieve. |
Any | exception derived from std::exception including CvbException. |
|
related |
Normalize an input image using min/max normalization (the gray values of the image will be stretched or compressed to fit the input target minimum and maximum values).
[in] | image | Image to be normalized. |
[in] | targetMin | Target minimum value to achieve. |
[in] | targetMax | Target maximum value to achieve. |
Any | exception derived from std::exception including CvbException. |
|
related |
Create a polar transformation (i.e. unwrap a ring structure from inside source image into a rectangular image).
[in] | image | Source image. |
[in] | center | Center image for the polar transform. |
[in] | innerRadius | Inner radius of the ring. |
[in] | outerRadius | Outer radius of the ring. |
Any | exception derived from std::exception including CvbException. |
Linear interpolation is being used for the transformation.
|
related |
Create a polar transformation (i.e. unwrap a ring structure from inside source image into a rectangular image).
[in] | image | Source image. |
[in] | center | Center image for the polar transform. |
[in] | innerRadius | Inner radius of the ring. |
[in] | outerRadius | Outer radius of the ring. |
[in] | startAngle | Orientation of the start angle. |
[in] | totalAngle | The total angle to cover. |
Any | exception derived from std::exception including CvbException. |
Linear interpolation is being used for the transformation.