Rhino C++ API  8.7
Public Member Functions | Protected Member Functions | List of all members
CRhRdkPostEffectPlugIn Class Referenceabstract

#include <RhRdkPostEffectPlugIn.h>

Inheritance diagram for CRhRdkPostEffectPlugIn:
CRhRdkObject CRhRdkPostEffectPlugInEx

Public Member Functions

 CRhRdkPostEffectPlugIn ()
 
virtual ~CRhRdkPostEffectPlugIn ()
 
virtual BYTE * Bits (void) const
 
virtual DWORD BitsPerPixel (void) const
 
virtual eRhRdkPepByteOrder ByteOrder (void) const
 
bool CanDisplayOptions (void) const
 
virtual bool ChannelInformationAvailable (const UUID &uuidChannel) const
 
virtual bool ColorPickerUI (CRhRdkColor &colInOut, HWND pParent) const
 
virtual bool DisplayOptions (HWND hWndParent)=0
 
virtual bool DisplayPreview (const class IRhRdkPEPDlg &)
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData) override
 
virtual bool FormatNumber (double dNumber, wchar_t *wszNumber, DWORD dwSize) const
 
virtual bool GetChannelValue (const UUID &uuidChannel, int x, int y, float &fValueOut) const
 
virtual bool GetChannelValue (const UUID &uuidChannel, int x, int y, ON__UINT32 &iValueOut) const
 
void GetChannelValue (IRhRdkRenderWindow::IChannel &channel, int x, int y, float &fValueOut) const
 
void GetChannelValue (IRhRdkRenderWindow::IChannel &channel, int x, int y, ON__UINT32 &iValueOut) const
 
virtual bool GetChannelValues (const UUID *aUuidChannels, int x, int y, float *aValuesOut, int iNumberOfValues) const
 
virtual bool GetDIBPixel (int x, int y, float &fRedOut, float &fGreenOut, float &fBlueOut) const
 
virtual int GetHostLocale (void) const
 
virtual bool GetLocalizedString (wchar_t *wszBuffer, DWORD dwNumChars, UINT uStringId=-1) const
 
virtual double GetMaxLuminance (void) const
 
virtual bool GetMinMaxValuesFromChannel (const UUID &uuidChannel, float &fMinOut, float &fMaxOut) const
 
virtual void GetRGBAOffset (int &iR, int &iG, int &iB, int &iA) const
 
virtual void GetRGBOffset (int &iR, int &iG, int &iB) const
 
virtual DWORD Height (void) const
 
virtual HICON Icon (bool bOn) const
 
virtual bool Inverted (void) const
 
virtual bool IsColorPickerImplemented (void) const
 
virtual bool IsPickPointOnImageImplemented (void) const
 
virtual bool IsPickRectangleOnImageImplemented (void) const
 
virtual DWORD LineLength (void) const
 
virtual IRhRdkRenderWindow::IChannelNewChannel (const UUID &uuidChannel) const
 
virtual bool On (void) const
 
virtual bool OnLoadPlugIn (void)=0
 
virtual double ParseNumber (const wchar_t *wszNumber) const
 
virtual bool PickPointOnImage (int &x, int &y, HCURSOR hCursor) const
 
virtual bool PickRectangleOnImage (ON_4iRect &rectOut, HCURSOR hCursor) const
 
virtual UUID PlugInID (void) const =0
 
virtual ON_wString PlugInName (void) const =0
 
virtual bool PostProcessImage (void)
 
virtual bool PreProcessImage (void)
 
virtual bool ProcessImage (void)=0
 
virtual bool ProvideHelp (const wchar_t *wszTopic)
 
virtual bool ReadFromDocumentDefaults (const CRhinoDoc &doc)
 
bool ReadFromNode (const CLBP_XMLNode &node)
 
virtual bool ReadState (const void *pBuffer, size_t size)=0
 
virtual void SetManager (Manager *pManager)
 
virtual void SetOn (bool bOn=true)
 
virtual void SetToDefault (void)=0
 
virtual bool UpdateImage (void)
 
virtual DWORD Width (void) const
 
virtual bool WorksWithCurrentImage (void) const =0
 
virtual bool WriteState (void *pBuffer, size_t &size) const =0
 
virtual bool WriteToDocumentDefaults (CRhinoDoc &doc) const
 
bool WriteToNode (CLBP_XMLNode &node) const
 
- Public Member Functions inherited from CRhRdkObject
 CRhRdkObject ()
 
virtual ~CRhRdkObject ()
 
void operator delete (void *buf)
 
void operator delete[] (void *buf)
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 

Protected Member Functions

virtual bool IsProcessInterrupted (void) const
 
virtual void OnProcessImageProgress (float fProgress) const
 

Additional Inherited Members

- Static Public Member Functions inherited from CRhRdkObject
static void CheckMemory (void)
 
static void PopulateDebuggingInfo (void)
 

Detailed Description

This class is deprecated in favor of IRhRdkPostEffectPlugIn.

Note: This is kept for backward compatibility. The New PEPs will not use this.

See also
IRhRdkPostEffectPlugIn

Constructor & Destructor Documentation

◆ CRhRdkPostEffectPlugIn()

CRhRdkPostEffectPlugIn::CRhRdkPostEffectPlugIn ( )

◆ ~CRhRdkPostEffectPlugIn()

virtual CRhRdkPostEffectPlugIn::~CRhRdkPostEffectPlugIn ( )
virtual

Member Function Documentation

◆ Bits()

virtual BYTE* CRhRdkPostEffectPlugIn::Bits ( void  ) const
virtual

This exposes the raw bits of the DIB to which you are writing changes. Remember, previous plug-ins may have changed the DIB already, so don't "undo" their changes by writing color information to every pixel - make the changes to the information you already find there.

Returns
A pointer to the bits in the image DIB.

◆ BitsPerPixel()

virtual DWORD CRhRdkPostEffectPlugIn::BitsPerPixel ( void  ) const
virtual
Returns
The number of bits in each image pixel.

◆ ByteOrder()

virtual eRhRdkPepByteOrder CRhRdkPostEffectPlugIn::ByteOrder ( void  ) const
virtual
Returns
The byte order of the dib pixels.

◆ CanDisplayOptions()

bool CRhRdkPostEffectPlugIn::CanDisplayOptions ( void  ) const

◆ ChannelInformationAvailable()

virtual bool CRhRdkPostEffectPlugIn::ChannelInformationAvailable ( const UUID &  uuidChannel) const
virtual

Query whether or not information is available in the image for a given channel.

Parameters
uuidChannelspecifies the channel of interest.
Returns
true if the image contains information for the specified channel, else false.

◆ ColorPickerUI()

virtual bool CRhRdkPostEffectPlugIn::ColorPickerUI ( CRhRdkColor colInOut,
HWND  pParent 
) const
virtual

Display a color picker.

Returns
true if successful, false if the user cancelled.

◆ DisplayOptions()

virtual bool CRhRdkPostEffectPlugIn::DisplayOptions ( HWND  hWndParent)
pure virtual

Implement this method to display the plug-in's options (AKA Properties) dialog.

Returns
true if the user clicked OK, else false.

◆ DisplayPreview()

virtual bool CRhRdkPostEffectPlugIn::DisplayPreview ( const class IRhRdkPEPDlg &  )
virtual

◆ EVF()

virtual void* CRhRdkPostEffectPlugIn::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
overridevirtual

Emergency virtual function for future expansion.

Reimplemented from CRhRdkObject.

◆ FormatNumber()

virtual bool CRhRdkPostEffectPlugIn::FormatNumber ( double  dNumber,
wchar_t *  wszNumber,
DWORD  dwSize 
) const
virtual

Format a numeric value to get a string representation.

Returns
true if successful, else false.

◆ GetChannelValue() [1/4]

virtual bool CRhRdkPostEffectPlugIn::GetChannelValue ( const UUID &  uuidChannel,
int  x,
int  y,
float &  fValueOut 
) const
virtual

Get a channel value from the image.

Parameters
uuidChannelspecifies the channel of interest.
xis the horizontal pixel position. Not range checked.
yis the vertical pixel position. Not range checked.
fValueOutaccepts the channel value.
Returns
true if successful, else false.

◆ GetChannelValue() [2/4]

virtual bool CRhRdkPostEffectPlugIn::GetChannelValue ( const UUID &  uuidChannel,
int  x,
int  y,
ON__UINT32 iValueOut 
) const
virtual

◆ GetChannelValue() [3/4]

void CRhRdkPostEffectPlugIn::GetChannelValue ( IRhRdkRenderWindow::IChannel channel,
int  x,
int  y,
float &  fValueOut 
) const

Much faster access to display channels than the UUID version. However, this version does not automatically adjust the DISTANCE_FROM_CAMERA channel values, so if you are using that channel you will need to add fValueOut = (fValueOut < -1e20f || fValueOut > 1e20f) ? -1.f : std::abs(fValueOut);

Parameters
channelis the channel returned from NewChannel.
xis the horizontal pixel position. Not range checked.
yis the vertical pixel position. Not range checked.
fValueOutaccepts the channel value.

◆ GetChannelValue() [4/4]

void CRhRdkPostEffectPlugIn::GetChannelValue ( IRhRdkRenderWindow::IChannel channel,
int  x,
int  y,
ON__UINT32 iValueOut 
) const

◆ GetChannelValues()

virtual bool CRhRdkPostEffectPlugIn::GetChannelValues ( const UUID *  aUuidChannels,
int  x,
int  y,
float *  aValuesOut,
int  iNumberOfValues 
) const
virtual

Get multiple channel values from the image.

Parameters
aUuidChannelsis an array specifying the channels of interest.
xis the horizontal pixel position.
yis the vertical pixel position.
aValuesOutaccepts the channel values in the same order as aUuidChannels.
iNumberOfValuesis the number of channels to retrieve. aUuidChannels and aValuesOut must have this many elements.
Returns
true if successful, else false.

◆ GetDIBPixel()

virtual bool CRhRdkPostEffectPlugIn::GetDIBPixel ( int  x,
int  y,
float &  fRedOut,
float &  fGreenOut,
float &  fBlueOut 
) const
virtual

Get an RGB pixel from the image.

Parameters
xis the horizontal pixel position.
yis the vertical pixel position.
fRedOutaccepts the red channel value.
fGreenOutaccepts the green channel value.
fBlueOutaccepts the blue channel value.
Returns
true if successful, else false.

◆ GetHostLocale()

virtual int CRhRdkPostEffectPlugIn::GetHostLocale ( void  ) const
virtual
Returns
Locale LCID for the current host (e.g., 1033 is US English).

◆ GetLocalizedString()

virtual bool CRhRdkPostEffectPlugIn::GetLocalizedString ( wchar_t *  wszBuffer,
DWORD  dwNumChars,
UINT  uStringId = -1 
) const
virtual

Get a localized string from the host application. The localized string should be placed into the buffer. The plug-in should supply the English version of the string in the buffer when calling this function. A string code can also be optionally passed.

Returns
true if the string was localized, else false.

◆ GetMaxLuminance()

virtual double CRhRdkPostEffectPlugIn::GetMaxLuminance ( void  ) const
virtual
Returns
The maximum luminance found in the RGB channels of the current image.

◆ GetMinMaxValuesFromChannel()

virtual bool CRhRdkPostEffectPlugIn::GetMinMaxValuesFromChannel ( const UUID &  uuidChannel,
float &  fMinOut,
float &  fMaxOut 
) const
virtual

Get minimum and maximum values from a channel in the image.

Parameters
uuidChannelspecifies the channel of interest.
fMinOutaccepts the minimum value.
fMaxOutaccepts the maximum value.
Returns
true if the image contains information for the specified channel, else false.

◆ GetRGBAOffset()

virtual void CRhRdkPostEffectPlugIn::GetRGBAOffset ( int &  iR,
int &  iG,
int &  iB,
int &  iA 
) const
virtual

Get the offsets to R, G, B and A in the bits.

◆ GetRGBOffset()

virtual void CRhRdkPostEffectPlugIn::GetRGBOffset ( int &  iR,
int &  iG,
int &  iB 
) const
virtual

Get the offsets to R, G and B in the bits. For backward compatibility only.

See also
GetRGBAOffset().

◆ Height()

virtual DWORD CRhRdkPostEffectPlugIn::Height ( void  ) const
virtual
Returns
The height of the image.

◆ Icon()

virtual HICON CRhRdkPostEffectPlugIn::Icon ( bool  bOn) const
virtual

◆ Inverted()

virtual bool CRhRdkPostEffectPlugIn::Inverted ( void  ) const
virtual
Returns
true if the image is inverted (bottom-up DIB), else false.

◆ IsColorPickerImplemented()

virtual bool CRhRdkPostEffectPlugIn::IsColorPickerImplemented ( void  ) const
virtual
Returns
true if color picker is implemented, else false.

◆ IsPickPointOnImageImplemented()

virtual bool CRhRdkPostEffectPlugIn::IsPickPointOnImageImplemented ( void  ) const
virtual
Returns
true if picking a point on this image is implemented, else false.

◆ IsPickRectangleOnImageImplemented()

virtual bool CRhRdkPostEffectPlugIn::IsPickRectangleOnImageImplemented ( void  ) const
virtual
Returns
true if picking a rectangle on this image is implemented, else false.

◆ IsProcessInterrupted()

virtual bool CRhRdkPostEffectPlugIn::IsProcessInterrupted ( void  ) const
protectedvirtual

Determine if the user cancelled the process.

Returns
true if the user cancelled the process, else false.

◆ LineLength()

virtual DWORD CRhRdkPostEffectPlugIn::LineLength ( void  ) const
virtual
Returns
The length in bytes (DWORD-aligned) of one image pixel line.

◆ NewChannel()

virtual IRhRdkRenderWindow::IChannel* CRhRdkPostEffectPlugIn::NewChannel ( const UUID &  uuidChannel) const
virtual

Get a new channel to pass into the fast version of GetChannelValue below. Remember, you must call Close() on this pointer when you are done with it in this case.

Returns
true if the channel exists, else false.

◆ On()

virtual bool CRhRdkPostEffectPlugIn::On ( void  ) const
virtual

◆ OnLoadPlugIn()

virtual bool CRhRdkPostEffectPlugIn::OnLoadPlugIn ( void  )
pure virtual

Called when the plug-in is loaded.

◆ OnProcessImageProgress()

virtual void CRhRdkPostEffectPlugIn::OnProcessImageProgress ( float  fProgress) const
protectedvirtual

Called to update the image's progress display.

Parameters
fProgressis the amount of progress so far, 0.0f - 1.0f.

◆ ParseNumber()

virtual double CRhRdkPostEffectPlugIn::ParseNumber ( const wchar_t *  wszNumber) const
virtual

Parse a number in string form to get a double value.

◆ PickPointOnImage()

virtual bool CRhRdkPostEffectPlugIn::PickPointOnImage ( int &  x,
int &  y,
HCURSOR  hCursor 
) const
virtual

Allows the user to pick a point on the image.

Parameters
xreceives the picked horizontal pixel position.
yreceives the picked vertical pixel position.
hCursoris the cursor to display during picking. If this is NULL, a default eye dropper will be used.
Returns
true if successful, else false.

◆ PickRectangleOnImage()

virtual bool CRhRdkPostEffectPlugIn::PickRectangleOnImage ( ON_4iRect rectOut,
HCURSOR  hCursor 
) const
virtual

Allows the user to pick a rectangle on the image by dragging a lasso.

Parameters
rectOutreceives the picked rectangle.
hCursoris the cursor to display during picking. If this is NULL, a default crosshair will be used.
Returns
true if successful, else false.

◆ PlugInID()

virtual UUID CRhRdkPostEffectPlugIn::PlugInID ( void  ) const
pure virtual
Returns
The unique identifier of the plug-in.

◆ PlugInName()

virtual ON_wString CRhRdkPostEffectPlugIn::PlugInName ( void  ) const
pure virtual
Returns
The localized name of the plug-in (e.g., "Fog").

◆ PostProcessImage()

virtual bool CRhRdkPostEffectPlugIn::PostProcessImage ( void  )
virtual

Called just after ProcessImage() is called, but only if it succeeded. If you override this method, please be sure to call the base class.

Returns
true if successful, false if cancelled by the user.

◆ PreProcessImage()

virtual bool CRhRdkPostEffectPlugIn::PreProcessImage ( void  )
virtual

Called just before ProcessImage() is called. If you override this method, please be sure to call the base class.

Returns
true if successful, false if cancelled by the user.

◆ ProcessImage()

virtual bool CRhRdkPostEffectPlugIn::ProcessImage ( void  )
pure virtual

Implement this method to have the plug-in process the image. Called just after PreProcessImage() is called, but only if it succeeded.

Returns
true if successful, false if cancelled by the user.

◆ ProvideHelp()

virtual bool CRhRdkPostEffectPlugIn::ProvideHelp ( const wchar_t *  wszTopic)
virtual

Display help for the specified topic.

Returns
true if successful, else false.

◆ ReadFromDocumentDefaults()

virtual bool CRhRdkPostEffectPlugIn::ReadFromDocumentDefaults ( const CRhinoDoc doc)
virtual

Read the state from the document defaults.

◆ ReadFromNode()

bool CRhRdkPostEffectPlugIn::ReadFromNode ( const CLBP_XMLNode &  node)

◆ ReadState()

virtual bool CRhRdkPostEffectPlugIn::ReadState ( const void *  pBuffer,
size_t  size 
)
pure virtual

Implement this method to have the plug-in read its state from a buffer.

Parameters
pBufferis the buffer containing data previously written by WriteState().
sizeis the number of bytes in the buffer.
Returns
true if successful, else false.

◆ SetManager()

virtual void CRhRdkPostEffectPlugIn::SetManager ( Manager *  pManager)
virtual

◆ SetOn()

virtual void CRhRdkPostEffectPlugIn::SetOn ( bool  bOn = true)
virtual

◆ SetToDefault()

virtual void CRhRdkPostEffectPlugIn::SetToDefault ( void  )
pure virtual

Reset the plug-in's state to factory defaults.

◆ UpdateImage()

virtual bool CRhRdkPostEffectPlugIn::UpdateImage ( void  )
virtual

Updates the image by applying the post-effects to it.

◆ Width()

virtual DWORD CRhRdkPostEffectPlugIn::Width ( void  ) const
virtual
Returns
The width of the image.

◆ WorksWithCurrentImage()

virtual bool CRhRdkPostEffectPlugIn::WorksWithCurrentImage ( void  ) const
pure virtual

Query whether or not the plug-in can work with the current image.

Note
Use the channel query functions to determine if you can work on this image.
Returns
true if the plug-in can work with the current image, else false.

◆ WriteState()

virtual bool CRhRdkPostEffectPlugIn::WriteState ( void *  pBuffer,
size_t &  size 
) const
pure virtual

Implement this method to have the plug-in write its state to a buffer.

Parameters
pBufferis the buffer to fill with state information. If pBuffer is NULL the implementation must set size to the buffer size that would be required to write the plug-in state.
sizeis the physical number of bytes that the buffer can accomodate. This parameter also accepts the logical number of bytes written to the buffer. This will be more than size if the buffer was not big enough. If pBuffer is NULL you can pass zero in size to get the number of bytes required to write the plug-in state.
Note
The implementor is responsible for ensuring that the buffer is not overrun.
Returns
true if successful, else false.

◆ WriteToDocumentDefaults()

virtual bool CRhRdkPostEffectPlugIn::WriteToDocumentDefaults ( CRhinoDoc doc) const
virtual

Write the state to the document defaults.

◆ WriteToNode()

bool CRhRdkPostEffectPlugIn::WriteToNode ( CLBP_XMLNode &  node) const