|
|
virtual ICanvas * | create_canvas (const char *pixel_type, Uint32 width, Uint32 height, Uint32 tile_width=0, Uint32 tile_height=0, Uint32 layers=1, bool is_cubemap=false, Float32 gamma=0.0f) const =0 |
| Creates a canvas with given pixel type, width, height, and layers. More...
|
|
virtual ITile * | create_tile (const char *pixel_type, Uint32 width, Uint32 height) const =0 |
| Creates a tile with given pixel type, width, and height. More...
|
|
virtual ICanvas_cuda * | create_canvas_cuda (Sint32 cuda_device_id, const char *pixel_type, Uint32 width, Uint32 height, Uint32 layers=1, Float32 gamma=0.0f) const =0 |
|
|
virtual Sint32 | read_raw_pixels (Uint32 width, Uint32 height, const ICanvas *canvas, Uint32 canvas_x, Uint32 canvas_y, Uint32 canvas_layer, void *buffer, bool buffer_topdown, const char *buffer_pixel_type, Uint32 buffer_padding=0) const =0 |
| Reads raw pixel data from a canvas. More...
|
|
virtual Sint32 | write_raw_pixels (Uint32 width, Uint32 height, ICanvas *canvas, Uint32 canvas_x, Uint32 canvas_y, Uint32 canvas_layer, const void *buffer, bool buffer_topdown, const char *buffer_pixel_type, Uint32 buffer_padding=0) const =0 |
| Writes raw pixel data to a canvas. More...
|
|
|
virtual IBuffer * | create_buffer_from_canvas (const ICanvas *canvas, const char *image_format, const char *pixel_type, const char *quality) const =0 |
| Encodes the pixel data of a canvas into a memory buffer. More...
|
|
virtual ICanvas * | create_canvas_from_buffer (const IBuffer *buffer, const char *image_format) const =0 |
| Decodes the pixel data of a memory buffer into a canvas. More...
|
|
virtual bool | supports_format_for_decoding (const char *image_format, IReader *reader=0) const =0 |
| Indicates whether a particular image format is supported for decoding. More...
|
|
virtual bool | supports_format_for_encoding (const char *image_format) const =0 |
| Indicates whether a particular image format is supported for encoding. More...
|
|
|
virtual ICanvas * | convert (const ICanvas *canvas, const char *pixel_type) const =0 |
| Converts a canvas to a different pixel type. More...
|
|
virtual void | adjust_gamma (ICanvas *canvas, Float32 new_gamma) const =0 |
| Sets the gamma value of a canvas and adjusts the pixel data accordingly. More...
|
|
|
virtual Uint32 | get_components_per_pixel (const char *pixel_type) const =0 |
| Returns the number of components per pixel type. More...
|
|
virtual Uint32 | get_bytes_per_component (const char *pixel_type) const =0 |
| Returns the number of bytes used per pixel component. More...
|
|
virtual IArray * | create_mipmaps (const ICanvas *canvas, Float32 gamma_override=0.0f) const =0 |
| Creates mipmaps from the given canvas. More...
|
|
|
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface > | Self |
| Own type. More...
|
|
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > | IID |
| Declares the interface ID (IID) of this interface. More...
|
|
static bool | compare_iid (const Uuid &iid) |
| Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
|
|
This interface provides various utilities related to canvases and buffers.
Note that create_buffer_from_canvas() and create_canvas_from_buffer() encode and decode pixel data to/from memory buffers.
virtual ICanvas* mi::neuraylib::IImage_api::create_canvas |
( |
const char * |
pixel_type, |
|
|
Uint32 |
width, |
|
|
Uint32 |
height, |
|
|
Uint32 |
tile_width = 0 , |
|
|
Uint32 |
tile_height = 0 , |
|
|
Uint32 |
layers = 1 , |
|
|
bool |
is_cubemap = false , |
|
|
Float32 |
gamma = 0.0f |
|
) |
| const |
|
pure virtual |
Creates a canvas with given pixel type, width, height, and layers.
This factory function allows to create instances of the abstract interface mi::neuraylib::ICanvas based on an internal default implementation. However, you are not obligated to use this factory function and the internal default implementation. It is absolutely fine to use your own (correct) implementation of the mi::neuraylib::ICanvas interface.
- Parameters
-
pixel_type | The desired pixel type. See Types for a list of supported pixel types. |
width | The desired width. |
height | The desired height. |
tile_width | The desired tile width. The special value 0 represents the canvas width. |
tile_height | The desired tile height. The special value 0 represents the canvas height. |
layers | The desired number of layers (depth). Must be 6 for cubemaps. |
is_cubemap | Flag that indicates whether this canvas represents a cubemap. |
gamma | The desired gamma value. The special value 0.0 represents the default gamma which is 1.0 for HDR pixel types and 2.2 for LDR pixel types. |
- Returns
- The requested canvas, or
NULL
in case of invalid pixel type, width, height, layers, or cubemap flag.
virtual bool mi::neuraylib::IImage_api::supports_format_for_decoding |
( |
const char * |
image_format, |
|
|
IReader * |
reader = 0 |
|
) |
| const |
|
pure virtual |
Indicates whether a particular image format is supported for decoding.
Support for a given image format requires an image plugin capable of handling that format. This method allows to check whether such a plugin has been loaded for a particular format.
Decoding is used when the image is converted into a canvas from a memory buffer or a file . Note that even if this method returns true
, create_canvas_from_buffer() can still fail for a particular image if that image uses an unsupported feature.
- Parameters
-
image_format | The image format in question, e.g., "jpg" . |
reader | An optional reader |
- Returns
true
if the image format is supported, false
otherwise
virtual bool mi::neuraylib::IImage_api::supports_format_for_encoding |
( |
const char * |
image_format) | |
const |
|
pure virtual |
Indicates whether a particular image format is supported for encoding.
Support for a given image format requires an image plugin capable of handling that format. This method allows to check whether such a plugin has been loaded for a particular format.
Encoding is used when the image is converted from a canvas into a memory buffer or a file. . Note that even if this method returns true
, create_buffer_from_canvas() can still fail if the given canvas uses an unsupported feature, e.g., multiple layers.
- Parameters
-
image_format | The image format in question, e.g., "jpg" . |
- Returns
true
if the image format is supported, false
otherwise