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
17class IMap;
18
19namespace neuraylib {
20
21class IImage_file;
22class IPlugin_api;
23class IReader;
24class ITile;
25class IWriter;
26
41#define MI_NEURAY_IMAGE_PLUGIN_TYPE "image v38"
42
58{
59public:
65 virtual const char* get_name() const = 0;
66
71 virtual bool init( IPlugin_api* plugin_api) = 0;
72
77 virtual bool exit( IPlugin_api* plugin_api) = 0;
78
84 virtual const char* get_file_extension( Uint32 index) const = 0;
85
94 virtual const char* get_supported_type( Uint32 index) const = 0;
95
100 virtual Impexp_priority get_priority() const = 0;
101
108 virtual bool supports_selectors() const = 0;
109
114 virtual bool test( IReader* reader) const = 0;
115
123 virtual IImage_file* open_for_reading( IReader* reader, const char* selector) const = 0;
124
145 IWriter* writer,
146 const char* pixel_type,
147 Uint32 resolution_x,
148 Uint32 resolution_y,
149 Uint32 nr_of_layers,
150 Uint32 miplevels,
151 bool is_cubemap,
152 Float32 gamma,
153 const IMap* export_options) const = 0;
154};
155
161 : public base::Interface_declare<0x26db4186,0xace2,0x42e8,0xa0,0x3d,0xe0,0xfa,0xfc,0xed,0x05,0xf3>
162{
163public:
167 virtual const char* get_type() const = 0;
168
173 virtual Uint32 get_resolution_x( Uint32 level) const = 0;
174
179 virtual Uint32 get_resolution_y( Uint32 level) const = 0;
180
185 virtual Uint32 get_layers_size( Uint32 level) const = 0;
186
188 virtual Uint32 get_miplevels() const = 0;
189
193 virtual bool get_is_cubemap() const = 0;
194
196 virtual Float32 get_gamma() const = 0;
197
206 virtual ITile* read( Uint32 z, Uint32 level) const = 0;
207
217 virtual bool write( const ITile* tile, Uint32 z, Uint32 level) = 0;
218};
219 // end group mi_neuray_plugins
221
222} // namespace neuraylib
223
224} // namespace mi
225
226#endif // MI_NEURAYLIB_IIMAGE_PLUGIN_H
This interface represents maps, i.e., a key-value based data structure.
Definition: imap.h:41
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:162
virtual bool write(const ITile *tile, Uint32 z, Uint32 level)=0
Write pixels from a tile into the image file.
virtual Uint32 get_resolution_y(Uint32 level) const =0
Returns the resolution of the image in y direction.
virtual ITile * read(Uint32 z, Uint32 level) const =0
Read pixels from the image file into a tile.
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.
virtual Uint32 get_resolution_x(Uint32 level) const =0
Returns the resolution of the image in x direction.
virtual Uint32 get_layers_size(Uint32 level) const =0
Returns the number of layers of the image.
Abstract interface for image plugins.
Definition: iimage_plugin.h:58
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 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 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, const IMap *export_options) const =0
Creates an object that writes an image to a stream.
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.