NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
iimage_plugin.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 // ****************************************************************************
6 // ****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_IIMAGE_PLUGIN_H
9 #define MI_NEURAYLIB_IIMAGE_PLUGIN_H
10 
12 #include <mi/base/plugin.h>
13 #include <mi/base/types.h>
15 
16 namespace mi {
17 
18 class IImage_file;
19 class IWriter;
20 class IReader;
21 
22 namespace neuraylib { class IPlugin_api; class ITile; }
23 
28 #define MI_NEURAY_IMAGE_PLUGIN_TYPE "image v4"
30 
45 class IImage_plugin : public base::Plugin
46 {
47 public:
52  virtual bool init( neuraylib::IPlugin_api* plugin_api) = 0;
53 
58  virtual bool exit( neuraylib::IPlugin_api* plugin_api) = 0;
59 
65  virtual const char* get_name() const = 0;
66 
72  virtual const char* get_file_extension( Uint32 index) const = 0;
73 
82  virtual const char* get_supported_type( Uint32 index) const = 0;
83 
90  virtual bool test( const Uint8* buffer, Uint32 file_size) const = 0;
91 
96  virtual Impexp_priority get_priority() const = 0;
97 
116  virtual IImage_file* open_for_writing(
117  IWriter* writer,
118  const char* pixel_type,
119  Uint32 resolution_x,
120  Uint32 resolution_y,
121  Uint32 nr_of_layers,
122  Uint32 miplevels,
123  bool is_cubemap,
124  Float32 gamma,
125  Uint32 quality) const = 0;
126 
133  virtual IImage_file* open_for_reading( IReader* reader) const = 0;
134 };
135 
141  : public base::Interface_declare<0x26db4186,0xace2,0x42e8,0xa0,0x3d,0xe0,0xfa,0xfc,0xed,0x05,0xf3>
142 {
143 public:
147  virtual const char* get_type() const = 0;
148 
153  virtual Uint32 get_resolution_x( Uint32 level = 0) const = 0;
154 
159  virtual Uint32 get_resolution_y( Uint32 level = 0) const = 0;
160 
165  virtual Uint32 get_layers_size( Uint32 level = 0) const = 0;
166 
174  virtual Uint32 get_tile_resolution_x( Uint32 level = 0) const = 0;
175 
183  virtual Uint32 get_tile_resolution_y( Uint32 level = 0) const = 0;
184 
186  virtual Uint32 get_miplevels() const = 0;
187 
191  virtual bool get_is_cubemap() const = 0;
192 
194  virtual Float32 get_gamma() const = 0;
195 
211  virtual bool read(
212  neuraylib::ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) const = 0;
213 
229  virtual bool write(
230  const neuraylib::ITile* tile, Uint32 x, Uint32 y, Uint32 z, Uint32 level = 0) = 0;
231 };
232  // end group mi_neuray_plugins
234 
235 } // namespace mi
236 
237 #endif // MI_NEURAYLIB_IIMAGE_PLUGIN_H