Version: 9.12.0
ImageComposer_ColorMaskOperator Class Reference

Implementation of the color mask operator. More...

#include <ImageComposer_ColorMaskOperator.h>

Inheritance diagram for ImageComposer_ColorMaskOperator:
Inheritance graph

Public Member Functions

 ImageComposer_ColorMaskOperator ()
 Constructor. More...
 
virtual ~ImageComposer_ColorMaskOperator ()
 
void setArgs (const QColor &theRefColor, bool isMakeTransparent, int theRGBThreshold, int theAlphaThreshold)
 Set operator arguments. More...
 
virtual QString name () const
 Return name of the operator. More...
 
QStringList dumpArgsToPython (QString &theArrayName) const
 Dumps arguments of operator to python script representation. More...
 
- Public Member Functions inherited from ImageComposer_Operator
 ImageComposer_Operator ()
 Constructor. More...
 
virtual ~ImageComposer_Operator ()
 Destructor. More...
 
void getArgs (QColor &theBackground) const
 Get operator arguments. More...
 
void setArgs (const QColor &theBackground)
 Set operator arguments. More...
 
QByteArray getBinArgs () const
 Get the operator's arguments in the form of a binary array. More...
 
void setBinArgs (const QByteArray &)
 Set the operator's arguments in the form of a binary array. More...
 
QStringList dumpArgsToPython (QString &theArrayName) const
 Dumps arguments of operator to python script representation. More...
 
virtual ImageComposer_Image process (const QVariant &theObj1, const QVariant &theObj2) const
 Perform the composing of images. More...
 

Static Public Member Functions

static QString Type ()
 

Protected Member Functions

virtual QRectF calcResultBoundingRect (const QVariant &theObj1, const QVariant &theObj2) const
 Calculate bounding rectangle for the result image. More...
 
virtual void drawResult (QPainter &thePainter, const QVariant &theObj1, const QVariant &theObj2) const
 Draw result image using the given painter. More...
 
virtual void storeArgs (QDataStream &theStream) const
 Store the operator's arguments to the stream. More...
 
virtual void restoreArgs (QDataStream &theStream)
 Restore the operator's arguments from the stream. More...
 

Private Attributes

QColor myRefColor
 the color to the searched (the color for mask) More...
 
bool myIsMakeTransparent
 the boolean flag controlling if the pixels with matching color should be made transparent or one with non-matching color More...
 
int myRGBThreshold
 the threshold for RGB components More...
 
int myAlphaThreshold
 the threshold for Alpha component More...
 

Friends

class ImageComposerTests_TestOperators
 

Detailed Description

Implementation of the color mask operator.

Constructor & Destructor Documentation

◆ ImageComposer_ColorMaskOperator()

ImageComposer_ColorMaskOperator::ImageComposer_ColorMaskOperator ( )

Constructor.

◆ ~ImageComposer_ColorMaskOperator()

ImageComposer_ColorMaskOperator::~ImageComposer_ColorMaskOperator ( )
virtual

Member Function Documentation

◆ calcResultBoundingRect()

QRectF ImageComposer_ColorMaskOperator::calcResultBoundingRect ( const QVariant &  theObj1,
const QVariant &  theObj2 
) const
protectedvirtual

Calculate bounding rectangle for the result image.

Parameters
theObj1first object to calculate
theObj2second object to calculate
Returns
calculated bounding rectangle

Implements ImageComposer_Operator.

References ImageComposer_Image::boundingRect().

◆ drawResult()

void ImageComposer_ColorMaskOperator::drawResult ( QPainter &  thePainter,
const QVariant &  theObj1,
const QVariant &  theObj2 
) const
protectedvirtual

Draw result image using the given painter.

Parameters
thePainterthe painter on the result image
theObj1the first object to compose
theObj2the second object to compose

Implements ImageComposer_Operator.

References ImageComposer_Image::draw(), myAlphaThreshold, myIsMakeTransparent, myRefColor, myRGBThreshold, ImageComposer_Image::setTransform(), ImageComposer_Image::transform(), and TRANSPARENT().

◆ dumpArgsToPython()

QStringList ImageComposer_ColorMaskOperator::dumpArgsToPython ( QString &  theArrayName) const

Dumps arguments of operator to python script representation.

Parameters
theArrayNamename of result QByteArray array variable
Returns
list of strings with python representation

References ImageComposer_Operator::dumpArgsToPython(), myAlphaThreshold, myIsMakeTransparent, myRefColor, and myRGBThreshold.

◆ name()

QString ImageComposer_ColorMaskOperator::name ( ) const
virtual

Return name of the operator.

Returns
name of the operator

Implements ImageComposer_Operator.

References Type().

◆ restoreArgs()

void ImageComposer_ColorMaskOperator::restoreArgs ( QDataStream &  theStream)
protectedvirtual

Restore the operator's arguments from the stream.

Parameters
theStreamthe stream for restoring

Reimplemented from ImageComposer_Operator.

References myAlphaThreshold, myIsMakeTransparent, myRefColor, myRGBThreshold, and ImageComposer_Operator::restoreArgs().

◆ setArgs()

void ImageComposer_ColorMaskOperator::setArgs ( const QColor &  theRefColor,
bool  isMakeTransparent,
int  theRGBThreshold,
int  theAlphaThreshold 
)

Set operator arguments.

Parameters
theRefColorthe color to the searched (the color for mask)
isMakeTransparentthe boolean flag controlling if the pixels with matching color should be made transparent or one with non-matching color
theRGBThresholdthe threshold for RGB components
theAlphaThresholdthe threshold for Alpha component

References myAlphaThreshold, myIsMakeTransparent, myRefColor, and myRGBThreshold.

◆ storeArgs()

void ImageComposer_ColorMaskOperator::storeArgs ( QDataStream &  theStream) const
protectedvirtual

Store the operator's arguments to the stream.

Parameters
theStreamthe stream for storing

Reimplemented from ImageComposer_Operator.

References myAlphaThreshold, myIsMakeTransparent, myRefColor, myRGBThreshold, and ImageComposer_Operator::storeArgs().

◆ Type()

static QString ImageComposer_ColorMaskOperator::Type ( )
inlinestatic

Friends And Related Function Documentation

◆ ImageComposerTests_TestOperators

friend class ImageComposerTests_TestOperators
friend

Member Data Documentation

◆ myAlphaThreshold

int ImageComposer_ColorMaskOperator::myAlphaThreshold
private

the threshold for Alpha component

◆ myIsMakeTransparent

bool ImageComposer_ColorMaskOperator::myIsMakeTransparent
private

the boolean flag controlling if the pixels with matching color should be made transparent or one with non-matching color

◆ myRefColor

QColor ImageComposer_ColorMaskOperator::myRefColor
private

the color to the searched (the color for mask)

◆ myRGBThreshold

int ImageComposer_ColorMaskOperator::myRGBThreshold
private

the threshold for RGB components


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