neuray API Programmer's Manual

mi::neuraylib::ITile Class Reference

[Miscellaneous]

Description

Abstract interface for a tile. A tile is a rectangular array of pixels of a certain pixel type.

Public Member Functions

virtual const void* get_data() const =0
Returns a pointer to the raw tile data according to the pixel type of the tile. More...
virtual void* get_data() =0
Returns a pointer to the raw tile data according to the pixel type of the tile. More...
virtual void get_pixel( Uint32 x_offset, Uint32 y_offset, Float32* floats) const =0
Looks up a certain pixel at the given coordinates. More...
virtual Uint32 get_resolution_x() const =0
Returns the tile size in x direction.
virtual Uint32 get_resolution_y() const =0
Returns the tile size in y direction.
virtual const char* get_type() const =0
Returns the pixel type used by the tile. More...
virtual void set_pixel( Uint32 x_offset, Uint32 y_offset, const Float32* floats) =0
Stores a certain pixel at the given coordinates. More...

Member Functions

virtual const void* mi::​neuraylib::​ITile::get_data() const [pure virtual]

Returns a pointer to the raw tile data according to the pixel type of the tile. This methods is used for fast, direct read access to the raw tile data. It is expected that the data is stored in row-major layout without any padding. In case of mi::Color, the components are expected to be stored in RGBA order.

The total size of the buffer in bytes is

‎ x * y * bpp 
where x is the result of get_resolution_x(), y is the result of get_resolution_y(), and bpp is the number of bytes per pixel. The number of bytes per pixel is the product of mi::neuraylib::IImage_api::get_components_per_pixel() and mi::neuraylib::IImage_api::get_bytes_per_component() when passing the result of get_type() as pixel type.
virtual void* mi::​neuraylib::​ITile::get_data() [pure virtual]

Returns a pointer to the raw tile data according to the pixel type of the tile. This methods is used for fast, direct write access to the raw tile data. It is expected that the data is stored in row-major layout without any padding. In case of mi::Color, the components are expected to be stored in RGBA order.

The total size of the buffer in bytes is

‎ x * y * bpp 
where x is the result of get_resolution_x(), y is the result of get_resolution_y(), and bpp is the number of bytes per pixel. The number of bytes per pixel is the product of mi::neuraylib::IImage_api::get_components_per_pixel() and mi::neuraylib::IImage_api::get_bytes_per_component() when passing the result of get_type() as pixel type.
virtual void mi::​neuraylib::​ITile::get_pixel( Uint32 x_offset, Uint32 y_offset, Float32* floats) const [pure virtual]

Looks up a certain pixel at the given coordinates. The offsets are relative to the lower left border of the tile. The floats argument must point to at least 4 floats, e.g., you pass the address of mi::math::Color.r.

This method is a rather slow, but convenient access method. Typically, the get_data() method is faster and can handle arbitrary data types without pixel type conversion.

virtual Uint32 mi::​neuraylib::​ITile::get_resolution_x() const [pure virtual]

Returns the tile size in x direction.

virtual Uint32 mi::​neuraylib::​ITile::get_resolution_y() const [pure virtual]

Returns the tile size in y direction.

virtual const char* mi::​neuraylib::​ITile::get_type() const [pure virtual]

Returns the pixel type used by the tile.

See also:

Types for a list of supported pixel types

virtual void mi::​neuraylib::​ITile::set_pixel( Uint32 x_offset, Uint32 y_offset, const Float32* floats) [pure virtual]

Stores a certain pixel at the given coordinates. The offsets are relative to the lower left border of the tile. The floats argument must point to at least 4 floats, e.g., you pass the address of mi::math::Color.r.

This method is a rather slow, but convenient access method. Typically, the get_data() method is faster and can handle arbitrary data types without pixel type conversion.