Raytrix Light Field SDK  5.0
Rx::Net::Image Class Reference

Detailed Description

Image class.

Inherits NativeWrapper< Rx::CRxImage >, and Rx::InteropNet::Runtime28::IImage.

Inherited by Rx::Net::NativeWrapperManagedExtender< Rx::LFR::CRayImage, Rx::Net::Image >, and Rx::LFR::Net::CudaHostImage.

Public Member Functions

 Image ()
 Default constructor. More...
 
 Image (Net::ImageFormat^ xFormat)
 Creates a new image and allocates memory necessary for the given image format. More...
 
 Image (Rx::CRxImage &xNative)
 Constructor. More...
 
 Image (Rx::CRxImage &xNative, bool bTransferOwnership)
 Constructor. More...
 
 Image (System::Int32 iWidth, System::Int32 iHeight, InteropNet::Runtime28::EPixelType ePixelType, InteropNet::Runtime28::EDataType eDataType)
 Constructor. More...
 
virtual ImageClone ()
 Makes a deep copy of this object. More...
 
void ConvertCustomType (Rx::Net::Image^ xTrgImg)
 Converts this image from a custom data type into the corresponding primitive data type. More...
 
ImageConvertType (InteropNet::Runtime28::EPixelType ePixelType, InteropNet::Runtime28::EDataType eDataType)
 
bool Create (int iWidth, int iHeight, EPixelType ePixelType, EDataType eDataType)
 Prepares memory. More...
 
virtual bool Create (Net::ImageFormat^ xFormat)
 Creates a new image and allocates memory necessary for the given image format. More...
 
virtual void Create (Rx::Net::Image^ xCopiedImage)
 Creates a new image which is a copy of the provided source image. More...
 
virtual bool Create (System::Int32 iWidth, System::Int32 iHeight, InteropNet::Runtime28::EPixelType ePixelType, InteropNet::Runtime28::EDataType eDataType)
 Creates a new image and allocates memory necessary for given parameters. More...
 
virtual bool Destroy ()
 Destroys this image and frees all memory used. More...
 
virtual System::Int32 GetByteCount ()
 Get the number of bytes of the whole image. More...
 
virtual System::Int32 GetBytesPerPixel ()
 Gets the bytes per pixel. More...
 
virtual void * GetDataPtr ()
 Gets the data pointer. More...
 
virtual System::Int32 GetPixelCount ()
 Get the number of pixels. More...
 
bool GetPixelNormalized (int iX, int iY, double &dR, double &dG, double &dB, double &dA)
 
virtual void GetSize (System::Int32^ % iWidth, System::Int32^ % iHeight)
 Get width and height of image. More...
 
virtual void GetType (InteropNet::Runtime28::EPixelType % ePixelType, InteropNet::Runtime28::EDataType % eDataType)
 Get pixel and data type of image. More...
 
bool IsOfType (InteropNet::Runtime28::EPixelType ePixelType, InteropNet::Runtime28::EDataType eDataType)
 Test whether image is of a particular pixel and data type. More...
 
bool Normalize ()
 Find minimal and maximal value of image and normalize image to range [0,1]. More...
 
void SetTimestampID (double dTimestamp, unsigned uID)
 Sets the timestamp and the ID of the image. More...
 
void SetZero ()
 

Properties

InteropNet::Runtime28::EDataType DataType [get]
 Gets the type of the data. More...
 
Net::ImageFormatFormat [get]
 Gets the format of this image. More...
 
System::Int32 Height [get]
 Gets the height of this image in pixels. More...
 
unsigned ID [get, set]
 Gets or sets the ID of this image. More...
 
System::Boolean IsValid [get]
 Flags whether this image is valid or not. More...
 
InteropNet::Runtime28::EPixelType PixelType [get]
 Gets the type of the pixel. More...
 
double Timestamp [get, set]
 Gets or sets the timestamp of the image capture. Is 0.0 if this image has no timestamp. More...
 
System::Int32 Width [get]
 Gets the width of this image in pixels. More...
 

Constructor & Destructor Documentation

◆ Image() [1/5]

Rx::Net::Image::Image ( )

Default constructor.

◆ Image() [2/5]

Rx::Net::Image::Image ( Rx::CRxImage xNative)
inline

Constructor.

Wraps the given native instance instead of creating an own instance. The given native instance must be valid for the lifetime of this instance.

Parameters
xNative[in] The native instance to be wrapped by this class.

◆ Image() [3/5]

Rx::Net::Image::Image ( Rx::CRxImage xNative,
bool  bTransferOwnership 
)
inlineexplicit

Constructor.

Wraps the given native instance instead of creating an own instance. The native instance will be released if the ownership has been transferred. If the ownership has not been transferred, the given native instance must be valid for the lifetime of this instance.

Parameters
xNative[in] The native instance to be wrapped by this class.
bTransferOwnershipTrue to transfer the ownership of the native instance to the created image.

◆ Image() [4/5]

Rx::Net::Image::Image ( Net::ImageFormat xFormat)

Creates a new image and allocates memory necessary for the given image format.

Parameters
xFormat[in] The image format.

◆ Image() [5/5]

Rx::Net::Image::Image ( System::Int32  iWidth,
System::Int32  iHeight,
InteropNet::Runtime28::EPixelType  ePixelType,
InteropNet::Runtime28::EDataType  eDataType 
)

Constructor.

Parameters
iWidthThe image width in pixels.
iHeightThe image height in pixel.
ePixelTypeThe pixel type.
eDataTypeThe data type.

Member Function Documentation

◆ Clone()

virtual Image ^ Rx::Net::Image::Clone ( )
virtual

Makes a deep copy of this object.

Returns
A copy of this object.

◆ ConvertCustomType()

void Rx::Net::Image::ConvertCustomType ( Rx::Net::Image xTrgImg)
inline

Converts this image from a custom data type into the corresponding primitive data type.

The following conversion are implemented:

  • EDataType::Custom_10in16_LSB into EDataType::UShort
  • EDataType::Custom_12in16_LSB into EDataType::UShort.
Parameters
xTrgImg[out] The target image. This is created within the correct format.

◆ ConvertType()

Image ^ Rx::Net::Image::ConvertType ( InteropNet::Runtime28::EPixelType  ePixelType,
InteropNet::Runtime28::EDataType  eDataType 
)

◆ Create() [1/4]

bool Rx::InteropNet::Runtime28::IImage::Create ( int  iWidth,
int  iHeight,
EPixelType  ePixelType,
EDataType  eDataType 
)
inherited

Prepares memory.

Parameters
iWidthThe width.
iHeightThe height.
ePixelTypeIdentifier for the image type.
eDataTypeIdentifier for the data type.
Returns
True if it succeeds, false if it fails.

◆ Create() [2/4]

virtual bool Rx::Net::Image::Create ( Net::ImageFormat xFormat)
virtual

Creates a new image and allocates memory necessary for the given image format.

If an image has been created before, the old image and all used memory is freed before creating the new image.

Parameters
xFormat[in] The image format.
Returns
True if it succeeds, false if it fails.

◆ Create() [3/4]

virtual void Rx::Net::Image::Create ( Rx::Net::Image xCopiedImage)
virtual

Creates a new image which is a copy of the provided source image.

This function only allocates memory if this operation changes the layout of the stored image.

Parameters
xCopiedImage[in] The image which should be copied.

◆ Create() [4/4]

virtual bool Rx::Net::Image::Create ( System::Int32  iWidth,
System::Int32  iHeight,
InteropNet::Runtime28::EPixelType  ePixelType,
InteropNet::Runtime28::EDataType  eDataType 
)
virtual

Creates a new image and allocates memory necessary for given parameters.

If an image has been created before, the old image and all used memory is freed before creating the new image.

Parameters
iWidthZero-based index of the width.
iHeightZero-based index of the height.
ePixelTypeType of the image.
eDataTypeType of the data.
Returns
True if it succeeds, false if it fails.

◆ Destroy()

virtual bool Rx::Net::Image::Destroy ( )
virtual

Destroys this image and frees all memory used.

Returns
True if it succeeds, false if it fails.

Implements Rx::InteropNet::Runtime28::IImage.

◆ GetByteCount()

virtual System::Int32 Rx::Net::Image::GetByteCount ( )
inlinevirtual

Get the number of bytes of the whole image.

◆ GetBytesPerPixel()

virtual System::Int32 Rx::Net::Image::GetBytesPerPixel ( )
virtual

Gets the bytes per pixel.

Returns
The bytes per pixel.

Implements Rx::InteropNet::Runtime28::IImage.

◆ GetDataPtr()

virtual void* Rx::Net::Image::GetDataPtr ( )
virtual

Gets the data pointer.

Returns
null if it fails, else the data pointer.

Implements Rx::InteropNet::Runtime28::IImage.

◆ GetPixelCount()

virtual System::Int32 Rx::Net::Image::GetPixelCount ( )
inlinevirtual

Get the number of pixels.

◆ GetPixelNormalized()

bool Rx::Net::Image::GetPixelNormalized ( int  iX,
int  iY,
double &  dR,
double &  dG,
double &  dB,
double &  dA 
)
inline

◆ GetSize()

virtual void Rx::Net::Image::GetSize ( System::Int32^ %  iWidth,
System::Int32^ %  iHeight 
)
inlinevirtual

Get width and height of image.

◆ GetType()

virtual void Rx::Net::Image::GetType ( InteropNet::Runtime28::EPixelType ePixelType,
InteropNet::Runtime28::EDataType eDataType 
)
inlinevirtual

Get pixel and data type of image.

◆ IsOfType()

bool Rx::Net::Image::IsOfType ( InteropNet::Runtime28::EPixelType  ePixelType,
InteropNet::Runtime28::EDataType  eDataType 
)
inline

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

◆ Normalize()

bool Rx::Net::Image::Normalize ( )
inline

Find minimal and maximal value of image and normalize image to range [0,1].

Attention
Is currently only implemented for pixel type TPixel_L_f.

◆ SetTimestampID()

void Rx::Net::Image::SetTimestampID ( double  dTimestamp,
unsigned  uID 
)
inline

Sets the timestamp and the ID of the image.

Parameters
dTimestampThe timestamp.
uIDThe ID.

◆ SetZero()

void Rx::Net::Image::SetZero ( )
inline

Property Documentation

◆ DataType

InteropNet:: Runtime28:: EDataType Rx::Net::Image::DataType
get

Gets the type of the data.

◆ Format

Net:: ImageFormat^ Rx::Net::Image::Format
get

Gets the format of this image.

◆ Height

System:: Int32 Rx::Net::Image::Height
get

Gets the height of this image in pixels.

◆ ID

unsigned Rx::Net::Image::ID
getset

Gets or sets the ID of this image.

◆ IsValid

System:: Boolean Rx::Net::Image::IsValid
get

Flags whether this image is valid or not.

An image is valid if memory has been allocated.

◆ PixelType

InteropNet:: Runtime28:: EPixelType Rx::Net::Image::PixelType
get

Gets the type of the pixel.

◆ Timestamp

double Rx::Net::Image::Timestamp
getset

Gets or sets the timestamp of the image capture. Is 0.0 if this image has no timestamp.

◆ Width

System:: Int32 Rx::Net::Image::Width
get

Gets the width of this image in pixels.