neuray API Programmer's Manual

mi::neuraylib::IImage_file Class Reference

[Extensions and Plugins]

Description

Abstract interface for image files. Instance of this interface are created by mi::neuraylib::IImage_plugin::open_for_writing() or mi::neuraylib::IImage_plugin::open_for_reading().

Public Member Functions

virtual Float32 get_gamma() const =0
Returns the gamma value of the image.
virtual bool  get_is_cubemap() const =0
Indicates whether the image represents a cubemap. More...
virtual Uint32 get_layers_size( Uint32 level = 0) const =0
Returns the number of layers of the image. More...
virtual Uint32 get_miplevels() const =0
Returns number of miplevels.
virtual Uint32 get_resolution_x( Uint32 level = 0) const =0
Returns the resolution of the image in x direction. More...
virtual Uint32 get_resolution_y( Uint32 level = 0) const =0
Returns the resolution of the image in y direction. More...
virtual Uint32 get_tile_resolution_x( Uint32 level = 0) const =0
Returns the size of a tile in x direction. More...
virtual Uint32 get_tile_resolution_y( Uint32 level = 0) const =0
Returns the size of a tile in y direction. More...
virtual const char* get_type() const =0
Returns the pixel type of the image. More...
virtual bool  read( ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) const =0
Read pixels from the image file into a tile. More...
virtual bool  write( const ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) =0
Write pixels from a tile into the image file. More...

Member Functions

virtual Float32 mi::​neuraylib::​IImage_file::get_gamma() const [pure virtual]

Returns the gamma value of the image.

virtual bool mi::​neuraylib::​IImage_file::get_is_cubemap() const [pure virtual]

Indicates whether the image represents a cubemap.

Returns

if the image represents a cubemap, false otherwise.

virtual Uint32 mi::​neuraylib::​IImage_file::get_layers_size( Uint32 level = 0) const [pure virtual]

Returns the number of layers of the image.

Parameters

level
The mipmap level (always 0 if the image is not a mipmap).

Returns

The number of layers of the image.

virtual Uint32 mi::​neuraylib::​IImage_file::get_miplevels() const [pure virtual]

Returns number of miplevels.

virtual Uint32 mi::​neuraylib::​IImage_file::get_resolution_x( Uint32 level = 0) const [pure virtual]

Returns the resolution of the image in x direction.

Parameters

level
The mipmap level (always 0 if the image is not a mipmap).

Returns

The resolution of the image in x direction.

virtual Uint32 mi::​neuraylib::​IImage_file::get_resolution_y( Uint32 level = 0) const [pure virtual]

Returns the resolution of the image in y direction.

Parameters

level
The mipmap level (always 0 if the image is not a mipmap).

Returns

The resolution of the image in y direction.

virtual Uint32 mi::​neuraylib::​IImage_file::get_tile_resolution_x( Uint32 level = 0) const [pure virtual]

Returns the size of a tile in x direction. This method indicates the native tile size of the image file (if any). However, read() and write() must be able to handle arbitrary tiles.

Parameters

level
The mipmap level (always 0 if the image is not a mipmap).

Returns

The size of a tile in x direction.

virtual Uint32 mi::​neuraylib::​IImage_file::get_tile_resolution_y( Uint32 level = 0) const [pure virtual]

Returns the size of a tile in y direction. This method indicates the native tile size of the image file (if any). However, read() and write() must be able to handle arbitrary tiles.

Parameters

level
The mipmap level (always 0 if the image is not a mipmap).

Returns

The size of a tile in y direction.

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

Returns the pixel type of the image. See Types for a list of supported pixel types.

virtual bool mi::​neuraylib::​IImage_file::read( ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) const [pure virtual]

Read pixels from the image file into a tile. Border tiles are passed as full tiles and the method must fill the pixel data for areas that are visible in the image. The tile size may be arbitrary, and in particular, not the same as indicated by get_tile_resolution_x() and get_tile_resolution_y().

This method will never be called if this instance was obtained from mi::neuraylib::IImage_plugin::open_for_writing().

Parameters

tile
The tile to read the data into.
x
The x position of the lower left corner of the tile.
y
The y position of the lower left corner of the tile.
z
The z layer (for 3d textures or cubemaps).
level
The mipmap level (always 0 if the image is not a mipmap).

Returns

true if the tile was successfully read, false otherwise.

virtual bool mi::​neuraylib::​IImage_file::write( const ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) [pure virtual]

Write pixels from a tile into the image file. Border tiles are passed as full tiles but only contain valid pixel data in areas that are visible in the image. The tile size may be arbitrary, and in particular, not the same as indicated by get_tile_resolution_x() and get_tile_resolution_y().

This method will never be called if this instance was obtained from mi::neuraylib::IImage_plugin::open_for_reading().

Parameters

tile
The tile to read the data from.
x
The x position of the lower left corner of the tile.
y
The y position of the lower left corner of the tile.
z
The z layer (for 3d textures or cubemaps).
level
The mipmap level (always 0 if the image is not a mipmap).

Returns

true if the tile was successfully written, false otherwise.