Raytrix Light Field SDK  4.0
Logo
Public Member Functions | Protected Attributes | List of all members
Rx::CRxImageMoniker Class Reference

Detailed Description

Image moniker class. Implements the interface Interop::Runtime28::IImage but does not allocate memory.

This class implements the basic functionality for an image, but does not create its own memory block. Instead, it can hold the pointer to an image memory block created by some other means. This class therefore does not free the memory the data pointer points to, when it is deleted.

Inherits Rx::Interop::Runtime28::IImage.

Public Member Functions

 CRxImageMoniker ()
 Default constructor. More...
 
 CRxImageMoniker (const CRxImageMoniker &xMoniker)
 Constructor. More...
 
 CRxImageMoniker (CRxImageMoniker &&xMoniker)
 Move constructor. More...
 
 CRxImageMoniker (const CRxImageFormat &xFormat, const void *pvData=nullptr)
 Sets the internal image format to the given format and the internal data pointer to given data pointer. More...
 
virtual ~CRxImageMoniker ()
 Destructor. More...
 
virtual bool Create (const Interop::Runtime28::IImage *pImage)
 Creates an image moniker for given image. More...
 
virtual bool Create (int iWidth, int iHeight, Interop::Runtime28::EPixelType::ID ePixelType, Interop::Runtime28::EDataType::ID eDataType)
 Sets image format data to given type and size. No memory is allocated and internal data pointer is set to zero. More...
 
virtual bool Create (int iWidth, int iHeight, Interop::Runtime28::EPixelType::ID ePixelType, Interop::Runtime28::EDataType::ID eDataType, const void *pvData)
 Sets image format to given type and size and set internal data pointer to given data pointer. More...
 
void Create (int iWidth, int iHeight, int iPixelType, int iDataType, const void *pvData=nullptr)
 Sets image format to given type and size and set internal data pointer to given data pointer. More...
 
void Create (const CRxImageFormat &xFormat, const void *pvData=nullptr)
 Sets the internal image format to the given format and the internal data pointer to given data pointer. More...
 
void Create (const CRxImage &xImage)
 Sets image format to image format of given image and set internal data pointer to data pointer of given image. More...
 
virtual bool Destroy ()
 Sets internal data pointer to zero and reset image format data. More...
 
virtual unsigned GetByteCount () const
 Gets the number of bytes of the whole image. More...
 
virtual int GetBytesPerPixel () const
 Gets number of bytes per pixel. More...
 
virtual void * GetDataPtr ()
 Returns the pointer to the data array. More...
 
virtual const void * GetDataPtr () const
 Returns the constant pointer to the data array. More...
 
const CRxImageFormatGetFormat () const
 Gets the image format. More...
 
virtual unsigned GetPixelCount () const
 Gets the number of pixels. More...
 
virtual void GetSize (int &iWidth, int &iHeight) const
 Gets width and height of image. More...
 
virtual void GetType (int &iPixelType, int &iDataType) const
 Gets pixel and data type of image. More...
 
void GetType (Interop::Runtime28::EPixelType::ID &ePixelType, Interop::Runtime28::EDataType::ID &eDataType) const
 Gets pixel and data type of image. More...
 
bool IsOfType (Interop::Runtime28::EPixelType::ID ePixelType, Interop::Runtime28::EDataType::ID eDataType) const
 Tests whether image is of a particular pixel and data type. More...
 
virtual bool IsValid () const
 Tests whether data pointer is not zero. More...
 
CRxImageMonikeroperator= (const CRxImageMoniker &xMoniker)
 Assignment operator. More...
 
CRxImageMonikeroperator= (CRxImageMoniker &&xMoniker)
 Move assignment operator. More...
 
void Set (const void *pvData)
 Sets internal data pointer to given data pointer. More...
 

Protected Attributes

void * m_pvData
 
CRxImageFormat m_xFormat
 

Constructor & Destructor Documentation

Rx::CRxImageMoniker::CRxImageMoniker ( )

Default constructor.

Rx::CRxImageMoniker::CRxImageMoniker ( const CRxImageMoniker xMoniker)

Constructor.

Parameters
xMonikerThe moniker.
Rx::CRxImageMoniker::CRxImageMoniker ( CRxImageMoniker &&  xMoniker)

Move constructor.

Parameters
xMoniker[in] The moniker to move. Is invalid after this call.
Rx::CRxImageMoniker::CRxImageMoniker ( const CRxImageFormat xFormat,
const void *  pvData = nullptr 
)

Sets the internal image format to the given format and the internal data pointer to given data pointer.

Parameters
xFormatThe image format.
pvData(Optional) The image data pointer.
virtual Rx::CRxImageMoniker::~CRxImageMoniker ( )
virtual

Destructor.

Member Function Documentation

virtual bool Rx::CRxImageMoniker::Create ( const Interop::Runtime28::IImage pImage)
virtual

Creates an image moniker for given image.

Parameters
pImageThe image.
Returns
True if it succeeds, false if it fails.

Implements Rx::Interop::Runtime28::IImage.

virtual bool Rx::CRxImageMoniker::Create ( int  iWidth,
int  iHeight,
Interop::Runtime28::EPixelType::ID  ePixelType,
Interop::Runtime28::EDataType::ID  eDataType 
)
virtual

Sets image format data to given type and size. No memory is allocated and internal data pointer is set to zero.

Parameters
iWidthThe width.
iHeightThe weight.
ePixelTypeThe pixel type.
eDataTypeThe data type.
Returns
True if it succeeds, false if it fails.

Implements Rx::Interop::Runtime28::IImage.

virtual bool Rx::CRxImageMoniker::Create ( int  iWidth,
int  iHeight,
Interop::Runtime28::EPixelType::ID  ePixelType,
Interop::Runtime28::EDataType::ID  eDataType,
const void *  pvData 
)
virtual

Sets image format to given type and size and set internal data pointer to given data pointer.

Parameters
iWidthThe width.
iHeightThe weight.
ePixelTypeThe pixel type.
eDataTypeThe data type.
pvDataThe data pointer.
Returns
True if it succeeds, false if it fails.

Implements Rx::Interop::Runtime28::IImage.

void Rx::CRxImageMoniker::Create ( int  iWidth,
int  iHeight,
int  iPixelType,
int  iDataType,
const void *  pvData = nullptr 
)

Sets image format to given type and size and set internal data pointer to given data pointer.

Parameters
iWidthThe width.
iHeightThe weight.
iPixelTypeThe pixel type.
iDataTypeThe data type.
pvData(Optional) The data pointer.
void Rx::CRxImageMoniker::Create ( const CRxImageFormat xFormat,
const void *  pvData = nullptr 
)

Sets the internal image format to the given format and the internal data pointer to given data pointer.

Parameters
xFormatThe image format.
pvData(Optional) The data pointer.
void Rx::CRxImageMoniker::Create ( const CRxImage xImage)

Sets image format to image format of given image and set internal data pointer to data pointer of given image.

Parameters
xImageThe image.
virtual bool Rx::CRxImageMoniker::Destroy ( )
virtual

Sets internal data pointer to zero and reset image format data.

Returns
True if it succeeds, false if it fails.

Implements Rx::Interop::Runtime28::IImage.

virtual unsigned Rx::CRxImageMoniker::GetByteCount ( ) const
inlinevirtual

Gets the number of bytes of the whole image.

Returns
The byte count.

Implements Rx::Interop::Runtime28::IImage.

virtual int Rx::CRxImageMoniker::GetBytesPerPixel ( ) const
inlinevirtual

Gets number of bytes per pixel.

Returns
The bytes per pixel.

Implements Rx::Interop::Runtime28::IImage.

virtual void* Rx::CRxImageMoniker::GetDataPtr ( )
inlinevirtual

Returns the pointer to the data array.

Returns
Null if it fails, else the data pointer.

Implements Rx::Interop::Runtime28::IImage.

virtual const void* Rx::CRxImageMoniker::GetDataPtr ( ) const
inlinevirtual

Returns the constant pointer to the data array.

Returns
Null if it fails, else the data pointer.

Implements Rx::Interop::Runtime28::IImage.

const CRxImageFormat& Rx::CRxImageMoniker::GetFormat ( ) const
inline

Gets the image format.

Returns
The format.
virtual unsigned Rx::CRxImageMoniker::GetPixelCount ( ) const
inlinevirtual

Gets the number of pixels.

Returns
The pixel count.

Implements Rx::Interop::Runtime28::IImage.

virtual void Rx::CRxImageMoniker::GetSize ( int &  iWidth,
int &  iHeight 
) const
inlinevirtual

Gets width and height of image.

Parameters
iWidth[out] The width.
iHeight[out] The height.

Implements Rx::Interop::Runtime28::IImage.

virtual void Rx::CRxImageMoniker::GetType ( int &  iPixelType,
int &  iDataType 
) const
inlinevirtual

Gets pixel and data type of image.

Parameters
iPixelType[out] The pixel type.
iDataType[out] The data type.
void Rx::CRxImageMoniker::GetType ( Interop::Runtime28::EPixelType::ID ePixelType,
Interop::Runtime28::EDataType::ID eDataType 
) const
inlinevirtual

Gets pixel and data type of image.

Parameters
ePixelType[out] The pixel type.
eDataType[out] The data type.

Implements Rx::Interop::Runtime28::IImage.

bool Rx::CRxImageMoniker::IsOfType ( Interop::Runtime28::EPixelType::ID  ePixelType,
Interop::Runtime28::EDataType::ID  eDataType 
) const
inline

Tests whether image is of a particular pixel and data type.

Parameters
ePixelTypeThe pixel type.
eDataTypeThe data type.
Returns
True if of type, false if not.
virtual bool Rx::CRxImageMoniker::IsValid ( ) const
inlinevirtual

Tests whether data pointer is not zero.

Returns
True if valid, false if not.

Implements Rx::Interop::Runtime28::IImage.

CRxImageMoniker& Rx::CRxImageMoniker::operator= ( const CRxImageMoniker xMoniker)

Assignment operator.

Parameters
xMonikerThe moniker.
Returns
A shallow copy of this CRxImageMoniker.
CRxImageMoniker& Rx::CRxImageMoniker::operator= ( CRxImageMoniker &&  xMoniker)

Move assignment operator.

Parameters
xMoniker[in] The moniker to move. Is invalid after this call.
Returns
A shallow copy of this object.
void Rx::CRxImageMoniker::Set ( const void *  pvData)

Sets internal data pointer to given data pointer.

Parameters
pvDataThe data pointer.

Member Data Documentation

void* Rx::CRxImageMoniker::m_pvData
protected
CRxImageFormat Rx::CRxImageMoniker::m_xFormat
protected