Compose filter. More...
#include <ilviews/bitmaps/filters/compose.h>
Public Types | |
enum | Operator { Over, In, Out, Atop, Xor, Arithmetic } |
This enumeration defines the possible values for the composition mode. More... | |
Public Member Functions | |
IlvComposeFilter (Operator op=Over, IlFloat k1=0.0, IlFloat k2=0.0, IlFloat k3=0.0, IlFloat k4=0.0) | |
Initializes a new IlvComposeFilter instance. More... | |
~IlvComposeFilter () | |
Destructor. More... | |
IlvBitmapData * | apply (IlUInt count=0, const IlvBitmapData **inputs=0) |
Applies the compositing to the given images. | |
void | getArithmeticValues (IlFloat &k1, IlFloat &k2, IlFloat &k3, IlFloat &k4) const |
Returns the Arithmetic operator parameters. More... | |
IlFloat | getK1 () const |
Returns the k1 parameter of the Arithmetic operator. More... | |
IlFloat | getK2 () const |
Returns the k2 parameter of the Arithmetic operator. More... | |
IlFloat | getK3 () const |
Returns the k3 parameter of the Arithmetic operator. More... | |
IlFloat | getK4 () const |
Returns the k4 parameter of the Arithmetic operator. More... | |
Operator | getOperator () const |
Returns the compositing operator. More... | |
void | setArithmeticValues (IlFloat k1, IlFloat k2, IlFloat k3, IlFloat k4) |
Sets the Arithmetic operator parameters. More... | |
void | setK1 (IlFloat k1) |
Sets the k1 parameter of the Arithmetic operator. More... | |
void | setK2 (IlFloat k2) |
Sets the k2 parameter of the Arithmetic operator. More... | |
void | setK3 (IlFloat k3) |
Sets the k3 parameter of the Arithmetic operator. More... | |
void | setK4 (IlFloat k4) |
Sets the k4 parameter of the Arithmetic operator. More... | |
void | setOperator (Operator op) |
Sets the compositing operator. More... | |
Public Member Functions inherited from IlvBitmapFilter | |
IlvBitmapFilter () | |
Constructor. More... | |
virtual | ~IlvBitmapFilter () |
Destructor. More... | |
IlvBitmapData * | applyUnary (const IlvBitmapData *data) |
Convenience method for unary filters. More... | |
virtual const char * | getClassName () const |
Returns the class name of the filter. More... | |
IlUInt | getHeight () const |
Returns the height of the filter effect region. More... | |
const char *const * | getInputs (IlUInt &count) const |
Returns the name of the input bitmap data. More... | |
const char * | getName () const |
Returns the name of the filter. More... | |
IlUInt | getRefCount () const |
Returns the reference count for this instance. | |
const char * | getResult () const |
Returns the name of the result bitmap data. More... | |
IlUInt | getWidth () const |
Returns the width of the filter effect region. More... | |
IlInt | getX () const |
Returns the left coordinate of the filter effect region. More... | |
IlInt | getY () const |
Returns the top coordinate of the filter effect region. More... | |
void | lock () |
Locks the current instance. | |
void | setHeight (IlUInt height) |
Sets the height of the filter effect region. More... | |
void | setInputs (IlUInt count, const char *const *name) |
Sets the input names of the filter. More... | |
void | setName (const char *id) |
Sets the name of the filter. More... | |
void | setResult (const char *name) |
Sets the result name of the filter. More... | |
void | setWidth (IlUInt width) |
Sets the width of the filter effect region. More... | |
void | setX (IlInt x) |
Sets the left coordinate of the filter effect region. More... | |
void | setY (IlInt y) |
Sets the top coordinate of the filter effect region. More... | |
void | unLock () |
Unlocks the current instance. When the reference count is 0 , the instance is deleted. | |
Public Member Functions inherited from IlvValueInterface | |
virtual IlBoolean | applyValue (const IlvValue &value) |
Apply an accessor. More... | |
virtual IlBoolean | changeValue (const IlvValue &val) |
Changes the value of an accessor. More... | |
virtual IlBoolean | changeValues (const IlvValue *values, IlUShort count=0) |
Changes several accessor values simultaneously. More... | |
virtual void | getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const |
Retrieves the list of available accessors of an object. More... | |
virtual IlvValue & | queryValue (IlvValue &val) const |
Retrieves an accessor value. More... | |
virtual void | queryValues (IlvValue *values, IlUShort count) const |
Retrieves multiple accessor values simultaneously. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvBitmapFilter | |
static IlvBitmapFilter * | Create (const char *classname, IlBoolean forceLoad=IlTrue) |
This static method creates an instance of a bitmap filter of given classname. If the filter class is not registered and forceLoad is IlTrue , an attempt to load a dynamic module for this filter is made. More... | |
static const char ** | GetRegisteredFilters (IlUInt &num) |
This static method returns an array of registered filter class names. More... | |
Compose filter.
Library: ilvbmpflt
This bitmap filter lets you compose two images using the Porter-Duff operators over, in out, atop, xor, and an arithmetic operator. The resulting color is given by the formula:
Cresult = Fa * Ca + Fb * Cb
Ca is the color from the first image, Cb is the color from the second image. Aa is the alpha value from the first image, Ab is the alpha value from the second image.
For the arithmetic operator each pixel is computed as follows:
Cresult = k1 * Ca * Cb + k2 * Ca + k3 * Ca * Cb + k4
where k1, k2, k3, and k4 are user-specified.
IlvRGBBitmapData
, IlvBitmapFilter
This enumeration defines the possible values for the composition mode.
IlvComposeFilter::IlvComposeFilter | ( | Operator | op = Over , |
IlFloat | k1 = 0.0 , |
||
IlFloat | k2 = 0.0 , |
||
IlFloat | k3 = 0.0 , |
||
IlFloat | k4 = 0.0 |
||
) |
Initializes a new IlvComposeFilter
instance.
op | The composition mode. |
k1 | The initial k1 parameter. |
k2 | The initial k2 parameter. |
k3 | The initial k3 parameter. |
k4 | The initial k4 parameter. |
IlvComposeFilter::~IlvComposeFilter | ( | ) |
Destructor.
The destructor releases all the memory used by this object.
void IlvComposeFilter::getArithmeticValues | ( | IlFloat & | k1, |
IlFloat & | k2, | ||
IlFloat & | k3, | ||
IlFloat & | k4 | ||
) | const |
Returns the Arithmetic operator parameters.
k1 | Will contain the k1 parameter. |
k2 | Will contain the k2 parameter. |
k3 | Will contain the k3 parameter. |
k4 | Will contain the k4 parameter. |
IlFloat IlvComposeFilter::getK1 | ( | ) | const |
Returns the k1 parameter of the Arithmetic operator.
IlFloat IlvComposeFilter::getK2 | ( | ) | const |
Returns the k2 parameter of the Arithmetic operator.
IlFloat IlvComposeFilter::getK3 | ( | ) | const |
Returns the k3 parameter of the Arithmetic operator.
IlFloat IlvComposeFilter::getK4 | ( | ) | const |
Returns the k4 parameter of the Arithmetic operator.
Operator IlvComposeFilter::getOperator | ( | ) | const |
Returns the compositing operator.
Sets the Arithmetic operator parameters.
k1 | The new k1 parameter. |
k2 | The new k2 parameter. |
k3 | The new k3 parameter. |
k4 | The new k4 parameter. |
void IlvComposeFilter::setK1 | ( | IlFloat | k1 | ) |
Sets the k1 parameter of the Arithmetic operator.
k1 | The new k1 parameter of the Arithmetic operator. |
void IlvComposeFilter::setK2 | ( | IlFloat | k2 | ) |
Sets the k2 parameter of the Arithmetic operator.
k2 | The new k2 parameter of the Arithmetic operator. |
void IlvComposeFilter::setK3 | ( | IlFloat | k3 | ) |
Sets the k3 parameter of the Arithmetic operator.
k3 | The new k3 parameter of the Arithmetic operator. |
void IlvComposeFilter::setK4 | ( | IlFloat | k4 | ) |
Sets the k4 parameter of the Arithmetic operator.
k4 | The new k4 parameter of the Arithmetic operator. |
void IlvComposeFilter::setOperator | ( | Operator | op | ) |
Sets the compositing operator.
op | The new compositing operator. |