neuray API Programmer's Manual

iimage_api.h File Reference

Description

API component for various image-related functions.

Code Example

iimage_api.h

‎//*****************************************************************************
// Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
//*****************************************************************************
//*****************************************************************************

#ifndef MI_NEURAYLIB_IIMAGE_API_H
#define MI_NEURAYLIB_IIMAGE_API_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/version.h>

namespace mi {

namespace neuraylib {

class IBuffer;
class ICanvas;
class IReader;
class ITile;







class IImage_api : public
    mi::base::Interface_declare<0x4c25a4f0,0x2bac,0x4ce6,0xb0,0xab,0x4d,0x94,0xbf,0xfd,0x97,0xa5>
{
public:


    virtual ICanvas* create_canvas(
        const char* pixel_type,
        Uint32 width,
        Uint32 height,
        Uint32 tile_width = 0,
        Uint32 tile_height = 0,
        Uint32 layers = 1,
        bool is_cubemap = false,
        Float32 gamma = 0.0f) const = 0;

    virtual ITile* create_tile(
        const char* pixel_type,
        Uint32 width,
        Uint32 height) const = 0;




    virtual Sint32 
               read_raw_pixels(
        Uint32 width,
        Uint32 height,
        const ICanvas* canvas,
        Uint32 canvas_x,
        Uint32 canvas_y,
        Uint32 canvas_layer,
        void* buffer,
        bool buffer_topdown,
        const char* buffer_pixel_type,
        Uint32 buffer_padding = 0) const = 0;

    virtual Sint32 
               write_raw_pixels(
        Uint32 width,
        Uint32 height,
        ICanvas* canvas,
        Uint32 canvas_x,
        Uint32 canvas_y,
        Uint32 canvas_layer,
        const void* buffer,
        bool buffer_topdown,
        const char* buffer_pixel_type,
        Uint32 buffer_padding = 0) const = 0;




    virtual IBuffer* create_buffer_from_canvas(
        const ICanvas* canvas,
        const char* image_format,
        const char* pixel_type,
        const char* quality) const = 0;

    virtual ICanvas* create_canvas_from_buffer(
        const IBuffer* buffer,
        const char* image_format) const = 0;
    
    virtual bool supports_format_for_decoding(
        const char* image_format, IReader* reader = 0) const = 0;

    virtual bool supports_format_for_encoding( const char* image_format) const = 0;




    virtual ICanvas* convert( const ICanvas* canvas, const char* pixel_type) const = 0;

    virtual void adjust_gamma( ICanvas* canvas, Float32 new_gamma) const = 0;




    virtual Uint32 
               get_components_per_pixel( const char* pixel_type) const = 0;

    virtual Uint32 
               get_bytes_per_component( const char* pixel_type) const = 0;

};
 // end group mi_neuray_rendering

} // namespace neuraylib

#ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
using neuraylib::IBuffer;
using neuraylib::IReader;
#endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION

} // namespace mi

#endif // MI_NEURAYLIB_IIMAGE_API_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
This interface provides various utilities related to canvases and buffers. More...