#include <kis_abstract_colorspace.h>
Public Member Functions | |
| KisAbstractColorSpace (const KisID &id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisColorSpaceFactoryRegistry *parent, KisProfile *profile) | |
| void | init () |
| virtual bool | operator== (const KisAbstractColorSpace &rhs) const |
| virtual TQValueVector< KisChannelInfo * > | channels () const =0 |
| virtual TQ_UINT32 | nChannels () const =0 |
| virtual TQ_UINT32 | nColorChannels () const =0 |
| virtual TQ_UINT32 | nSubstanceChannels () const |
| virtual TQ_UINT32 | pixelSize () const =0 |
| virtual TQString | channelValueText (const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const =0 |
| virtual TQString | normalisedChannelValueText (const TQ_UINT8 *pixel, TQ_UINT32 channelIndex) const =0 |
| virtual TQ_UINT8 | scaleToU8 (const TQ_UINT8 *srcPixel, TQ_INT32 channelPos)=0 |
| virtual TQ_UINT16 | scaleToU16 (const TQ_UINT8 *srcPixel, TQ_INT32 channelPos)=0 |
| virtual void | getSingleChannelPixel (TQ_UINT8 *dstPixel, const TQ_UINT8 *srcPixel, TQ_UINT32 channelIndex) |
| virtual KisID | id () const |
| void | setColorSpaceType (TQ_UINT32 type) |
| TQ_UINT32 | colorSpaceType () |
| virtual icColorSpaceSignature | colorSpaceSignature () |
| virtual KisCompositeOpList | userVisiblecompositeOps () const =0 |
| virtual bool | hasHighDynamicRange () const |
| virtual KisProfile * | getProfile () const |
| virtual void | fromTQColor (const TQColor &c, TQ_UINT8 *dst, KisProfile *profile=0) |
| virtual void | fromTQColor (const TQColor &c, TQ_UINT8 opacity, TQ_UINT8 *dst, KisProfile *profile=0) |
| virtual void | toTQColor (const TQ_UINT8 *src, TQColor *c, KisProfile *profile=0) |
| virtual void | toTQColor (const TQ_UINT8 *src, TQColor *c, TQ_UINT8 *opacity, KisProfile *profile=0) |
| virtual void | toLabA16 (const TQ_UINT8 *src, TQ_UINT8 *dst, const TQ_UINT32 nPixels) const |
| virtual void | fromLabA16 (const TQ_UINT8 *src, TQ_UINT8 *dst, const TQ_UINT32 nPixels) const |
| virtual TQImage | convertToTQImage (const TQ_UINT8 *data, TQ_INT32 width, TQ_INT32 height, KisProfile *dstProfile, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL, float exposure=0.0f) |
| virtual bool | convertPixelsTo (const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorSpace *dstColorSpace, TQ_UINT32 numPixels, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL) |
| virtual KisColorAdjustment * | createBrightnessContrastAdjustment (TQ_UINT16 *transferValues) |
| virtual KisColorAdjustment * | createDesaturateAdjustment () |
| virtual KisColorAdjustment * | createPerChannelAdjustment (TQ_UINT16 **transferValues) |
| virtual void | applyAdjustment (const TQ_UINT8 *src, TQ_UINT8 *dst, KisColorAdjustment *, TQ_INT32 nPixels) |
| virtual void | invertColor (TQ_UINT8 *src, TQ_INT32 nPixels) |
| virtual TQ_UINT8 | difference (const TQ_UINT8 *src1, const TQ_UINT8 *src2) |
| virtual void | mixColors (const TQ_UINT8 **colors, const TQ_UINT8 *weights, TQ_UINT32 nColors, TQ_UINT8 *dst) const |
| virtual void | convolveColors (TQ_UINT8 **colors, TQ_INT32 *kernelValues, KisChannelInfo::enumChannelFlags channelFlags, TQ_UINT8 *dst, TQ_INT32 factor, TQ_INT32 offset, TQ_INT32 nPixels) const |
| virtual void | darken (const TQ_UINT8 *src, TQ_UINT8 *dst, TQ_INT32 shade, bool compensate, double compensation, TQ_INT32 nPixels) const |
| virtual TQ_UINT8 | intensity8 (const TQ_UINT8 *src) const |
| virtual KisID | mathToolboxID () const |
| virtual void | bitBlt (TQ_UINT8 *dst, TQ_INT32 dststride, KisColorSpace *srcSpace, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *srcAlphaMask, TQ_INT32 maskRowStride, TQ_UINT8 opacity, TQ_INT32 rows, TQ_INT32 cols, const KisCompositeOp &op) |
| Public Member Functions inherited from KisColorSpace | |
| virtual DCOPObject * | dcopObject () |
| virtual bool | operator== (const KisColorSpace &rhs) const |
| virtual bool | willDegrade (ColorSpaceIndependence independence)=0 |
| virtual TQ_UINT8 | getAlpha (const TQ_UINT8 *pixel) const =0 |
| virtual void | setAlpha (TQ_UINT8 *pixels, TQ_UINT8 alpha, TQ_INT32 nPixels) const =0 |
| virtual void | multiplyAlpha (TQ_UINT8 *pixels, TQ_UINT8 alpha, TQ_INT32 nPixels)=0 |
| virtual void | applyAlphaU8Mask (TQ_UINT8 *pixels, TQ_UINT8 *alpha, TQ_INT32 nPixels)=0 |
| virtual void | applyInverseAlphaU8Mask (TQ_UINT8 *pixels, TQ_UINT8 *alpha, TQ_INT32 nPixels)=0 |
| virtual TQValueList< KisFilter * > | createBackgroundFilters () |
Protected Member Functions | |
| virtual void | bitBlt (TQ_UINT8 *dst, TQ_INT32 dstRowSize, const TQ_UINT8 *src, TQ_INT32 srcRowStride, const TQ_UINT8 *srcAlphaMask, TQ_INT32 maskRowStride, TQ_UINT8 opacity, TQ_INT32 rows, TQ_INT32 cols, const KisCompositeOp &op)=0 |
| virtual cmsHTRANSFORM | createTransform (KisColorSpace *dstColorSpace, KisProfile *srcProfile, KisProfile *dstProfile, TQ_INT32 renderingIntent) |
| virtual void | compositeCopy (TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *maskRowStart, TQ_INT32 maskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 opacity) |
| template<typename ColorType, typename NativeMult, typename Uint8ToNative, typename NativeOpacityTest, int AlphaPos, int NonAlphaSize, int TotalSize> | |
| void | abstractCompositeAlphaDarken (TQ_UINT8 *dstRowStart, TQ_INT32 dstRowStride, const TQ_UINT8 *srcRowStart, TQ_INT32 srcRowStride, const TQ_UINT8 *maskRowStart, TQ_INT32 maskRowStride, TQ_INT32 rows, TQ_INT32 numColumns, TQ_UINT8 opacity, NativeMult nativeMult, Uint8ToNative uint8ToNative, NativeOpacityTest nativeOpacityTest) |
Protected Attributes | |
| TQStringList | m_profileFilenames |
| TQ_UINT8 * | m_qcolordata |
| TQ_INT32 | m_alphaPos |
| TQ_INT32 | m_alphaSize |
| TQValueVector< KisChannelInfo * > | m_channels |
| KisColorSpaceFactoryRegistry * | m_parent |
Detailed Description
A colorspace strategy is the definition of a certain color model in Chalk.
Definition at line 47 of file kis_abstract_colorspace.h.
Constructor & Destructor Documentation
◆ KisAbstractColorSpace()
| KisAbstractColorSpace::KisAbstractColorSpace | ( | const KisID & | id, |
| DWORD | cmType, | ||
| icColorSpaceSignature | colorSpaceSignature, | ||
| KisColorSpaceFactoryRegistry * | parent, | ||
| KisProfile * | profile ) |
- Parameters
-
id The unique human and machine readable identifiation of this colorspace cmType the lcms type indentification for this colorspace, may be 0 colorSpaceSignature the icc identification for this colorspace, may be 0 parent the registry that owns this instance profile the profile this colorspace uses for transforms
Definition at line 63 of file kis_abstract_colorspace.cpp.
◆ ~KisAbstractColorSpace()
|
virtual |
Definition at line 116 of file kis_abstract_colorspace.cpp.
Member Function Documentation
◆ abstractCompositeAlphaDarken()
|
inlineprotected |
Definition at line 222 of file kis_abstract_colorspace.h.
◆ applyAdjustment()
|
virtual |
Apply the adjustment created with onr of the other functions.
Implements KisColorSpace.
Definition at line 422 of file kis_abstract_colorspace.cpp.
◆ bitBlt() [1/2]
|
protectedpure virtual |
Compose two byte arrays containing pixels in the same color model together.
◆ bitBlt() [2/2]
|
virtual |
Compose two arrays of pixels together.
If source and target are not the same colour model, the source pixels will be converted to the target model.
Implements KisColorSpace.
Definition at line 635 of file kis_abstract_colorspace.cpp.
◆ channels()
|
pure virtual |
Return a vector describing all the channels this color model has.
Implements KisColorSpace.
◆ channelValueText()
|
pure virtual |
Return a string with the channel's value suitable for display in the gui.
Implements KisColorSpace.
Implemented in KisU16BaseColorSpace, and KisU8BaseColorSpace.
◆ colorSpaceSignature()
|
inlinevirtual |
Implements KisColorSpace.
Definition at line 109 of file kis_abstract_colorspace.h.
◆ colorSpaceType()
|
inlinevirtual |
lcms colorspace type definition.
Implements KisColorSpace.
Definition at line 107 of file kis_abstract_colorspace.h.
◆ compositeCopy()
|
protectedvirtual |
Definition at line 744 of file kis_abstract_colorspace.cpp.
◆ convertPixelsTo()
|
virtual |
Convert a byte array of srcLen pixels *src to the specified color space and put the converted bytes into the prepared byte array *dst.
Returns false if the conversion failed, true if it succeeded
Implements KisColorSpace.
Definition at line 206 of file kis_abstract_colorspace.cpp.
◆ convertToTQImage()
|
virtual |
Convert the pixels in data to (8-bit BGRA) TQImage using the specified profiles.
The pixels are supposed to be encoded in this color model. The default implementation will convert the pixels using either the profiles or the default profiles for the current colorstrategy and the RGBA colorstrategy. If that is not what you want, or if you think you can do better than lcms, reimplement this methods.
- Parameters
-
data A pointer to a contiguous memory region containing width * height pixels width in pixels height in pixels dstProfile destination profile renderingIntent the rendering intent exposure The exposure setting for rendering a preview of a high dynamic range image.
Implements KisColorSpace.
Definition at line 695 of file kis_abstract_colorspace.cpp.
◆ convolveColors()
|
virtual |
Convolve the given array of pointers to pixels and return the result in dst.
The kernel values are clamped between -128 and 128
Implements KisColorSpace.
Definition at line 530 of file kis_abstract_colorspace.cpp.
◆ createBrightnessContrastAdjustment()
|
virtual |
Create an adjustment object for adjusting the brightness and contrast transferValues is a 256 bins array with values from 0 to 0xFFFF.
Implements KisColorSpace.
Definition at line 289 of file kis_abstract_colorspace.cpp.
◆ createDesaturateAdjustment()
|
virtual |
Create an adjustment object for desaturating.
Implements KisColorSpace.
Definition at line 341 of file kis_abstract_colorspace.cpp.
◆ createPerChannelAdjustment()
|
virtual |
Create an adjustment object for adjusting individual channels transferValues is an array of nColorChannels number of 256 bins array with values from 0 to 0xFFFF.
Implements KisColorSpace.
Definition at line 396 of file kis_abstract_colorspace.cpp.
◆ createTransform()
|
protectedvirtual |
Definition at line 717 of file kis_abstract_colorspace.cpp.
◆ darken()
|
virtual |
Darken all color channels with the given amount.
If compensate is true, the compensation factor will be used to limit the darkening.
(See the bumpmap filter)
Implements KisColorSpace.
Definition at line 571 of file kis_abstract_colorspace.cpp.
◆ difference()
|
virtual |
Get the difference between 2 colors, normalized in the range (0,255).
Implements KisColorSpace.
Definition at line 446 of file kis_abstract_colorspace.cpp.
◆ fromLabA16()
|
virtual |
Convert the specified data from Lab.
to this colorspace. All colorspaces are guaranteed to support this.
- Parameters
-
src the pixels in 16 bit lab format dst the destination data nPixels the number of pixels in the array
Implements KisColorSpace.
Definition at line 187 of file kis_abstract_colorspace.cpp.
◆ fromTQColor() [1/2]
|
virtual |
The fromTQColor methods take a given color defined as an RGB TQColor and fills a byte array with the corresponding color in the the colorspace managed by this strategy.
- Parameters
-
c the TQColor that will be used to fill dst dst a pointer to a pixel profile the optional profile that describes the color values of TQColor
Implements KisColorSpace.
Definition at line 122 of file kis_abstract_colorspace.cpp.
◆ fromTQColor() [2/2]
|
virtual |
The fromTQColor methods take a given color defined as an RGB TQColor and fills a byte array with the corresponding color in the the colorspace managed by this strategy.
- Parameters
-
c the TQColor that will be used to fill dst opacity the opacity of the color dst a pointer to a pixel profile the optional profile that describes the color values of TQColor
Implements KisColorSpace.
Definition at line 149 of file kis_abstract_colorspace.cpp.
◆ getProfile()
|
inlinevirtual |
Return the profile of this color space.
This may be 0
Implements KisColorSpace.
Definition at line 123 of file kis_abstract_colorspace.h.
◆ getSingleChannelPixel()
|
virtual |
Set dstPixel to the pixel containing only the given channel of srcPixel.
The remaining channels should be set to whatever makes sense for 'empty' channels of this colour space, with the intent being that the pixel should look like it only has the given channel.
Implements KisColorSpace.
Definition at line 195 of file kis_abstract_colorspace.cpp.
◆ hasHighDynamicRange()
|
inlinevirtual |
Returns true if the colorspace supports channel values outside the (normalised) range 0 to 1.
Implements KisColorSpace.
Definition at line 119 of file kis_abstract_colorspace.h.
◆ id()
|
inlinevirtual |
Chalk definition for use in .kra files and internally: unchanging name + i18n'able description.
Implements KisColorSpace.
Definition at line 104 of file kis_abstract_colorspace.h.
◆ init()
| void KisAbstractColorSpace::init | ( | ) |
Definition at line 88 of file kis_abstract_colorspace.cpp.
◆ intensity8()
|
virtual |
Calculate the intensity of the given pixel, scaled down to the range 0-255.
XXX: Maybe this should be more flexible
Implements KisColorSpace.
Definition at line 620 of file kis_abstract_colorspace.cpp.
◆ invertColor()
|
virtual |
Invert color channels of the given pixels.
Implements KisColorSpace.
Definition at line 430 of file kis_abstract_colorspace.cpp.
◆ mathToolboxID()
|
virtual |
Create a mathematical toolbox compatible with this colorspace.
Implements KisColorSpace.
Definition at line 630 of file kis_abstract_colorspace.cpp.
◆ mixColors()
|
virtual |
Mix the colors given their weights and return in dst The sum of weights is assumed 255.
Implements KisColorSpace.
Definition at line 482 of file kis_abstract_colorspace.cpp.
◆ nChannels()
|
pure virtual |
The total number of channels for a single pixel in this color model.
Implements KisColorSpace.
◆ nColorChannels()
|
pure virtual |
The total number of color channels (excludes alpha and substance) for a single pixel in this color model.
Implements KisColorSpace.
◆ normalisedChannelValueText()
|
pure virtual |
Return a string with the channel's value with integer channels normalised to the floating point range 0 to 1, if appropriate.
Implements KisColorSpace.
Implemented in KisU16BaseColorSpace, and KisU8BaseColorSpace.
◆ nSubstanceChannels()
|
inlinevirtual |
The total number of substance channels for a single pixel in this color model.
Reimplemented from KisColorSpace.
Definition at line 88 of file kis_abstract_colorspace.h.
◆ operator==()
|
inlinevirtual |
Definition at line 69 of file kis_abstract_colorspace.h.
◆ pixelSize()
|
pure virtual |
The size in bytes of a single pixel in this color model.
Implements KisColorSpace.
◆ scaleToU16()
|
pure virtual |
Convert the value of the channel at the specified position into a 16-bit value.
This may be upscaling or downscaling, depending on the defined value of the channel
Implements KisColorSpace.
Implemented in KisU16BaseColorSpace, and KisU8BaseColorSpace.
◆ scaleToU8()
|
pure virtual |
Convert the value of the channel at the specified position into an 8-bit value.
The position is not the number of bytes, but the position of the channel as defined in the channel info list.
Implements KisColorSpace.
Implemented in KisU16BaseColorSpace, and KisU8BaseColorSpace.
◆ setColorSpaceType()
|
inline |
Definition at line 106 of file kis_abstract_colorspace.h.
◆ toLabA16()
|
virtual |
Convert the specified data to Lab.
All colorspaces are guaranteed to support this
- Parameters
-
src the source data dst the destination data nPixels the number of source pixels
Implements KisColorSpace.
Definition at line 180 of file kis_abstract_colorspace.cpp.
◆ toTQColor() [1/2]
|
virtual |
The toTQColor methods take a byte array that is at least pixelSize() long and converts the contents to a TQColor, using the given profile as a source profile and the optional profile as a destination profile.
- Parameters
-
src a pointer to the source pixel c the TQColor that will be filled with the color at src profile the optional profile that describes the color in c, for instance the monitor profile
Implements KisColorSpace.
Definition at line 155 of file kis_abstract_colorspace.cpp.
◆ toTQColor() [2/2]
|
virtual |
The toTQColor methods take a byte array that is at least pixelSize() long and converts the contents to a TQColor, using the given profile as a source profile and the option profile as a destination profile.
- Parameters
-
src a pointer to the source pixel c the TQColor that will be filled with the color at src opacity a pointer to a byte that will be filled with the opacity a src profile the optional profile that describes the color in c, for instance the monitor profile
Implements KisColorSpace.
Definition at line 174 of file kis_abstract_colorspace.cpp.
◆ userVisiblecompositeOps()
|
pure virtual |
Returns the list of user-visible composite ops supported by this colourspace.
Internal ops such as COPY, CLEAR, and ERASE, are not included as these make no sense for layers in the full image model.
Implements KisColorSpace.
Member Data Documentation
◆ m_alphaPos
|
protected |
Definition at line 275 of file kis_abstract_colorspace.h.
◆ m_alphaSize
|
protected |
Definition at line 276 of file kis_abstract_colorspace.h.
◆ m_channels
|
protected |
Definition at line 278 of file kis_abstract_colorspace.h.
◆ m_parent
|
protected |
Definition at line 280 of file kis_abstract_colorspace.h.
◆ m_profileFilenames
|
protected |
Definition at line 273 of file kis_abstract_colorspace.h.
◆ m_qcolordata
|
protected |
Definition at line 274 of file kis_abstract_colorspace.h.
The documentation for this class was generated from the following files:
