source file REDIImage2D.h

Go to the documentation of this file.

#ifndef RED_IIMAGE2D_H
#define RED_IIMAGE2D_H

//******************************************************************************
// Copyright (c) 2005 Redway. All rights reserved.
//
// Redway3d is a registered trademark. Any reproduction and / or utilization
// of any material from this document without Redway?s express authorization
// are prohibited.
//******************************************************************************

#include "REDIImage.h"
#include "REDSTL.h"
#include "REDRenderShaderParameter.h"
#include "REDShaderProgramID.h"


//******************************************************************************
//*** RED::IImage2D interface **************************************************
//******************************************************************************

namespace RED
{
  
  // IImage2D interface:
  // -------------------
  
  class REDFullExp IImage2D : public IREDObject
  {
    public:

    // Typing information:
    // -------------------
    
    SET_CID( CID_class_REDIImage2D );
    
    
    // Managing render images:
    // -----------------------
    
    virtual RED_RC SetRenderImage( RED::Object*      iVRL,
                                   int               iWidth,
                                   int               iHeight,
                                   int               iXAnchor,
                                   int               iYAnchor,
                                   RED::TARGET       iTarget,
                                   const RED::State& iState ) = 0;
    
    
    virtual RED_RC SetRenderDepthImage( RED::Object*      iVRL,
                                        int             iWidth,
                                        int             iHeight,
                                        int             iXAnchor,
                                        int             iYAnchor,
                                        const RED::State& iState ) = 0;
    
    
    virtual RED_RC SetNotRenderImage( const RED::State& iState ) = 0;
    
    
    virtual RED_RC IsRenderImage( bool& oRender, int iStateNumber = -1 ) const = 0;
    
    
    virtual RED_RC IsRenderDepthImage( bool& oDepth, int iStateNumber = -1 ) const = 0;
    
    
    virtual RED_RC GetRenderImage( RED::Object*& oVRL,
                                   int&          oWidth,
                                   int&          oHeight,
                                   int&          oXAnchor,
                                   int&          oYAnchor,
                                   TARGET&       oTarget,
                                   int           iStateNumber = -1 ) const = 0;
    
    
    // Image pixels manipulation:
    // --------------------------
    
    virtual RED_RC SetPixels( const unsigned char* iPixel,
                              RED::FORMAT          iFormat,
                              RED::TARGET          iTarget,
                              int                  iWidth,
                              int                  iHeight,
                              const RED::State&    iState ) = 0;
    
    
    virtual RED_RC SetPixels( RED::TARGET       iTarget,
                              const RED::State& iState ) = 0;
    
    
    virtual RED_RC SetCompressedPixels( unsigned char*    iPixel,
                                        RED::FORMAT       iFormat,
                                        RED::TARGET       iTarget,
                                        int               iWidth,
                                        int               iHeight,
                                        const RED::State& iState ) = 0;
    
    
    virtual RED_RC SetCompressedPixels( RED::TARGET       iTarget,
                                        const RED::State& iState ) = 0;
    
    
    virtual RED_RC SetFloatPixels( CHANNEL            iChannel,
                                   const RED::Object* iImage,
                                   const RED::State&  iState ) = 0;
    
    
    virtual RED_RC SetPixelChannel( CHANNEL            iDestChannel,
                                    const RED::Object* iSourceImage,
                                    CHANNEL            iSourceChannel,
                                    const RED::State&  iState ) = 0;
    
    
    virtual RED_RC SetFromPixelShader( RED::FORMAT                                      iFormat,
                                       const RED::ShaderProgramID&                      iPixelShaderId,
                                       RED::Object*                                     iResMgr,
                                       const RED::Object*                               iSourceImage,
                                       const RED::Vector< RED::RenderShaderParameter >& iParams,
                                       const RED::State&                                iState ) = 0;
    
    
    virtual RED_RC NormalMap( RED::FORMAT        iFormat,
                              RED::TARGET        iTarget,
                              float              iScaling,
                              const RED::Object* iSourceImage,
                              const RED::State&  iState ) = 0;
    
    
    virtual RED_RC GetPixels( int iStateNumber = -1 ) const = 0;
    
    
    // Local image pixel storage:
    // --------------------------
    
    virtual unsigned char* GetLocalPixels() = 0;
    
    
    virtual const unsigned char* GetLocalPixels() const = 0;
    
    
    virtual void GetLocalSize( int& oWidth, int& oHeight ) const = 0;
    
    
    virtual int GetLocalWidth() const = 0;
    
    
    virtual int GetLocalHeight() const = 0;
    
    
    virtual RED::FORMAT GetLocalFormat() const = 0;
    
    
    virtual RED_RC SetLocalPixels( const unsigned char* iPixel,
                                   RED::FORMAT          iFormat,
                                   int                  iWidth,
                                   int                  iHeight ) = 0;
    
    
    virtual void ClearLocalPixels() = 0;
    
    
    // Tone mapping:
    // -------------
    
    virtual RED_RC GetAverageLuminance( float&        oAverageLuminance, 
                                        unsigned int& oSamplesCount,
                                        int           iStateNumber = -1 ) const = 0;


    virtual RED_RC SetAverageLuminance( float             iAverageLuminance, 
                                        unsigned int      iSamplesCount,
                                        const RED::State& iState ) = 0;


    virtual RED_RC GetLogAverageLuminance( float&         oLogAverageLuminance, 
                                           unsigned int&  oSamplesCount,
                                           int            iStateNumber = -1 ) const = 0;


    virtual RED_RC SetLogAverageLuminance( float              iLogAverageLuminance, 
                                           unsigned int       iSamplesCount,
                                           const RED::State&  iState ) = 0;


    virtual RED_RC GetMinLuminance( float& oMinLuminance, 
                                    int    iStateNumber = -1 ) const = 0;


    virtual RED_RC SetMinLuminance( float             iMinLuminance, 
                                    const RED::State& iState ) = 0;


    virtual RED_RC GetMaxLuminance( float& oMaxLuminance, 
                                    int    iStateNumber = -1 ) const = 0;


    virtual RED_RC SetMaxLuminance( float             iMaxLuminance, 
                                    const RED::State& iState ) = 0;
  };
};


#endif