MDL SDK API nvidia_logo_transpbg.gif Up
iimage_plugin.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IIMAGE_PLUGIN_H
8#define MI_NEURAYLIB_IIMAGE_PLUGIN_H
9
11#include <mi/base/plugin.h>
12#include <mi/base/types.h>
14
15namespace mi {
16
17namespace neuraylib {
18
19class IImage_file;
20class IPlugin_api;
21class IReader;
22class ITile;
23class IWriter;
24
39#define MI_NEURAY_IMAGE_PLUGIN_TYPE "image v35"
40
56{
57public:
63 virtual const char* get_name() const = 0;
64
69 virtual bool init( IPlugin_api* plugin_api) = 0;
70
75 virtual bool exit( IPlugin_api* plugin_api) = 0;
76
82 virtual const char* get_file_extension( Uint32 index) const = 0;
83
92 virtual const char* get_supported_type( Uint32 index) const = 0;
93
98 virtual Impexp_priority get_priority() const = 0;
99
106 virtual bool supports_selectors() const = 0;
107
112 virtual bool test( IReader* reader) const = 0;
113
121 virtual IImage_file* open_for_reading( IReader* reader, const char* selector) const = 0;
122
142 IWriter* writer,
143 const char* pixel_type,
144 Uint32 resolution_x,
145 Uint32 resolution_y,
146 Uint32 nr_of_layers,
147 Uint32 miplevels,
148 bool is_cubemap,
149 Float32 gamma,
150 Uint32 quality) const = 0;
151};
152
158 : public base::Interface_declare<0x26db4186,0xace2,0x42e8,0xa0,0x3d,0xe0,0xfa,0xfc,0xed,0x05,0xf3>
159{
160public:
164 virtual const char* get_type() const = 0;
165
170 virtual Uint32 get_resolution_x( Uint32 level = 0) const = 0;
171
176 virtual Uint32 get_resolution_y( Uint32 level = 0) const = 0;
177
182 virtual Uint32 get_layers_size( Uint32 level = 0) const = 0;
183
185 virtual Uint32 get_miplevels() const = 0;
186
190 virtual bool get_is_cubemap() const = 0;
191
193 virtual Float32 get_gamma() const = 0;
194
203 virtual ITile* read( Uint32 z, Uint32 level = 0) const = 0;
204
214 virtual bool write( const ITile* tile, Uint32 z, Uint32 level = 0) = 0;
215};
216 // end group mi_neuray_plugins
218
219} // namespace neuraylib
220
221} // namespace mi
222
223#endif // MI_NEURAYLIB_IIMAGE_PLUGIN_H
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The abstract base class for plugins.
Definition: plugin.h:34
Abstract interface for image files.
Definition: iimage_plugin.h:159
virtual Uint32 get_layers_size(Uint32 level=0) const =0
Returns the number of layers of the image.
virtual Uint32 get_resolution_y(Uint32 level=0) const =0
Returns the resolution of the image in y direction.
virtual bool write(const ITile *tile, Uint32 z, Uint32 level=0)=0
Write pixels from a tile into the image file.
virtual ITile * read(Uint32 z, Uint32 level=0) const =0
Read pixels from the image file into a tile.
virtual Uint32 get_resolution_x(Uint32 level=0) const =0
Returns the resolution of the image in x direction.
virtual Float32 get_gamma() const =0
Returns the gamma value of the image.
virtual bool get_is_cubemap() const =0
Indicates whether the image represents a cubemap.
virtual const char * get_type() const =0
Returns the pixel type of the image (or the requested channel).
virtual Uint32 get_miplevels() const =0
Returns number of miplevels.
Abstract interface for image plugins.
Definition: iimage_plugin.h:56
virtual const char * get_name() const =0
Returns the name of the plugin.
virtual bool test(IReader *reader) const =0
Indicates whether the image plugin can handle a given image.
virtual bool exit(IPlugin_api *plugin_api)=0
De-initializes the plugin.
virtual IImage_file * open_for_writing(IWriter *writer, const char *pixel_type, Uint32 resolution_x, Uint32 resolution_y, Uint32 nr_of_layers, Uint32 miplevels, bool is_cubemap, Float32 gamma, Uint32 quality) const =0
Creates an object that writes an image to a stream.
virtual bool supports_selectors() const =0
Indicates whether the image plugin implements selector support.
virtual bool init(IPlugin_api *plugin_api)=0
Initializes the plugin.
virtual Impexp_priority get_priority() const =0
Returns the priority of the image plugin.
virtual const char * get_file_extension(Uint32 index) const =0
Returns the index -th supported file extension.
virtual const char * get_supported_type(Uint32 index) const =0
Returns the index -th supported pixel type for exporting.
virtual IImage_file * open_for_reading(IReader *reader, const char *selector) const =0
Creates an object that reads an image from a stream.
This abstract interface gives access to the MDL SDK API to plugins.
Definition: iplugin_api.h:27
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
A writer supports binary block writes and string-oriented line writes that accept a zero-terminated s...
Definition: iwriter.h:27
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
float Float32
32-bit float.
Definition: types.h:51
Impexp_priority
Confidence in capabilities of an importer or exporter.
Definition: iimpexp_base.h:31
Abstract base interface common for importers and exporters.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Base class for all plugins.
Basic types.