MDL SDK API nvidia_logo_transpbg.gif Up
iimage_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IIMAGE_API_H
8#define MI_NEURAYLIB_IIMAGE_API_H
9
12
13namespace mi {
14
15class IArray;
16class IMap;
17
18namespace neuraylib {
19
20class IBuffer;
21class ICanvas;
22class ICanvas_cuda;
23class IReader;
24class ITile;
25
70class IImage_api : public
71 mi::base::Interface_declare<0x4c25a4f0,0x2bac,0x4ce6,0xb0,0xab,0x4d,0x94,0xbf,0xfd,0x97,0xa5>
72{
73public:
75
76
92 const char* pixel_type,
93 Uint32 width,
94 Uint32 height) const = 0;
95
115 const char* pixel_type,
116 Uint32 width,
117 Uint32 height,
118 Uint32 layers = 1,
119 bool is_cubemap = false,
120 Float32 gamma = 0.0f) const = 0;
121
122#ifndef MI_SKIP_WITH_MDL_SDK_DOXYGEN
141#else // MI_SKIP_WITH_MDL_SDK_DOXYGEN
146#endif // MI_SKIP_WITH_MDL_SDK_DOXYGEN
147 virtual ICanvas_cuda* create_canvas_cuda(
148 Sint32 cuda_device_id,
149 const char* pixel_type,
150 Uint32 width,
151 Uint32 height,
152 Uint32 layers = 1,
153 Float32 gamma = 0.0f) const = 0;
154
167 const ICanvas* canvas, Float32 gamma_override = 0.0f) const = 0;
168
169#ifdef MI_NEURAYLIB_DEPRECATED_14_0
170 inline IArray* create_mipmaps(
171 const ICanvas* canvas, Float32 gamma_override = 0.0f) const
172 { return create_mipmap( canvas, gamma_override); }
173#endif // MI_NEURAYLIB_DEPRECATED_14_0
174
176 virtual ITile* clone_tile( const ITile* tile) const = 0;
177
179 virtual ICanvas* clone_canvas( const ICanvas* canvas) const = 0;
180
182
184
211 Uint32 width,
212 Uint32 height,
213 const ICanvas* canvas,
214 Uint32 canvas_x,
215 Uint32 canvas_y,
216 Uint32 canvas_layer,
217 void* buffer,
218 bool buffer_topdown,
219 const char* buffer_pixel_type,
220 Uint32 buffer_padding = 0) const = 0;
221
248 Uint32 width,
249 Uint32 height,
250 ICanvas* canvas,
251 Uint32 canvas_x,
252 Uint32 canvas_y,
253 Uint32 canvas_layer,
254 const void* buffer,
255 bool buffer_topdown,
256 const char* buffer_pixel_type,
257 Uint32 buffer_padding = 0) const = 0;
258
260
262
277 const ICanvas* canvas,
278 const char* image_format,
279 const char* pixel_type,
280 const IMap* export_options = 0) const = 0;
281
292 const IBuffer* buffer, const char* image_format, const char* selector = 0) const = 0;
293
305 IReader* reader, const char* image_format, const char* selector = 0) const = 0;
306
323 const char* image_format, IReader* reader = 0) const = 0;
324
338 virtual bool supports_format_for_encoding( const char* image_format) const = 0;
339
341
343
359 virtual ITile* convert( const ITile* tile, const char* pixel_type) const = 0;
360
396 virtual ICanvas* convert( const ICanvas* canvas, const char* pixel_type) const = 0;
397
409 virtual void adjust_gamma( ITile* tile, Float32 old_gamma, Float32 new_gamma) const = 0;
410
421 virtual void adjust_gamma( ICanvas* canvas, Float32 new_gamma) const = 0;
422
424
426
433 virtual Uint32 get_components_per_pixel( const char* pixel_type) const = 0;
434
441 virtual Uint32 get_bytes_per_component( const char* pixel_type) const = 0;
442
444
446
459 virtual const char* get_pixel_type_for_channel(
460 const char* pixel_type, const char* selector) const = 0;
461
468 virtual ICanvas* extract_channel( const ICanvas* canvas, const char* selector) const = 0;
469
476 virtual ITile* extract_channel( const ITile* tile, const char* selector) const = 0;
477
479
480 virtual IBuffer* deprecated_create_buffer_from_canvas(
481 const ICanvas* canvas,
482 const char* image_format,
483 const char* pixel_type,
484 const char* quality,
485 bool force_default_gamma) const = 0;
486
487#ifdef MI_NEURAYLIB_DEPRECATED_15_0
489 const ICanvas* canvas,
490 const char* image_format,
491 const char* pixel_type,
492 const char* quality,
493 bool force_default_gamma = false) const
494 {
495 return deprecated_create_buffer_from_canvas(
496 canvas, image_format, pixel_type, quality, force_default_gamma);
497 }
498#endif
499};
500 // end group mi_neuray_rendering / mi_neuray_rtmp
502
503} // namespace neuraylib
504
505} // namespace mi
506
507#endif // MI_NEURAYLIB_IIMAGE_API_H
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
This interface represents maps, i.e., a key-value based data structure.
Definition: imap.h:41
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for a simple buffer with binary data.
Definition: ibuffer.h:25
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:89
This interface provides various utilities related to canvases and buffers.
Definition: iimage_api.h:72
virtual ICanvas * clone_canvas(const ICanvas *canvas) const =0
Creates a (deep) copy of the passed canvas.
virtual IBuffer * create_buffer_from_canvas(const ICanvas *canvas, const char *image_format, const char *pixel_type, const IMap *export_options=0) const =0
Encodes the pixel data of a canvas into a memory buffer.
virtual ITile * create_tile(const char *pixel_type, Uint32 width, Uint32 height) const =0
Creates a tile with given pixel type, width, and height.
virtual const char * get_pixel_type_for_channel(const char *pixel_type, const char *selector) const =0
Returns the pixel type of an RGBA channel.
virtual ICanvas * create_canvas_from_reader(IReader *reader, const char *image_format, const char *selector=0) const =0
Decodes the pixel data from a reader into a canvas.
virtual ITile * clone_tile(const ITile *tile) const =0
Creates a copy of the passed tile.
virtual ICanvas * create_canvas(const char *pixel_type, Uint32 width, Uint32 height, Uint32 layers=1, bool is_cubemap=false, Float32 gamma=0.0f) const =0
Creates a canvas with given pixel type, resolution, and layers.
virtual ITile * extract_channel(const ITile *tile, const char *selector) const =0
Extracts an RGBA channel from a tile.
virtual ICanvas * create_canvas_from_buffer(const IBuffer *buffer, const char *image_format, const char *selector=0) const =0
Decodes the pixel data of a memory buffer into a canvas.
virtual ICanvas * extract_channel(const ICanvas *canvas, const char *selector) const =0
Extracts an RGBA channel from a canvas.
virtual ITile * convert(const ITile *tile, const char *pixel_type) const =0
Converts a tile to a different pixel type.
virtual bool supports_format_for_encoding(const char *image_format) const =0
Indicates whether a particular image format is supported for encoding.
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.
virtual ICanvas * convert(const ICanvas *canvas, const char *pixel_type) const =0
Converts a canvas to a different pixel type.
virtual void adjust_gamma(ITile *tile, Float32 old_gamma, Float32 new_gamma) const =0
Sets the gamma value of a tile and adjusts the pixel data accordingly.
virtual Uint32 get_bytes_per_component(const char *pixel_type) const =0
Returns the number of bytes used per pixel component.
virtual Uint32 get_components_per_pixel(const char *pixel_type) const =0
Returns the number of components per pixel type.
virtual IArray * create_mipmap(const ICanvas *canvas, Float32 gamma_override=0.0f) const =0
Creates a mipmap from the given canvas.
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.
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.
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
Unused.
virtual void adjust_gamma(ICanvas *canvas, Float32 new_gamma) const =0
Sets the gamma value of a canvas and adjusts the pixel data accordingly.
A reader supports binary block reads and string-oriented line reads that zero-terminate the result.
Definition: ireader.h:27
Abstract interface for a tile.
Definition: itile.h:36
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
float Float32
32-bit float.
Definition: types.h:51
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.