| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/image/imagepixelop.h>
Public Types | |
| enum | Operation { SetValue, AddValue, SubValue, SetScaledValue, AddScaledValue, SubScaledValue, MultValue, SquareValue, GammaValue, AndValue, OrValue, XOrValue, NotValue, LShiftValue, ShiftValue, Filter, ColorFilter, AlphaFilter, Threshold, Add } |
Public Member Functions | |
| VRS_SERIALIZABLE_CLASS_ENUM (Operation) | |
| ImagePixelOp (int opType, double value) | |
| void | setOperation (int opType) |
| int | getOperation () const |
| Sets/returns the operation type of the pixel-operation object. | |
| void | setValue (double value) |
| double | getValue () const |
| void | setFilterCallback (Callback2< void *, void * > *cb) |
| Callback2< void *, void * > * | getFilterCallback () const |
| void | setReferenceColor (const Color &c) |
| Color | getReferenceColor () const |
| void | setSubstituteColor (const Color &c) |
| Color | getSubsituteColor () const |
| void | setAlpha (double alpha) |
| double | getAlpha () const |
| void | setTolerance (double t) |
| double | getTolerance () const |
| virtual Image * | manipulate (Image *source, Image *target) |
| virtual bool | operatesInPlace () const |
| VRS_TYPEINFO (ImagePixelOp, ImageManipulator) | |
Static Public Member Functions | |
| static void | setValue (Image *srcImage, Image *dstImage, double value) |
| static void | addValue (Image *srcImage, Image *dstImage, double value) |
| static void | subValue (Image *srcImage, Image *dstImage, double value) |
| static void | setScaledValue (Image *srcImage, Image *dstImage, double clamped) |
| static void | addScaledValue (Image *srcImage, Image *dstImage, double clamped) |
| static void | subScaledValue (Image *srcImage, Image *dstImage, double clamped) |
| static void | multValue (Image *srcImage, Image *dstImage, double value) |
| static void | squareValue (Image *srcImage, Image *dstImage) |
| static void | gammaValue (Image *srcImage, Image *dstImage, double value) |
| static void | andValue (Image *srcImage, Image *dstImage, double value) |
| static void | orValue (Image *srcImage, Image *dstImage, double value) |
| static void | xorValue (Image *srcImage, Image *dstImage, double value) |
| static void | notValue (Image *srcImage, Image *dstImage) |
| static void | lshiftValue (Image *srcImage, Image *dstImage, double value) |
| static void | rshiftValue (Image *srcImage, Image *dstImage, double value) |
| static void | add (Image *srcImage, Image *dstImage) |
| static void | threshold (Image *srcImage, Image *dstImage, double value) |
| static void | filter (Image *srcI, Image *dstI, Callback2< void *, void * > *callback) |
| static void | colorFilter (Image *srcI, Image *dstI, const Color &refColor, const Color &subsColor, double tolerance=0.0) |
| static void | alphaFilter (Image *srcI, Image *dstI, const Color &refColor, double alphaValue, double tolerance=0.0) |
| VRS::ImagePixelOp::ImagePixelOp | ( | int | opType, | |
| double | value | |||
| ) |
A pixel-operation object encapsulate one pixel-operation applied to a source image. Most operation types require one parameter, the value, which can be set separately. The pixel-operation object can form part of an operation seuquence, e.g., ManipulatorList. All operations are accessible also as static methods which can be invoked directly. The Image class contains methods which access the pixel oerations in a more convienent way.
| VRS::ImagePixelOp::VRS_SERIALIZABLE_CLASS_ENUM | ( | Operation | ) |
| void VRS::ImagePixelOp::setOperation | ( | int | opType | ) |
| int VRS::ImagePixelOp::getOperation | ( | ) | const |
Sets/returns the operation type of the pixel-operation object.
| static void VRS::ImagePixelOp::setValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::addValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::subValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::setScaledValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | clamped | |||
| ) | [static] |
| static void VRS::ImagePixelOp::addScaledValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | clamped | |||
| ) | [static] |
| static void VRS::ImagePixelOp::subScaledValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | clamped | |||
| ) | [static] |
| static void VRS::ImagePixelOp::multValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::gammaValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::andValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::orValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::xorValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::lshiftValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::rshiftValue | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| static void VRS::ImagePixelOp::threshold | ( | Image * | srcImage, | |
| Image * | dstImage, | |||
| double | value | |||
| ) | [static] |
| void VRS::ImagePixelOp::setValue | ( | double | value | ) |
| double VRS::ImagePixelOp::getValue | ( | ) | const |
Sets/returns the parameter value used by the operation. The notValue and squareValue operations do not use the value. Also the filter operations do use their own paramters, see below.
| static void VRS::ImagePixelOp::filter | ( | Image * | srcI, | |
| Image * | dstI, | |||
| Callback2< void *, void * > * | callback | |||
| ) | [static] |
| void VRS::ImagePixelOp::setFilterCallback | ( | Callback2< void *, void * > * | cb | ) |
| Callback2<void*,void*>* VRS::ImagePixelOp::getFilterCallback | ( | ) | const |
Calls the given callback for all pixels of the region of interest. For simplicity, the data type is casted to void*. The callback must know the actual data type of the image.
| static void VRS::ImagePixelOp::colorFilter | ( | Image * | srcI, | |
| Image * | dstI, | |||
| const Color & | refColor, | |||
| const Color & | subsColor, | |||
| double | tolerance = 0.0 | |||
| ) | [static] |
| static void VRS::ImagePixelOp::alphaFilter | ( | Image * | srcI, | |
| Image * | dstI, | |||
| const Color & | refColor, | |||
| double | alphaValue, | |||
| double | tolerance = 0.0 | |||
| ) | [static] |
The color filter replaces all pixel with the reference color by the substitution color. Pixel values are replaced if their color is within the given tolerance. The filtering is restricted to the current region of interest.
| void VRS::ImagePixelOp::setReferenceColor | ( | const Color & | c | ) |
| Color VRS::ImagePixelOp::getReferenceColor | ( | ) | const |
| void VRS::ImagePixelOp::setSubstituteColor | ( | const Color & | c | ) |
| Color VRS::ImagePixelOp::getSubsituteColor | ( | ) | const |
| void VRS::ImagePixelOp::setAlpha | ( | double | alpha | ) |
| double VRS::ImagePixelOp::getAlpha | ( | ) | const |
| void VRS::ImagePixelOp::setTolerance | ( | double | t | ) |
| double VRS::ImagePixelOp::getTolerance | ( | ) | const |
The image operation is apply to the source image and the the resulting image is stored in the target image. The handle of the target image is returned.
Implements VRS::ImageManipulator.
| virtual bool VRS::ImagePixelOp::operatesInPlace | ( | ) | const [virtual] |
See `ImageManipulator'. This manipulator can operate in place.
Reimplemented from VRS::ImageManipulator.
| VRS::ImagePixelOp::VRS_TYPEINFO | ( | ImagePixelOp | , | |
| ImageManipulator | ||||
| ) |