DiCE API nvidia_logo_transpbg.gif Up
iimage_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IIMAGE_API_H
8#define MI_NEURAYLIB_IIMAGE_API_H
9
11
12namespace mi {
13
14class IArray;
15
16namespace neuraylib {
17
18class IBuffer;
19class ICanvas;
20class ICanvas_cuda;
21class IReader;
22class ITile;
23
47class IImage_api : public
48 mi::base::Interface_declare<0x4c25a4f0,0x2bac,0x4ce6,0xb0,0xab,0x4d,0x94,0xbf,0xfd,0x97,0xa5>
49{
50public:
52
53
69 const char* pixel_type,
70 Uint32 width,
71 Uint32 height) const = 0;
72
92 const char* pixel_type,
93 Uint32 width,
94 Uint32 height,
95 Uint32 layers = 1,
96 bool is_cubemap = false,
97 Float32 gamma = 0.0f) const = 0;
98
99#ifndef MI_SKIP_WITH_MDL_SDK_DOXYGEN
118#else // MI_SKIP_WITH_MDL_SDK_DOXYGEN
123#endif // MI_SKIP_WITH_MDL_SDK_DOXYGEN
125 Sint32 cuda_device_id,
126 const char* pixel_type,
127 Uint32 width,
128 Uint32 height,
129 Uint32 layers = 1,
130 Float32 gamma = 0.0f) const = 0;
131
144 const ICanvas* canvas, Float32 gamma_override = 0.0f) const = 0;
145
146#ifdef MI_NEURAYLIB_DEPRECATED_14_0
147 inline IArray* create_mipmaps(
148 const ICanvas* canvas, Float32 gamma_override = 0.0f) const
149 { return create_mipmap( canvas, gamma_override); }
150#endif // MI_NEURAYLIB_DEPRECATED_14_0
151
153 virtual ITile* clone_tile( const ITile* tile) const = 0;
154
156 virtual ICanvas* clone_canvas( const ICanvas* canvas) const = 0;
157
159
161
188 Uint32 width,
189 Uint32 height,
190 const ICanvas* canvas,
191 Uint32 canvas_x,
192 Uint32 canvas_y,
193 Uint32 canvas_layer,
194 void* buffer,
195 bool buffer_topdown,
196 const char* buffer_pixel_type,
197 Uint32 buffer_padding = 0) const = 0;
198
225 Uint32 width,
226 Uint32 height,
227 ICanvas* canvas,
228 Uint32 canvas_x,
229 Uint32 canvas_y,
230 Uint32 canvas_layer,
231 const void* buffer,
232 bool buffer_topdown,
233 const char* buffer_pixel_type,
234 Uint32 buffer_padding = 0) const = 0;
235
237
239
259 const ICanvas* canvas,
260 const char* image_format,
261 const char* pixel_type,
262 const char* quality,
263 bool force_default_gamma = false) const = 0;
264
275 const IBuffer* buffer, const char* image_format, const char* selector = 0) const = 0;
276
288 IReader* reader, const char* image_format, const char* selector = 0) const = 0;
289
306 const char* image_format, IReader* reader = 0) const = 0;
307
321 virtual bool supports_format_for_encoding( const char* image_format) const = 0;
322
324
326
342 virtual ITile* convert( const ITile* tile, const char* pixel_type) const = 0;
343
379 virtual ICanvas* convert( const ICanvas* canvas, const char* pixel_type) const = 0;
380
390 virtual void adjust_gamma( ITile* tile, Float32 old_gamma, Float32 new_gamma) const = 0;
391
400 virtual void adjust_gamma( ICanvas* canvas, Float32 new_gamma) const = 0;
401
403
405
412 virtual Uint32 get_components_per_pixel( const char* pixel_type) const = 0;
413
420 virtual Uint32 get_bytes_per_component( const char* pixel_type) const = 0;
421
423
425
438 virtual const char* get_pixel_type_for_channel(
439 const char* pixel_type, const char* selector) const = 0;
440
447 virtual ICanvas* extract_channel( const ICanvas* canvas, const char* selector) const = 0;
448
455 virtual ITile* extract_channel( const ITile* tile, const char* selector) const = 0;
456
458
459};
460 // end group mi_neuray_rendering / mi_neuray_rtmp
462
463} // namespace neuraylib
464
465} // namespace mi
466
467#endif // MI_NEURAYLIB_IIMAGE_API_H
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for a canvas with CUDA device memory storage.
Definition: icanvas_cuda.h:28
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:85
This interface provides various utilities related to canvases and buffers.
Definition: iimage_api.h:49
virtual ICanvas * clone_canvas(const ICanvas *canvas) const =0
Creates a (deep) copy of the passed canvas.
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 IBuffer * create_buffer_from_canvas(const ICanvas *canvas, const char *image_format, const char *pixel_type, const char *quality, bool force_default_gamma=false) const =0
Encodes the pixel data of a canvas into a memory buffer.
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
Creates a CUDA canvas with given pixel type, width, height, and layers.
virtual void adjust_gamma(ICanvas *canvas, Float32 new_gamma) const =0
Sets the gamma value of a canvas and adjusts the pixel data accordingly.
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: dice.h:89