krita

KisU16BaseColorSpace Class Reference

#include <kis_u16_base_colorspace.h>

Inheritance diagram for KisU16BaseColorSpace:

KisAbstractColorSpace KisColorSpace

List of all members.


Detailed Description

This is the base class for 16-bit/channel colorspaces with 16-bit alpha channels.

It defines a number of common methods, like handling 16-bit alpha and up- and down-scaling of channels.

Definition at line 30 of file kis_u16_base_colorspace.h.


Public Member Functions

 KisU16BaseColorSpace (const KisID &id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisColorSpaceFactoryRegistry *parent, KisProfile *p)
virtual Q_UINT8 getAlpha (const Q_UINT8 *pixel) const
virtual void setAlpha (Q_UINT8 *pixels, Q_UINT8 alpha, Q_INT32 nPixels) const
virtual void multiplyAlpha (Q_UINT8 *pixels, Q_UINT8 alpha, Q_INT32 nPixels)
virtual void applyAlphaU8Mask (Q_UINT8 *pixels, Q_UINT8 *alpha, Q_INT32 nPixels)
virtual void applyInverseAlphaU8Mask (Q_UINT8 *pixels, Q_UINT8 *alpha, Q_INT32 nPixels)
virtual QString channelValueText (const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
virtual QString normalisedChannelValueText (const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
virtual Q_UINT8 scaleToU8 (const Q_UINT8 *srcPixel, Q_INT32 channelPos)
virtual Q_UINT16 scaleToU16 (const Q_UINT8 *srcPixel, Q_INT32 channelPos)

Static Public Attributes

static const Q_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX
static const Q_UINT16 U16_OPACITY_TRANSPARENT = UINT16_MIN

Member Function Documentation

Q_UINT8 KisU16BaseColorSpace::getAlpha ( const Q_UINT8 *  pixel  )  const [virtual]

Get the alpha value of the given pixel, downscaled to an 8-bit value.

Implements KisColorSpace.

Definition at line 26 of file kis_u16_base_colorspace.cc.

void KisU16BaseColorSpace::setAlpha ( Q_UINT8 *  pixels,
Q_UINT8  alpha,
Q_INT32  nPixels 
) const [virtual]

Set the alpha channel of the given run of pixels to the given value.

pixels -- a pointer to the pixels that will have their alpha set to this value alpha -- a downscaled 8-bit value for opacity nPixels -- the number of pixels

Implements KisColorSpace.

Definition at line 37 of file kis_u16_base_colorspace.cc.

void KisU16BaseColorSpace::multiplyAlpha ( Q_UINT8 *  pixels,
Q_UINT8  alpha,
Q_INT32  nPixels 
) [virtual]

Multiply the alpha channel of the given run of pixels by the given value.

pixels -- a pointer to the pixels that will have their alpha set to this value alpha -- a downscaled 8-bit value for opacity nPixels -- the number of pixels

Implements KisColorSpace.

Definition at line 53 of file kis_u16_base_colorspace.cc.

void KisU16BaseColorSpace::applyAlphaU8Mask ( Q_UINT8 *  pixels,
Q_UINT8 *  alpha,
Q_INT32  nPixels 
) [virtual]

Applies the specified 8-bit alpha mask to the pixels.

We assume that there are just as many alpha values as pixels but we do not check this; the alpha values are assumed to be 8-bits.

Implements KisColorSpace.

Definition at line 70 of file kis_u16_base_colorspace.cc.

void KisU16BaseColorSpace::applyInverseAlphaU8Mask ( Q_UINT8 *  pixels,
Q_UINT8 *  alpha,
Q_INT32  nPixels 
) [virtual]

Applies the inverted 8-bit alpha mask to the pixels.

We assume that there are just as many alpha values as pixels but we do not check this; the alpha values are assumed to be 8-bits.

Implements KisColorSpace.

Definition at line 90 of file kis_u16_base_colorspace.cc.

QString KisU16BaseColorSpace::channelValueText ( const Q_UINT8 *  pixel,
Q_UINT32  channelIndex 
) const [virtual]

Return a string with the channel's value suitable for display in the gui.

Implements KisAbstractColorSpace.

Definition at line 119 of file kis_u16_base_colorspace.cc.

QString KisU16BaseColorSpace::normalisedChannelValueText ( const Q_UINT8 *  pixel,
Q_UINT32  channelIndex 
) const [virtual]

Return a string with the channel's value with integer channels normalised to the floating point range 0 to 1, if appropriate.

Implements KisAbstractColorSpace.

Definition at line 128 of file kis_u16_base_colorspace.cc.

Q_UINT8 KisU16BaseColorSpace::scaleToU8 ( const Q_UINT8 *  srcPixel,
Q_INT32  channelPos 
) [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 KisAbstractColorSpace.

Definition at line 137 of file kis_u16_base_colorspace.cc.

Q_UINT16 KisU16BaseColorSpace::scaleToU16 ( const Q_UINT8 *  srcPixel,
Q_INT32  channelPos 
) [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 KisAbstractColorSpace.

Definition at line 143 of file kis_u16_base_colorspace.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys