Thea
Classes | Public Member Functions | List of all members
IImage Class Referenceabstract

Interface for 2D and 3D images, useful for passing images across shared library boundaries. More...

#include <IImage.hpp>

Inheritance diagram for IImage:
Image

Classes

struct  Channel
 Indices for the color channels in a single pixel. More...
 
struct  Filter
 Image resampling filters (enum class). More...
 
struct  Type
 Different image types (enum class plus extra functions). More...
 

Public Member Functions

virtual int8 clear ()=0
 Destroy all image data, resetting the image to an invalid state. More...
 
virtual void const * getData () const =0
 Get a pointer to the image data. More...
 
virtual void * getData ()=0
 Get a pointer to the image data. More...
 
virtual int64 getDepth () const
 Get the depth of the image in pixels. More...
 
virtual int64 getHeight () const =0
 Get the height of the image in pixels. More...
 
virtual int32 getRowAlignment () const =0
 Get the byte alignment of a pixel row. More...
 
virtual void const * getScanLine (int64 row, int64 z=0) const =0
 Get a pointer to the beginning of a specified row of pixels, optionally for a specific depth slice. More...
 
virtual void * getScanLine (int64 row, int64 z=0)=0
 Get a pointer to the beginning of a specified row of pixels, optionally for a specific depth slice. More...
 
virtual int64 getScanWidth () const =0
 Get the number of bytes consumed by a row of pixels. More...
 
virtual int32 getType () const =0
 Get the type of the image pixels, corresponding to one of the values of the Type enum class. More...
 
virtual int64 getWidth () const =0
 Get the width of the image in pixels. More...
 
virtual int8 isValid () const =0
 Check if the image has been allocated non-zero memory space (hence has valid type and dimensions) or not. More...
 
virtual int8 resize (int64 type, int64 width, int64 height, int64 depth=1)=0
 Resize the image, changing its type and dimensions. More...
 
virtual ~IImage ()
 Destructor. More...
 

Detailed Description

Interface for 2D and 3D images, useful for passing images across shared library boundaries.

The image is assumed to be depth-major, i.e. the depth dimension is the most significant, followed by height, followed by width. A 3D image is therefore a set of 2D images stacked along the depth dimension.

Definition at line 27 of file IImage.hpp.

Constructor & Destructor Documentation

virtual ~IImage ( )
virtual

Destructor.

Definition at line 129 of file IImage.hpp.

Member Function Documentation

virtual int8 clear ( )
pure virtual

Destroy all image data, resetting the image to an invalid state.

Returns
True on success, false on error.
See also
isValid()

Implemented in Image.

virtual void const* getData ( ) const
pure virtual

Get a pointer to the image data.

Implemented in Image.

virtual void* getData ( )
pure virtual

Get a pointer to the image data.

Implemented in Image.

virtual int64 getDepth ( ) const
virtual

Get the depth of the image in pixels.

Reimplemented in Image.

Definition at line 161 of file IImage.hpp.

virtual int64 getHeight ( ) const
pure virtual

Get the height of the image in pixels.

Implemented in Image.

virtual int32 getRowAlignment ( ) const
pure virtual

Get the byte alignment of a pixel row.

Each row is padded to take up a number of bytes which is a multiple of the alignment value.

Implemented in Image.

virtual void const* getScanLine ( int64  row,
int64  z = 0 
) const
pure virtual

Get a pointer to the beginning of a specified row of pixels, optionally for a specific depth slice.

Implemented in Image.

virtual void* getScanLine ( int64  row,
int64  z = 0 
)
pure virtual

Get a pointer to the beginning of a specified row of pixels, optionally for a specific depth slice.

Implemented in Image.

virtual int64 getScanWidth ( ) const
pure virtual

Get the number of bytes consumed by a row of pixels.

Rows may be aligned to 32-bit (or other) boundaries for performance reasons, so this is not necessarily equal to the number of pixels in a row times the size of a pixel.

Implemented in Image.

virtual int32 getType ( ) const
pure virtual

Get the type of the image pixels, corresponding to one of the values of the Type enum class.

Implemented in Image.

virtual int64 getWidth ( ) const
pure virtual

Get the width of the image in pixels.

Implemented in Image.

virtual int8 isValid ( ) const
pure virtual

Check if the image has been allocated non-zero memory space (hence has valid type and dimensions) or not.

An image created by the default constructor is invalid and must be further initialized using Image::read() or a similar function.

Implemented in Image.

virtual int8 resize ( int64  type,
int64  width,
int64  height,
int64  depth = 1 
)
pure virtual

Resize the image, changing its type and dimensions.

All previous image data is discarded. type should be one of the Type values.

Returns
True on success, false on error.

Implemented in Image.


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