Iray SDK API nvidia_logo_transpbg.gif Up
iimage.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IIMAGE_H
8#define MI_NEURAYLIB_IIMAGE_H
9
11
12namespace mi {
13
14class IArray;
15
16namespace neuraylib {
17
18class ICanvas;
19class IReader;
20
62class IImage :
63 public base::Interface_declare<0xca59b977,0x30ee,0x4172,0x91,0x53,0xb7,0x70,0x2c,0x6b,0x3a,0x76,
64 neuraylib::IScene_element>
65{
66public:
68
69
134 virtual Sint32 reset_file( const char* filename, const char* selector = nullptr) = 0;
135
153 IReader* reader, const char* image_format, const char* selector = nullptr) = 0;
154
184 IArray* reader, const char* image_format, const char* selector = nullptr) = 0;
185
197 virtual bool set_from_canvas(
198 const ICanvas* canvas, const char* selector = nullptr) = 0;
199
214 virtual bool set_from_canvas(
215 ICanvas* canvas, const char* selector = nullptr, bool shared = false) = 0;
216
237 virtual bool set_from_canvas(
238 const IArray* uvtiles, const char* selector = nullptr) = 0;
239
264 virtual bool set_from_canvas(
265 IArray* uvtiles, const char* selector = nullptr, bool shared = false) = 0;
266
268
270
274 virtual bool is_animated() const = 0;
275
277 virtual Size get_length() const = 0;
278
286 virtual Size get_frame_number( Size frame_id) const = 0;
287
292 virtual Size get_frame_id( Size frame_number) const = 0;
293
295
297
302 virtual bool is_uvtile() const = 0;
303
305 virtual Size get_frame_length( Size frame_id) const = 0;
306
314 virtual Sint32 get_uvtile_uv( Size frame_id, Size uvtile_id, Sint32& u, Sint32& v) const = 0;
315
322 virtual Size get_uvtile_id( Size frame_id, Sint32 u, Sint32 v) const = 0;
323
332 Size frame_id, Sint32& min_u, Sint32& min_v, Sint32& max_u, Sint32& max_v) const = 0;
333
335
337
348 virtual const char* get_filename( Size frame_id, Size uvtile_id) const = 0;
349
355 virtual const char* get_original_filename() const = 0;
356
358 virtual const char* get_selector() const = 0;
359
369 virtual const ICanvas* get_canvas( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
370
372
374
383 virtual const char* get_type( Size frame_id, Size uvtile_id) const = 0 ;
384
390 virtual Uint32 get_levels( Size frame_id, Size uvtile_id) const = 0;
391
399 virtual Uint32 resolution_x( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
400
408 virtual Uint32 resolution_y( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
409
417 virtual Uint32 resolution_z( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
418
420};
421 // end group mi_neuray_misc
423
424} // namespace neuraylib
425
426} // namespace mi
427
428#endif // MI_NEURAYLIB_IIMAGE_H
This interface represents static arrays, i.e., arrays with a fixed number of elements.
Definition: iarray.h:37
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:89
This interface represents a pixel image file.
Definition: iimage.h:65
virtual Size get_frame_length(Size frame_id) const =0
Returns the number of uv-tiles for a given frame (or 0 if frame_id is out of bounds).
virtual Size get_frame_id(Size frame_number) const =0
Returns the frame ID for a given frame number.
virtual bool set_from_canvas(const ICanvas *canvas, const char *selector=nullptr)=0
Sets the image to the passed canvas (without sharing).
virtual Uint32 resolution_y(Size frame_id, Size uvtile_id, Uint32 level) const =0
Returns the vertical resolution of a canvas.
virtual Sint32 reset_reader(IReader *reader, const char *image_format, const char *selector=nullptr)=0
Sets the image to the data provided by a reader.
virtual bool set_from_canvas(ICanvas *canvas, const char *selector=nullptr, bool shared=false)=0
Sets the image to the passed canvas (possibly sharing the pixel data).
virtual Size get_frame_number(Size frame_id) const =0
Returns the frame number for a give frame ID.
virtual const char * get_type(Size frame_id, Size uvtile_id) const =0
Returns the pixel type of a mipmap.
virtual bool is_animated() const =0
Indicates whether this image represents an animated texture.
virtual void get_uvtile_uv_ranges(Size frame_id, Sint32 &min_u, Sint32 &min_v, Sint32 &max_u, Sint32 &max_v) const =0
Returns the ranges of u- and v-coordinates.
virtual const char * get_selector() const =0
Returns the selector (or nullptr).
virtual const ICanvas * get_canvas(Size frame_id, Size uvtile_id, Uint32 level) const =0
Returns a canvas with the pixel data of the image.
virtual Size get_uvtile_id(Size frame_id, Sint32 u, Sint32 v) const =0
Returns the uv-tile ID corresponding to u- and v-coordinates.
virtual Sint32 reset_reader(IArray *reader, const char *image_format, const char *selector=nullptr)=0
Sets the image to the frame/uv-tile data provided by an array of readers.
virtual const char * get_original_filename() const =0
Returns the unresolved file as passed to reset_file().
virtual Sint32 get_uvtile_uv(Size frame_id, Size uvtile_id, Sint32 &u, Sint32 &v) const =0
Returns the u- and v- coordinates corresponding to a uv-tile ID.
virtual bool set_from_canvas(const IArray *uvtiles, const char *selector=nullptr)=0
Sets the frames/uv-tiles of this image to the passed canvases (without sharing).
virtual bool is_uvtile() const =0
Indicates whether this image represents a uvtile sequence.
virtual Uint32 resolution_z(Size frame_id, Size uvtile_id, Uint32 level) const =0
Returns the number of layers of a canvas.
virtual const char * get_filename(Size frame_id, Size uvtile_id) const =0
Returns the resolved file name of a mipmap of the image.
virtual bool set_from_canvas(IArray *uvtiles, const char *selector=nullptr, bool shared=false)=0
Sets the frames/uv-tiles of this image based to the passed canvases (possibly sharing the pixel data)...
virtual Size get_length() const =0
Returns the number of frames of this image. Never zero.
virtual Sint32 reset_file(const char *filename, const char *selector=nullptr)=0
Sets the image to a file identified by filename.
virtual Uint32 resolution_x(Size frame_id, Size uvtile_id, Uint32 level) const =0
Returns the horizontal resolution of a canvas.
virtual Uint32 get_levels(Size frame_id, Size uvtile_id) const =0
Returns the number of levels in the mipmap pyramid.
A reader supports binary block reads and string-oriented line reads that zero-terminate the result.
Definition: ireader.h:27
int Sint32
32-bit signed integer.
Definition: types.h:46
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179