Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::images::base::ImageBuffer Class Reference

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 PixelFormatgetPixelFormat () 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 SizegetSizes () 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...
 
ChannelgetPixels ()
 Return a pointer to the pixels for this image buffer. More...
 
const ChannelgetPixels () const
 Return a pointer to the pixels for this image buffer. More...
 
Channeloperator() (Index x)
 Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel. More...
 
const Channeloperator() (Index x) const
 Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel. More...
 
Channeloperator() (Index x, Index y)
 Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel. More...
 
const Channeloperator() (Index x, Index y) const
 Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel. More...
 
Channeloperator() (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 Channeloperator() (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...
 

Detailed Description

A class that contains a floating-point representation of an image that is used for efficient accurate image processing.

Member Typedef Documentation

The type that should be used for an image buffer channel value.

Constructor & Destructor Documentation

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.

Member Function Documentation

Size om::images::base::ImageBuffer::getChannelCount ( ) const
inline

Return the number of color channels there are in this image buffer.

const PixelFormat& om::images::base::ImageBuffer::getPixelFormat ( ) const
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.

Size om::images::base::ImageBuffer::getDimensionCount ( ) const
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.

const Size* om::images::base::ImageBuffer::getSizes ( ) const
inline

Return a pointer to an array containing the size along each dimension of this image buffer.

Size om::images::base::ImageBuffer::getSize ( Index  dimension) const
inline

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.

Size om::images::base::ImageBuffer::getSize1D ( ) const
inline

Return the size of the image buffer assuming it is a 1D image.

Size2D om::images::base::ImageBuffer::getSize2D ( ) const
inline

Return the size of the image buffer assuming it is a 2D image.

Size3D om::images::base::ImageBuffer::getSize3D ( ) const
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.

Channel* om::images::base::ImageBuffer::getPixels ( )
inline

Return a pointer to the pixels for this image buffer.

const Channel* om::images::base::ImageBuffer::getPixels ( ) const
inline

Return a pointer to the pixels for this image buffer.

Channel* om::images::base::ImageBuffer::operator() ( Index  x)
inline

Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel.

const Channel* om::images::base::ImageBuffer::operator() ( Index  x) const
inline

Access the image buffer as a 1-dimensional image, returning a pointer to the start of the pixel.

Channel* om::images::base::ImageBuffer::operator() ( Index  x,
Index  y 
)
inline

Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel.

const Channel* om::images::base::ImageBuffer::operator() ( Index  x,
Index  y 
) const
inline

Access the image buffer as a 2-dimensional image, returning a pointer to the start of the pixel.

Channel* om::images::base::ImageBuffer::operator() ( Index  x,
Index  y,
Index  z 
)
inline

Access the image buffer as a 3-dimensional image, returning a pointer to the start of the pixel.

const Channel* om::images::base::ImageBuffer::operator() ( Index  x,
Index  y,
Index  z 
) const
inline

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.


The documentation for this class was generated from the following file: