MDL SDK API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
iimage_api.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright 2022 NVIDIA Corporation. All rights reserved.
3  **************************************************************************************************/
6 
7 #ifndef MI_NEURAYLIB_IIMAGE_API_H
8 #define MI_NEURAYLIB_IIMAGE_API_H
9 
11 
12 namespace mi {
13 
14 class IArray;
15 
16 namespace neuraylib {
17 
18 class IBuffer;
19 class ICanvas;
20 class ICanvas_cuda;
21 class IReader;
22 class ITile;
23 
41 class IImage_api : public
48  mi::base::Interface_declare<0x4c25a4f0,0x2bac,0x4ce6,0xb0,0xab,0x4d,0x94,0xbf,0xfd,0x97,0xa5>
49 {
50 public:
52 
53 
68  virtual ITile* create_tile(
69  const char* pixel_type,
70  Uint32 width,
71  Uint32 height) const = 0;
72 
91  virtual ICanvas* create_canvas(
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
100 #endif // MI_SKIP_WITH_MDL_SDK_DOXYGEN
119  virtual ICanvas_cuda* create_canvas_cuda(
120  Sint32 cuda_device_id,
121  const char* pixel_type,
122  Uint32 width,
123  Uint32 height,
124  Uint32 layers = 1,
125  Float32 gamma = 0.0f) const = 0;
126 
138  virtual IArray* create_mipmaps(
139  const ICanvas* canvas, Float32 gamma_override = 0.0f) const = 0;
140 
142 
144 
170  virtual Sint32 read_raw_pixels(
171  Uint32 width,
172  Uint32 height,
173  const ICanvas* canvas,
174  Uint32 canvas_x,
175  Uint32 canvas_y,
176  Uint32 canvas_layer,
177  void* buffer,
178  bool buffer_topdown,
179  const char* buffer_pixel_type,
180  Uint32 buffer_padding = 0) const = 0;
181 
207  virtual Sint32 write_raw_pixels(
208  Uint32 width,
209  Uint32 height,
210  ICanvas* canvas,
211  Uint32 canvas_x,
212  Uint32 canvas_y,
213  Uint32 canvas_layer,
214  const void* buffer,
215  bool buffer_topdown,
216  const char* buffer_pixel_type,
217  Uint32 buffer_padding = 0) const = 0;
218 
220 
222 
241  virtual IBuffer* create_buffer_from_canvas(
242  const ICanvas* canvas,
243  const char* image_format,
244  const char* pixel_type,
245  const char* quality,
246  bool force_default_gamma = false) const = 0;
247 
255  virtual ICanvas* create_canvas_from_buffer(
256  const IBuffer* buffer, const char* image_format) const = 0;
257 
266  virtual ICanvas* create_canvas_from_reader(
267  IReader* reader, const char* image_format) const = 0;
268 
284  virtual bool supports_format_for_decoding(
285  const char* image_format, IReader* reader = 0) const = 0;
286 
300  virtual bool supports_format_for_encoding( const char* image_format) const = 0;
301 
303 
305 
341  virtual ICanvas* convert( const ICanvas* canvas, const char* pixel_type) const = 0;
342 
351  virtual void adjust_gamma( ICanvas* canvas, Float32 new_gamma) const = 0;
352 
354 
356 
363  virtual Uint32 get_components_per_pixel( const char* pixel_type) const = 0;
364 
371  virtual Uint32 get_bytes_per_component( const char* pixel_type) const = 0;
372 
374 
376 
388  virtual const char* get_pixel_type_for_channel(
389  const char* pixel_type, const char* selector) const = 0;
390 
397  virtual ICanvas* extract_channel( const ICanvas* canvas, const char* selector) const = 0;
398 
405  virtual ITile* extract_channel( const ITile* tile, const char* selector) const = 0;
406 
408 
409 };
410  // end group mi_neuray_rendering / mi_neuray_rtmp
412 
413 } // namespace neuraylib
414 
415 } // namespace mi
416 
417 #endif // MI_NEURAYLIB_IIMAGE_API_H