Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Windows::Graphics::Effect Class Reference

Represents a basic image-processing construct in Direct2D. More...

#include <HWGraphics.h>

Inheritance diagram for Harlinn::Windows::Graphics::Effect:
[legend]
Collaboration diagram for Harlinn::Windows::Graphics::Effect:
[legend]

Public Types

using Base = Properties
 
- Public Types inherited from Harlinn::Windows::Graphics::Properties
using Base = Unknown
 
- Public Types inherited from Harlinn::Common::Core::Unknown
typedef IUnknown InterfaceType
 

Public Member Functions

void SetInput (UINT32 index, ID2D1Image *inputImage, BOOL invalidate=TRUE) const
 Sets the input to the given effect. The input can be a concrete bitmap or the output of another effect.
 
void SetInput (UINT32 index, const Image &inputImage, BOOL invalidate=TRUE) const
 
void SetInputCount (UINT32 inputCount) const
 If the effect supports a variable number of inputs, this sets the number of inputs that are currently active on the effect.
 
void GetInput (UINT32 index, ID2D1Image **inputImage) const
 Returns the input image to the effect. The input could be another effect or a bitmap.
 
Image GetInput (UINT32 index) const
 
UINT32 GetInputCount () const
 This returns the number of input that are bound into this effect.
 
void GetOutput (ID2D1Image **outputImage) const
 Returns the output image of the given effect. This can be set as the input to another effect or can be drawn with DrawImage.
 
Image GetOutput () const
 
void SetInputEffect (UINT32 index, ID2D1Effect *inputEffect, BOOL invalidate=TRUE) const
 
void SetInputEffect (UINT32 index, const Effect &inputEffect, BOOL invalidate=TRUE) const
 
- Public Member Functions inherited from Harlinn::Windows::Graphics::Properties
UINT32 GetPropertyCount () const
 Gets the number of top-level properties.
 
bool GetPropertyName (UINT32 index, PWSTR nameBuffer, UINT32 nameBufferSize) const
 Gets the property name that corresponds to the given index.
 
UINT32 GetPropertyNameLength (UINT32 index) const
 Gets the number of characters for the given property name.
 
D2D1_PROPERTY_TYPE GetType (UINT32 index) const
 Gets the D2D1_PROPERTY_TYPE of the selected property.
 
UINT32 GetPropertyIndex (PCWSTR propertyName) const
 Gets the index corresponding to the given property name.
 
void SetValueByName (PCWSTR propertyName, D2D1_PROPERTY_TYPE propertyType, const BYTE *data, UINT32 dataSize) const
 Sets the named property to the given value.
 
void SetValue (UINT32 propertyIndex, D2D1_PROPERTY_TYPE propertyType, const BYTE *data, UINT32 dataSize) const
 Sets the corresponding property by index.
 
void GetValueByName (PCWSTR propertyName, D2D1_PROPERTY_TYPE propertyType, BYTE *data, UINT32 dataSize) const
 Retrieves the given property or sub-property by name. '.' is the delimiter for sub-properties.
 
void GetValue (UINT32 index, D2D1_PROPERTY_TYPE propertyType, BYTE *data, UINT32 dataSize) const
 Gets the value of the specified property by index.
 
UINT32 GetValueSize (UINT32 index) const
 Gets the size of the property value in bytes, using the property index.
 
bool GetSubProperties (UINT32 index, ID2D1Properties **subProperties) const
 Retrieves the sub-properties of the given property by index.
 
Properties GetSubProperties (UINT32 index) const
 
void SetValueByName (PCWSTR name, const BYTE *data, UINT32 dataSize) const
 
void SetValue (UINT32 index, const BYTE *data, UINT32 dataSize) const
 
void GetValueByName (PCWSTR name, BYTE *data, UINT32 dataSize) const
 
void GetValue (UINT32 index, BYTE *data, UINT32 dataSize) const
 
template<typename T >
void GetValueByName (PCWSTR propertyName, T *value) const
 
template<typename T >
T GetValueByName (PCWSTR propertyName) const
 
template<typename T >
void SetValueByName (PCWSTR propertyName, const T &value) const
 
template<typename U >
void GetValue (U index, BYTE *data, UINT32 dataSize) const
 
template<typename T , typename U >
void GetValue (U index, T *value) const
 
template<typename T , typename U >
T GetValue (U index) const
 
template<typename U >
void SetValue (U index, const BYTE *data, UINT32 dataSize) const
 
template<typename T , typename U >
void SetValue (U index, const T &value) const
 
template<typename U >
void GetPropertyName (U index, PWSTR name, UINT32 nameCount) const
 
template<typename U >
UINT32 GetPropertyNameLength (U index) const
 
template<typename U >
D2D1_PROPERTY_TYPE GetType (U index) const
 
template<typename U >
UINT32 GetValueSize (U index) const
 
template<typename U >
void GetSubProperties (U index, ID2D1Properties **subProperties) const
 
- Public Member Functions inherited from Harlinn::Common::Core::Unknown
constexpr Unknown () noexcept
 
 Unknown (IUnknown *unknown, bool addref=false) noexcept
 
 Unknown (REFIID iid, const Unknown &unknown, bool throwIfNoInterface=true)
 
 Unknown (const Unknown &other) noexcept
 
 Unknown (Unknown &&other) noexcept
 
 ~Unknown () noexcept
 
constexpr operator bool () const noexcept
 
Unknownoperator= (const Unknown &other) noexcept
 
Unknownoperator= (Unknown &&other) noexcept
 
void swap (Unknown &other) noexcept
 
void ResetPtr (IUnknown *other=nullptr, bool addRef=false) noexcept
 
Unknownoperator= (nullptr_t)
 
IUnknown * Detach ()
 
template<typename T >
requires std::is_base_of_v<Unknown, T >
T As () const
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
bool Is () const noexcept
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
ComPtr< TAs () const
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
bool Is () const noexcept
 This function can be used to detect if an object supports a particular COM interface derived from IUnknown.
 
template<typename T = IUnknown>
TGetInterfacePointer () const noexcept
 
bool QueryInterface (REFIID riid, void **itf) const
 Queries a COM object for a pointer to one of its interface; identifying the interface by a reference to its interface identifier (IID). If the COM object implements the interface, then it returns a pointer to that interface after calling IUnknown::AddRef on it.
 
template<typename T >
requires std::is_base_of_v<IUnknown, T>
bool QueryInterface (T **itf) const
 
constexpr bool operator== (const Unknown &other) const noexcept
 
constexpr bool operator!= (const Unknown &other) const noexcept
 
constexpr bool operator== (const IUnknown *other) const noexcept
 
constexpr bool operator!= (const IUnknown *other) const noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from Harlinn::Common::Core::Unknown
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const CLSID &clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const wchar_t *clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromClassId (const WideString &clsid, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromProgId (const wchar_t *progId, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromProgId (const WideString &progId, DWORD classContext=CLSCTX_INPROC_SERVER)
 
template<typename T >
requires std::is_base_of_v<Unknown, T>
static T CoCreateInstanceFromDll (const ModuleHandle &dll, const CLSID &clsid)
 
- Protected Attributes inherited from Harlinn::Common::Core::Unknown
IUnknown * unknown_
 

Detailed Description

Represents a basic image-processing construct in Direct2D.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ GetInput() [1/2]

Image Harlinn::Windows::Graphics::Effect::GetInput ( UINT32 index) const
inline

◆ GetInput() [2/2]

void Harlinn::Windows::Graphics::Effect::GetInput ( UINT32 index,
ID2D1Image ** inputImage ) const
inline

Returns the input image to the effect. The input could be another effect or a bitmap.

Parameters
indexThe index of the image to retrieve.
inputImageWhen this method returns, contains the address of a pointer to the image that is identified by Index.

◆ GetInputCount()

UINT32 Harlinn::Windows::Graphics::Effect::GetInputCount ( ) const
inline

This returns the number of input that are bound into this effect.

Returns
This function returns the number of inputs to the effect.

◆ GetOutput() [1/2]

Image Harlinn::Windows::Graphics::Effect::GetOutput ( ) const
inline

◆ GetOutput() [2/2]

void Harlinn::Windows::Graphics::Effect::GetOutput ( ID2D1Image ** outputImage) const
inline

Returns the output image of the given effect. This can be set as the input to another effect or can be drawn with DrawImage.

Parameters
outputImageWhen this method returns, contains the address of a pointer to the output image for the effect.

◆ SetInput() [1/2]

void Harlinn::Windows::Graphics::Effect::SetInput ( UINT32 index,
const Image & inputImage,
BOOL invalidate = TRUE ) const
inline

◆ SetInput() [2/2]

void Harlinn::Windows::Graphics::Effect::SetInput ( UINT32 index,
ID2D1Image * inputImage,
BOOL invalidate = TRUE ) const
inline

Sets the input to the given effect. The input can be a concrete bitmap or the output of another effect.

Parameters
indexThe index of the image to set.
inputImageThe input image to set.
invalidateWhether to invalidate the graph at the location of the effect input

If the input index is out of range, the input image is ignored.

◆ SetInputCount()

void Harlinn::Windows::Graphics::Effect::SetInputCount ( UINT32 inputCount) const
inline

If the effect supports a variable number of inputs, this sets the number of inputs that are currently active on the effect.

Parameters
inputCountThe number of inputs to the effect.

Most effects do not support a variable number of inputs. Use Properties::GetValue with the D2D1_PROPERTY_MIN_INPUTS and D2D1_PROPERTY_MAX_INPUTS values to determine the number of inputs supported by an effect.

If the input count is less than the minimum or more than the maximum supported inputs, the call will fail and throw a Harlinn::Common::Core::Exception.

If the input count is unchanged, the call will succeed.

Any inputs currently selected on the effect will be unaltered by this call unless the number of inputs is made smaller. If the number of inputs is made smaller, inputs beyond the selected range will be released.

If the method fails, the existing input and input count will remain unchanged.

◆ SetInputEffect() [1/2]

void Harlinn::Windows::Graphics::Effect::SetInputEffect ( UINT32 index,
const Effect & inputEffect,
BOOL invalidate = TRUE ) const
inline

◆ SetInputEffect() [2/2]

void Harlinn::Windows::Graphics::Effect::SetInputEffect ( UINT32 index,
ID2D1Effect * inputEffect,
BOOL invalidate = TRUE ) const
inline

Sets the given input effect by index.

This method gets the output of the given effect and then passes the output image to the SetInput method.

Parameters
indexThe index of the input to set.
inputEffectThe input effect to set.
invalidateWhether to invalidate the graph at the location of the effect input

The documentation for this class was generated from the following file: