NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::ITexture Class Referenceabstract

A base class that defines the properties of a texture of resolution [x,y] for a given pixel format. More...

#include <itexture.h>

Inherits mi::base::Interface_declare< 0x633c679, ... >.

Public Types

enum  Pixel_format {
  RGBA_UINT8 = 0 ,
  RGBA_FLOAT32 = 1
}
 Pixel format. More...
 

Public Member Functions

virtual mi::Uint32 get_resolution_x () const =0
 Get the horizontal resolution of the texture. More...
 
virtual mi::Uint32 get_resolution_y () const =0
 Get the vertical resolution of the texture. More...
 
virtual Pixel_format get_pixel_format () const =0
 Get the pixel format of the texture. More...
 
virtual bool set_pixel_data (const void *pixel_data, mi::Uint32 width, mi::Uint32 height, Pixel_format format)=0
 Set the texture data from a buffer. More...
 
virtual bool set_pixel_data (const mi::neuraylib::ICanvas *canvas, Pixel_format format)=0
 Set the texture data from a canvas. More...
 
virtual const void * get_pixel_data () const =0
 Get the texture data. More...
 

Detailed Description

A base class that defines the properties of a texture of resolution [x,y] for a given pixel format.

The origin of the texture coordinate system is defined to be the lower-left corner.

Note
The texture is only used in combination with an IIcon_2D.

Member Enumeration Documentation

 Pixel_format

Pixel format.

Enumerator
RGBA_UINT8 

RGBA color, every component unsigned 8-bit integer.

RGBA_FLOAT32 

RGBA color, every component a 32-bit IEEE-754 single-precision normalized floating-point number.

Member Function Documentation

 get_pixel_data()

virtual const void * nv::index::ITexture::get_pixel_data ( ) const
pure virtual

Get the texture data.

It returns a pointer to the raw texture data according to the pixel format.

The total size of the buffer in bytes is

x * y * sizeof(t)

where x is the result of get_resolution_x(), y is the result of get_resolution_y(), and t is the size of a pixel of the type returned by get_pixel_format().

Returns
raw pointer to the pixel data.

 get_pixel_format()

virtual Pixel_format nv::index::ITexture::get_pixel_format ( ) const
pure virtual

Get the pixel format of the texture.

Returns
Returns the pixel format.

 get_resolution_x()

virtual mi::Uint32 nv::index::ITexture::get_resolution_x ( ) const
pure virtual

Get the horizontal resolution of the texture.

Returns
Returns the texture's x resolution.

 get_resolution_y()

virtual mi::Uint32 nv::index::ITexture::get_resolution_y ( ) const
pure virtual

Get the vertical resolution of the texture.

Returns
Returns the texture's y resolution.

 set_pixel_data() [1/2]

virtual bool nv::index::ITexture::set_pixel_data ( const mi::neuraylib::ICanvas *  canvas,
Pixel_format  format 
)
pure virtual

Set the texture data from a canvas.

Parameters
[in]canvasCanvas from which the pixels will be copied.
[in]formatThe pixel format of the texture. If the pixel type of the canvas is different, its data will be converted accordingly.
Returns
True on success, or false if the input is invalid.

 set_pixel_data() [2/2]

virtual bool nv::index::ITexture::set_pixel_data ( const void *  pixel_data,
mi::Uint32  width,
mi::Uint32  height,
Pixel_format  format 
)
pure virtual

Set the texture data from a buffer.

Parameters
[in]pixel_dataRaw pixel data, this will be be copied.
[in]widthThe horizontal resolution of the texture.
[in]heightThe vertical resolution of the texture.
[in]formatThe pixel format of the texture.
Returns
True on success, or false if the input is invalid.

The total size in bytes of the buffer referenced by pixel_data must be

width *
height * t

where t is the size of a pixel according to format.


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