Material Definition Language 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 2020 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 IReader;
21 class ITile;
22 
39 class IImage_api : public
46  mi::base::Interface_declare<0x4c25a4f0,0x2bac,0x4ce6,0xb0,0xab,0x4d,0x94,0xbf,0xfd,0x97,0xa5>
47 {
48 public:
50 
51 
74  virtual ICanvas* create_canvas(
75  const char* pixel_type,
76  Uint32 width,
77  Uint32 height,
78  Uint32 tile_width = 0,
79  Uint32 tile_height = 0,
80  Uint32 layers = 1,
81  bool is_cubemap = false,
82  Float32 gamma = 0.0f) const = 0;
83 
98  virtual ITile* create_tile(
99  const char* pixel_type,
100  Uint32 width,
101  Uint32 height) const = 0;
102 
104 
106 
132  virtual Sint32 read_raw_pixels(
133  Uint32 width,
134  Uint32 height,
135  const ICanvas* canvas,
136  Uint32 canvas_x,
137  Uint32 canvas_y,
138  Uint32 canvas_layer,
139  void* buffer,
140  bool buffer_topdown,
141  const char* buffer_pixel_type,
142  Uint32 buffer_padding = 0) const = 0;
143 
169  virtual Sint32 write_raw_pixels(
170  Uint32 width,
171  Uint32 height,
172  ICanvas* canvas,
173  Uint32 canvas_x,
174  Uint32 canvas_y,
175  Uint32 canvas_layer,
176  const void* buffer,
177  bool buffer_topdown,
178  const char* buffer_pixel_type,
179  Uint32 buffer_padding = 0) const = 0;
180 
182 
184 
198  virtual IBuffer* create_buffer_from_canvas(
199  const ICanvas* canvas,
200  const char* image_format,
201  const char* pixel_type,
202  const char* quality) const = 0;
203 
211  virtual ICanvas* create_canvas_from_buffer(
212  const IBuffer* buffer,
213  const char* image_format) const = 0;
214 
230  virtual bool supports_format_for_decoding(
231  const char* image_format, IReader* reader = 0) const = 0;
232 
246  virtual bool supports_format_for_encoding( const char* image_format) const = 0;
247 
249 
251 
287  virtual ICanvas* convert( const ICanvas* canvas, const char* pixel_type) const = 0;
288 
297  virtual void adjust_gamma( ICanvas* canvas, Float32 new_gamma) const = 0;
298 
300 
302 
309  virtual Uint32 get_components_per_pixel( const char* pixel_type) const = 0;
310 
317  virtual Uint32 get_bytes_per_component( const char* pixel_type) const = 0;
318 
330  virtual IArray* create_mipmaps(
331  const ICanvas* canvas, Float32 gamma_override=0.0f) const = 0;
332 
334 };
335  // end group mi_neuray_rendering / mi_neuray_rtmp
337 
338 } // namespace neuraylib
339 
340 } // namespace mi
341 
342 #endif // MI_NEURAYLIB_IIMAGE_API_H