Rhino C++ API  8.7
Public Member Functions | List of all members
CRhRdkLinearWorkflow Class Reference

#include <RhRdkLinearWorkflow.h>

Inheritance diagram for CRhRdkLinearWorkflow:
IRhRdkLinearWorkflow CRhRdkLinearWorkflowEx

Public Member Functions

 CRhRdkLinearWorkflow ()
 CRhRdkLinearWorkflow (const IRhRdkLinearWorkflow &lw)
virtual void ApplyPostProcessGamma (CRhinoDib &dibInOut) const override
virtual void ApplyPreProcessGamma (CRhinoDib &dibInOut) const override
virtual void ApplyPreProcessGamma (CRhRdkColor &col, bool bForTexture) const override
virtual IRhRdkLinearWorkflowBeginChange (RhRdkChangeContext cc) const override
virtual ON__UINT32 ComputeCRC (void) const override
virtual void CopyFrom (const IRhRdkLinearWorkflow &lw) override
void CopyFrom (const ON_LinearWorkflow &lw)
virtual bool EndChange (void) override
virtual void * EVF (const wchar_t *, void *) override
virtual bool IsEqual (const IRhRdkLinearWorkflow &lw) const override
bool operator!= (const IRhRdkLinearWorkflow &lw) const
const CRhRdkLinearWorkflowoperator= (const IRhRdkLinearWorkflow &lw)
bool operator== (const IRhRdkLinearWorkflow &lw) const
virtual bool PostProcessFrameBuffer (void) const override
virtual float PostProcessGamma (void) const override
virtual float PostProcessGammaReciprocal (void) const override
virtual bool PreProcessColors (void) const override
virtual float PreProcessGamma (void) const override
virtual bool PreProcessTextures (void) const override
virtual void SetPostProcessFrameBuffer (bool b) override
virtual void SetPostProcessGamma (float fGamma) override
virtual void SetPreProcessColors (bool b) override
virtual void SetPreProcessGamma (float fGamma) override
virtual void SetPreProcessTextures (bool b) override
- Public Member Functions inherited from IRhRdkLinearWorkflow
virtual ~IRhRdkLinearWorkflow ()
bool PostProcessFrameBufferOn (void) const
bool PostProcessGammaOn (void) const
bool PreProcessColorsOn (void) const
bool PreProcessTexturesOn (void) const
void SetPostProcessFrameBufferOn (bool b)
void SetPostProcessGammaOn (bool)
void SetPreProcessColorsOn (bool b)
void SetPreProcessTexturesOn (bool b)

Additional Inherited Members

- Static Public Member Functions inherited from IRhRdkLinearWorkflow
static IRhRdkLinearWorkflowNew (void)

Detailed Description

This helper class provides simple gamma and linear workflow processing.

If you want to get the linear workflow or gamma settings being used by a document, please see CRhRdkDocument::LinearWorkflow().

Note that this does not support the EVF functions "PostProcessGammaOn" or "SetPostProcessGammaOn" mentioned in IRhRdkLinearWorkflow. Please use CRhRdkLinearWorkflowEx to solve this.

Constructor & Destructor Documentation

◆ CRhRdkLinearWorkflow() [1/2]

CRhRdkLinearWorkflow::CRhRdkLinearWorkflow ( )

◆ CRhRdkLinearWorkflow() [2/2]

CRhRdkLinearWorkflow::CRhRdkLinearWorkflow ( const IRhRdkLinearWorkflow lw)

Member Function Documentation

◆ ApplyPostProcessGamma()

virtual void CRhRdkLinearWorkflow::ApplyPostProcessGamma ( CRhinoDib dibInOut) const

Modifies a DIB by applying gamma correction using the gamma reciprocal.

This method replaces the NewGammaCorrectedBitmap() method.
dibInOutis the DIB which is altered if gamma is not equal to 1.

Implements IRhRdkLinearWorkflow.

Reimplemented in CRhRdkLinearWorkflowEx.

◆ ApplyPreProcessGamma() [1/2]

virtual void CRhRdkLinearWorkflow::ApplyPreProcessGamma ( CRhinoDib dibInOut) const

Applies pre-process gamma correction to a dib (i.e., an LDR texture) if PreProcessTextures is true.

If this texture comes from a CRhRdkTexture, you should first check CRhRdkTexture::IsLinear(). If the texture is linear, it will require no further processing.

Implements IRhRdkLinearWorkflow.

◆ ApplyPreProcessGamma() [2/2]

virtual void CRhRdkLinearWorkflow::ApplyPreProcessGamma ( CRhRdkColor col,
bool  bForTexture 
) const

Applies pre-process gamma correction to a color if linear workflow is active.

bForTextureis true if the color is part of a texture. See notes below for checking CRhRdkTexture::IsLinear().

Implements IRhRdkLinearWorkflow.

◆ BeginChange()

virtual IRhRdkLinearWorkflow& CRhRdkLinearWorkflow::BeginChange ( RhRdkChangeContext  cc) const

Call this method to get a non-const object upon which you can call non-const methods. Calls to this method are counted; you must call EndChange() once for every call to BeginChange(). Please do not use const_cast or any other means of circumventing this requirement.

Implements IRhRdkLinearWorkflow.

◆ ComputeCRC()

virtual ON__UINT32 CRhRdkLinearWorkflow::ComputeCRC ( void  ) const
CRC of gamma and linear workflow active state.

Implements IRhRdkLinearWorkflow.

◆ CopyFrom() [1/2]

virtual void CRhRdkLinearWorkflow::CopyFrom ( const IRhRdkLinearWorkflow lw)

Copy another linear workflow object to this one.

Implements IRhRdkLinearWorkflow.

◆ CopyFrom() [2/2]

void CRhRdkLinearWorkflow::CopyFrom ( const ON_LinearWorkflow lw)

◆ EndChange()

virtual bool CRhRdkLinearWorkflow::EndChange ( void  )

Implements IRhRdkLinearWorkflow.

◆ EVF()

virtual void* CRhRdkLinearWorkflow::EVF ( const wchar_t *  wszFunc,
void *  pvData 

Emergency virtual function for future expansion. Currently implemented wszFunc: "PostProcessGammaOn" (pvData = null; returns pointer to bool). "SetPostProcessGammaOn" (pvData is pointer to bool).

Implements IRhRdkLinearWorkflow.

Reimplemented in CRhRdkLinearWorkflowEx.

◆ IsEqual()

virtual bool CRhRdkLinearWorkflow::IsEqual ( const IRhRdkLinearWorkflow lw) const
true if this object is equal to another one.

Implements IRhRdkLinearWorkflow.

◆ operator!=()

bool CRhRdkLinearWorkflow::operator!= ( const IRhRdkLinearWorkflow lw) const

◆ operator=()

const CRhRdkLinearWorkflow& CRhRdkLinearWorkflow::operator= ( const IRhRdkLinearWorkflow lw)

◆ operator==()

bool CRhRdkLinearWorkflow::operator== ( const IRhRdkLinearWorkflow lw) const

◆ PostProcessFrameBuffer()

virtual bool CRhRdkLinearWorkflow::PostProcessFrameBuffer ( void  ) const
whether the frame buffer should be gamma corrected.

Implements IRhRdkLinearWorkflow.

◆ PostProcessGamma()

virtual float CRhRdkLinearWorkflow::PostProcessGamma ( void  ) const
post-process gamma for frame buffer. This is not the value applied, this is the value that appears in the UI.
See also

Implements IRhRdkLinearWorkflow.

◆ PostProcessGammaReciprocal()

virtual float CRhRdkLinearWorkflow::PostProcessGammaReciprocal ( void  ) const
gamma reciprocal for frame buffer. This is the value that is applied to each color channel for post-process and is supplied here as an optimization.

Implements IRhRdkLinearWorkflow.

◆ PreProcessColors()

virtual bool CRhRdkLinearWorkflow::PreProcessColors ( void  ) const
linear workflow active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ PreProcessGamma()

virtual float CRhRdkLinearWorkflow::PreProcessGamma ( void  ) const
pre-process gamma for input textures and colors.

Implements IRhRdkLinearWorkflow.

◆ PreProcessTextures()

virtual bool CRhRdkLinearWorkflow::PreProcessTextures ( void  ) const
linear workflow active state for textures (also check IsLinear()).

Implements IRhRdkLinearWorkflow.

◆ SetPostProcessFrameBuffer()

virtual void CRhRdkLinearWorkflow::SetPostProcessFrameBuffer ( bool  b)

Set linear workflow (pre-process) active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ SetPostProcessGamma()

virtual void CRhRdkLinearWorkflow::SetPostProcessGamma ( float  f)

Set post-process gamma. This will generally be >= 1.0 (usually 2.2). The actual value to be applied in post-process is the reciprocal.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessColors()

virtual void CRhRdkLinearWorkflow::SetPreProcessColors ( bool  b)

Set linear workflow (pre-process) active state for individual colors.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessGamma()

virtual void CRhRdkLinearWorkflow::SetPreProcessGamma ( float  f)

Set pre-process gamma. This will generally be >= 1.0 (usually 2.2). This is the actual value applied in pre-process.

Implements IRhRdkLinearWorkflow.

◆ SetPreProcessTextures()

virtual void CRhRdkLinearWorkflow::SetPreProcessTextures ( bool  b)

Set linear workflow (pre-process) active state for textures.

Implements IRhRdkLinearWorkflow.