Om
1.0.0
A universal framework for multimedia simulation
|
A class that contains a floating-point representation of an image that is used for efficient accurate image processing. More...
#include <omImageBuffer.h>
Public Types | |
typedef Float32 | Channel |
The type that should be used for an image buffer channel value. More... | |
Public Member Functions | |
ImageBuffer () | |
Create an empty image buffer with an undefined pixel format. More... | |
ImageBuffer (const PixelFormat &newPixelFormat) | |
Create an empty image buffer with the specified pixel format. More... | |
ImageBuffer (const PixelFormat &newPixelFormat, Size size0) | |
Create a 1D image buffer with the specified pixel format. More... | |
ImageBuffer (const PixelFormat &newPixelFormat, Size size0, Size size1) | |
Create a 2D image buffer with the specified pixel format. More... | |
ImageBuffer (const PixelFormat &newPixelFormat, Size size0, Size size1, Size size2) | |
Create a 3D image buffer with the specified pixel format. More... | |
ImageBuffer (const PixelFormat &newPixelFormat, const Size *sizes, Size numDimensions) | |
Create an image object with the specified pixel format and an arbitrary number of dimensions. More... | |
ImageBuffer (const Image &image) | |
Create an image buffer that contains the contents of the specified image. More... | |
Size | getChannelCount () const |
Return the number of color channels there are in this image buffer. More... | |
const PixelFormat & | getPixelFormat () const |
Return an object that describes the pixel format of this image. More... | |
void | setPixelFormat (const PixelFormat &newPixelFormat) |
Change the pixel format of this image. More... | |
Size | getDimensionCount () const |
Return the number of dimensions in this image, usually 1, 2, or 3. More... | |
const Size * | getSizes () const |
Return a pointer to an array containing the size along each dimension of this image buffer. More... | |
Size | getSize (Index dimension) const |
Return the size of the image along the specified dimension index. More... | |
Size | getSize1D () const |
Return the size of the image buffer assuming it is a 1D image. More... | |
Size2D | getSize2D () const |
Return the size of the image buffer assuming it is a 2D image. More... | |
Size3D | getSize3D () const |
Return the size of the image buffer assuming it is a 3D image. More... | |
Size | getPixelCount () const |
Return the total number of pixels in the image buffer. More... | |
Channel * | getPixels () |
Return a pointer to the pixels for this image buffer. More... | |
const Channel * | getPixels () const |
Return a pointer to the pixels for this image buffer. More... | |
Channel * | operator() (Index x) |
Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel. More... | |
const Channel * | operator() (Index x) const |
Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel. More... | |
Channel * | operator() (Index x, Index y) |
Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel. More... | |
const Channel * | operator() (Index x, Index y) const |
Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel. More... | |
Channel * | operator() (Index x, Index y, Index z) |
Access the image buffer as a 3-dimensional image, returning a pointer to the start of the pixel. More... | |
const Channel * | operator() (Index x, Index y, Index z) const |
Access the image buffer as a 3-dimensional image, returning a pointer to the start of the pixel. More... | |
void | getImage (Image &image) |
Convert the image buffer contents to an image using the buffer's pixel format. More... | |
void | getImage (Image &image, const PixelFormat &pixelFormat) |
Convert the image buffer contents to an image using the specified pixel format. More... | |
A class that contains a floating-point representation of an image that is used for efficient accurate image processing.
The type that should be used for an image buffer channel value.
om::images::base::ImageBuffer::ImageBuffer | ( | ) |
Create an empty image buffer with an undefined pixel format.
om::images::base::ImageBuffer::ImageBuffer | ( | const PixelFormat & | newPixelFormat | ) |
Create an empty image buffer with the specified pixel format.
om::images::base::ImageBuffer::ImageBuffer | ( | const PixelFormat & | newPixelFormat, |
Size | size0 | ||
) |
Create a 1D image buffer with the specified pixel format.
om::images::base::ImageBuffer::ImageBuffer | ( | const PixelFormat & | newPixelFormat, |
Size | size0, | ||
Size | size1 | ||
) |
Create a 2D image buffer with the specified pixel format.
om::images::base::ImageBuffer::ImageBuffer | ( | const PixelFormat & | newPixelFormat, |
Size | size0, | ||
Size | size1, | ||
Size | size2 | ||
) |
Create a 3D image buffer with the specified pixel format.
om::images::base::ImageBuffer::ImageBuffer | ( | const PixelFormat & | newPixelFormat, |
const Size * | sizes, | ||
Size | numDimensions | ||
) |
Create an image object with the specified pixel format and an arbitrary number of dimensions.
The user specifies the number of dimensions in the image and a pointer to an array of sizes along each dimension.
om::images::base::ImageBuffer::ImageBuffer | ( | const Image & | image | ) |
Create an image buffer that contains the contents of the specified image.
|
inline |
Return the number of color channels there are in this image buffer.
|
inline |
Return an object that describes the pixel format of this image.
void om::images::base::ImageBuffer::setPixelFormat | ( | const PixelFormat & | newPixelFormat | ) |
Change the pixel format of this image.
If any channels of the pixel format are not the same storage type as an image buffer channel, the storage type is converted to the image buffer channel storage type. If the number of color channels changes then the image buffer's contents are undefined, otherwise the color channels are reinterpreted with the new format.
|
inline |
Return the number of dimensions in this image, usually 1, 2, or 3.
A 1D image is an array of pixels, a 2D image is a plane of pixels, a 3D image is a rectangular volume of voxels, etc.
|
inline |
Return a pointer to an array containing the size along each dimension of this image buffer.
Return the size of the image along the specified dimension index.
Indices start from 0 and count to d-1 for a image with d dimensions. If the specified dimension index is out of bounds, 1 is returned.
|
inline |
Return the size of the image buffer assuming it is a 1D image.
|
inline |
Return the size of the image buffer assuming it is a 2D image.
|
inline |
Return the size of the image buffer assuming it is a 3D image.
Size om::images::base::ImageBuffer::getPixelCount | ( | ) | const |
Return the total number of pixels in the image buffer.
|
inline |
Return a pointer to the pixels for this image buffer.
|
inline |
Return a pointer to the pixels for this image buffer.
Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel.
Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel.
Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel.
Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel.
Access the image buffer as a 3-dimensional image, returning a pointer to the start of the pixel.
Access the image buffer as a 3-dimensional image, returning a pointer to the start of the pixel.
void om::images::base::ImageBuffer::getImage | ( | Image & | image | ) |
Convert the image buffer contents to an image using the buffer's pixel format.
void om::images::base::ImageBuffer::getImage | ( | Image & | image, |
const PixelFormat & | pixelFormat | ||
) |
Convert the image buffer contents to an image using the specified pixel format.