MDL SDK API nvidia_logo_transpbg.gif Up
iimage.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 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 = 0) = 0;
135
153 IReader* reader, const char* image_format, const char* selector = 0) = 0;
154
184 IArray* reader, const char* image_format, const char* selector = 0) = 0;
185
197 virtual bool set_from_canvas(
198 const ICanvas* canvas, const char* selector = 0) = 0;
199
214 virtual bool set_from_canvas(
215 ICanvas* canvas, const char* selector = 0, bool shared = false) = 0;
216
217#ifdef MI_NEURAYLIB_DEPRECATED_14_0
218 inline bool set_from_canvas( ICanvas* canvas, bool shared)
219 { return set_from_canvas( canvas, 0, shared); }
220#endif
221
242 virtual bool set_from_canvas(
243 const IArray* uvtiles, const char* selector = 0) = 0;
244
269 virtual bool set_from_canvas(
270 IArray* uvtiles, const char* selector = 0, bool shared = false) = 0;
271
272#ifdef MI_NEURAYLIB_DEPRECATED_14_0
273 inline bool set_from_canvas( IArray* uvtiles, bool shared)
274 { return set_from_canvas( uvtiles, 0, shared); }
275#endif
276
278
280
284 virtual bool is_animated() const = 0;
285
287 virtual Size get_length() const = 0;
288
296 virtual Size get_frame_number( Size frame_id) const = 0;
297
302 virtual Size get_frame_id( Size frame_number) const = 0;
303
305
307
312 virtual bool is_uvtile() const = 0;
313
315 virtual Size get_frame_length( Size frame_id) const = 0;
316
317#ifdef MI_NEURAYLIB_DEPRECATED_12_1
318 inline Size get_uvtile_length() const { return get_frame_length( 0); }
319#endif
320
328 virtual Sint32 get_uvtile_uv( Size frame_id, Size uvtile_id, Sint32& u, Sint32& v) const = 0;
329
330#ifdef MI_NEURAYLIB_DEPRECATED_12_1
331 inline Sint32 get_uvtile_uv( Uint32 uvtile_id, Sint32& u, Sint32& v) const
332 { return get_uvtile_uv( 0, uvtile_id, u, v); }
333#endif
334
341 virtual Size get_uvtile_id( Size frame_id, Sint32 u, Sint32 v) const = 0;
342
343#ifdef MI_NEURAYLIB_DEPRECATED_12_1
344 inline Uint32 get_uvtile_id( Sint32 u, Sint32 v) const
345 { return static_cast<Uint32>( get_uvtile_id( 0, u, v)); }
346#endif
347
356 Size frame_id, Sint32& min_u, Sint32& min_v, Sint32& max_u, Sint32& max_v) const = 0;
357
358#ifdef MI_NEURAYLIB_DEPRECATED_12_1
359 inline void get_uvtile_uv_ranges(
360 Sint32& min_u, Sint32& min_v, Sint32& max_u, Sint32& max_v) const
361 { return get_uvtile_uv_ranges( 0, min_u, min_v, max_u, max_v); }
362#endif
363
365
367
378 virtual const char* get_filename( Size frame_id, Size uvtile_id) const = 0;
379
380#ifdef MI_NEURAYLIB_DEPRECATED_12_1
381 inline const char* get_filename( Uint32 uvtile_id = 0) const
382 { return get_filename( 0, uvtile_id); }
383#endif
384
390 virtual const char* get_original_filename() const = 0;
391
393 virtual const char* get_selector() const = 0;
394
404 virtual const ICanvas* get_canvas( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
405
406#ifdef MI_NEURAYLIB_DEPRECATED_12_1
407 inline const ICanvas* get_canvas( Uint32 level = 0, Uint32 uvtile_id = 0) const
408 { return get_canvas( 0, uvtile_id, level); }
409#endif
410
412
414
422 virtual const char* get_type( Size frame_id, Size uvtile_id) const = 0 ;
423
424#ifdef MI_NEURAYLIB_DEPRECATED_12_1
425 inline const char* get_type( Uint32 uvtile_id = 0) const { return get_type( 0, uvtile_id); }
426#endif
427
433 virtual Uint32 get_levels( Size frame_id, Size uvtile_id) const = 0;
434
435#ifdef MI_NEURAYLIB_DEPRECATED_12_1
436 inline Uint32 get_levels( Uint32 uvtile_id = 0) const { return get_levels( 0, uvtile_id); }
437#endif
438
446 virtual Uint32 resolution_x( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
447
448#ifdef MI_NEURAYLIB_DEPRECATED_12_1
449 inline Uint32 resolution_x( Uint32 level = 0, Uint32 uvtile_id = 0) const
450 { return resolution_x( 0, uvtile_id, level); }
451#endif
452
460 virtual Uint32 resolution_y( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
461
462#ifdef MI_NEURAYLIB_DEPRECATED_12_1
463 inline Uint32 resolution_y( Uint32 level = 0, Uint32 uvtile_id = 0) const
464 { return resolution_y( 0, uvtile_id, level); }
465#endif
466
474 virtual Uint32 resolution_z( Size frame_id, Size uvtile_id, Uint32 level) const = 0;
475
476#ifdef MI_NEURAYLIB_DEPRECATED_12_1
477 inline Uint32 resolution_z( Uint32 level = 0, Uint32 uvtile_id = 0) const
478 { return resolution_z( 0, uvtile_id, level); }
479#endif
480
482};
483 // end group mi_neuray_misc
485
486} // namespace neuraylib
487
488} // namespace mi
489
490#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:85
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 Sint32 reset_file(const char *filename, const char *selector=0)=0
Sets the image to a file identified by filename.
virtual bool set_from_canvas(const IArray *uvtiles, const char *selector=0)=0
Sets the frames/uv-tiles of this image to the passed canvases (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(IArray *reader, const char *image_format, const char *selector=0)=0
Sets the image to the frame/uv-tile data provided by an array of readers.
virtual Sint32 reset_reader(IReader *reader, const char *image_format, const char *selector=0)=0
Sets the image to the data provided by a reader.
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 NULL).
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 bool set_from_canvas(ICanvas *canvas, const char *selector=0, bool shared=false)=0
Sets the image to the passed canvas (possibly sharing the pixel data).
virtual bool set_from_canvas(const ICanvas *canvas, const char *selector=0)=0
Sets the image to the passed canvas (without sharing).
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 bool set_from_canvas(IArray *uvtiles, const char *selector=0, bool shared=false)=0
Sets the frames/uv-tiles of this image based to the passed canvases (possibly sharing the pixel data)...
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 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 Size get_length() const =0
Returns the number of frames of this image. Never zero.
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
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:112
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5