Krita Source Code Documentation
Loading...
Searching...
No Matches
KoYCbCrTraits< _channels_type_ > Struct Template Reference

#include <KoYcbcrColorSpaceTraits.h>

+ Inheritance diagram for KoYCbCrTraits< _channels_type_ >:

Classes

struct  Pixel
 

Public Types

typedef _channels_type_ channels_type
 
typedef KoColorSpaceTrait< _channels_type_, 4, 3 > parent
 
- Public Types inherited from KoColorSpaceTrait< _channels_type_, 4, 3 >
typedef _channels_type_ channels_type
 the type of the value of the channels of this color space
 
typedef KoColorSpaceMathsTraits< _channels_type_ > math_trait
 the associated math class
 

Static Public Member Functions

static channels_type Cb (quint8 *data)
 
static channels_type Cr (quint8 *data)
 
static void setCb (quint8 *data, channels_type nv)
 Set the Cb component.
 
static void setCr (quint8 *data, channels_type nv)
 Set the Cr component.
 
static void setY (quint8 *data, channels_type nv)
 Set the Y component.
 
static channels_type Y (quint8 *data)
 
- Static Public Member Functions inherited from KoColorSpaceTrait< _channels_type_, 4, 3 >
static quint8 * allocate (quint32 nPixels)
 
static void applyAlphaNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels)
 
static void applyAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels)
 
static void applyInverseAlphaNormedFloatMask (quint8 *pixels, const float *alpha, qint32 nPixels)
 
static void applyInverseAlphaU8Mask (quint8 *pixels, const quint8 *alpha, qint32 nPixels)
 
static QString channelValueText (const quint8 *pixel, quint32 channelIndex)
 
static void copyOpacityU8 (quint8 *src, quint8 *dst, qint32 nPixels)
 
static void fillGrayBrushWithColor (quint8 *pixels, const QRgb *brush, quint8 *brushColor, qint32 nPixels)
 
static void fillInverseAlphaNormedFloatMaskWithColor (quint8 *pixels, const float *alpha, const quint8 *brushColor, qint32 nPixels)
 
static void fromNormalisedChannelsValue (quint8 *pixel, const QVector< float > &values)
 
static void fromNormalisedChannelsValueImpl (quint8 *pixel, const QVector< float > &values)
 
static void fromNormalisedChannelsValueImpl (quint8 *pixel, const QVector< float > &values)
 
static void multiplyAlpha (quint8 *pixels, quint8 alpha, qint32 nPixels)
 
static const channels_typenativeArray (const quint8 *a)
 
static channels_typenativeArray (quint8 *a)
 
static void normalisedChannelsValue (const quint8 *pixel, QVector< float > &v)
 
static void normalisedChannelsValueImpl (const quint8 *pixel, QVector< float > &v)
 
static void normalisedChannelsValueImpl (const quint8 *pixel, QVector< float > &v)
 
static QString normalisedChannelValueText (const quint8 *pixel, quint32 channelIndex)
 
static qreal opacityF (const quint8 *U8_pixel)
 
static quint8 opacityU8 (const quint8 *U8_pixel)
 
static void setOpacity (quint8 *pixels, qreal alpha, qint32 nPixels)
 
static void setOpacity (quint8 *pixels, quint8 alpha, qint32 nPixels)
 
static void singleChannelPixel (quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex)
 

Static Public Attributes

static const qint32 Cb_pos = 1
 
static const qint32 Cr_pos = 2
 
static const qint32 Y_pos = 0
 
- Static Public Attributes inherited from KoColorSpaceTrait< _channels_type_, 4, 3 >
static const qint32 alpha_pos
 
static const quint32 channels_nb
 the number of channels in this color space
 
static const int depth
 the number of bit for each channel
 
static const quint32 pixelSize
 

Detailed Description

template<typename _channels_type_>
struct KoYCbCrTraits< _channels_type_ >

YCbCr traits, it provides some convenient functions to access YCbCr channels through an explicit API.

Definition at line 15 of file KoYcbcrColorSpaceTraits.h.

Member Typedef Documentation

◆ channels_type

template<typename _channels_type_ >
typedef _channels_type_ KoYCbCrTraits< _channels_type_ >::channels_type

Definition at line 17 of file KoYcbcrColorSpaceTraits.h.

◆ parent

template<typename _channels_type_ >
typedef KoColorSpaceTrait<_channels_type_, 4, 3> KoYCbCrTraits< _channels_type_ >::parent

Definition at line 18 of file KoYcbcrColorSpaceTraits.h.

Member Function Documentation

◆ Cb()

template<typename _channels_type_ >
static channels_type KoYCbCrTraits< _channels_type_ >::Cb ( quint8 * data)
inlinestatic
Returns
the Cb component

Definition at line 45 of file KoYcbcrColorSpaceTraits.h.

45 {
47 return d[Cb_pos];
48 }
static const channels_type * nativeArray(const quint8 *a)
static const qint32 Cb_pos
_channels_type_ channels_type

References KoYCbCrTraits< _channels_type_ >::Cb_pos, and KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray().

◆ Cr()

template<typename _channels_type_ >
static channels_type KoYCbCrTraits< _channels_type_ >::Cr ( quint8 * data)
inlinestatic
Returns
the Cr component

Definition at line 55 of file KoYcbcrColorSpaceTraits.h.

55 {
57 return d[Cr_pos];
58 }
static const qint32 Cr_pos

References KoYCbCrTraits< _channels_type_ >::Cr_pos, and KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray().

◆ setCb()

template<typename _channels_type_ >
static void KoYCbCrTraits< _channels_type_ >::setCb ( quint8 * data,
channels_type nv )
inlinestatic

Set the Cb component.

Definition at line 50 of file KoYcbcrColorSpaceTraits.h.

50 {
52 d[Cb_pos] = nv;
53 }

References KoYCbCrTraits< _channels_type_ >::Cb_pos, and KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray().

◆ setCr()

template<typename _channels_type_ >
static void KoYCbCrTraits< _channels_type_ >::setCr ( quint8 * data,
channels_type nv )
inlinestatic

Set the Cr component.

Definition at line 60 of file KoYcbcrColorSpaceTraits.h.

60 {
62 d[Cr_pos] = nv;
63 }

References KoYCbCrTraits< _channels_type_ >::Cr_pos, and KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray().

◆ setY()

template<typename _channels_type_ >
static void KoYCbCrTraits< _channels_type_ >::setY ( quint8 * data,
channels_type nv )
inlinestatic

Set the Y component.

Definition at line 40 of file KoYcbcrColorSpaceTraits.h.

40 {
42 d[Y_pos] = nv;
43 }
static const qint32 Y_pos

References KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray(), and KoYCbCrTraits< _channels_type_ >::Y_pos.

◆ Y()

template<typename _channels_type_ >
static channels_type KoYCbCrTraits< _channels_type_ >::Y ( quint8 * data)
inlinestatic
Returns
the Y component

Definition at line 35 of file KoYcbcrColorSpaceTraits.h.

35 {
37 return d[Y_pos];
38 }

References KoColorSpaceTrait< _channels_type_, 4, 3 >::nativeArray(), and KoYCbCrTraits< _channels_type_ >::Y_pos.

Member Data Documentation

◆ Cb_pos

template<typename _channels_type_ >
const qint32 KoYCbCrTraits< _channels_type_ >::Cb_pos = 1
static

Definition at line 21 of file KoYcbcrColorSpaceTraits.h.

◆ Cr_pos

template<typename _channels_type_ >
const qint32 KoYCbCrTraits< _channels_type_ >::Cr_pos = 2
static

Definition at line 22 of file KoYcbcrColorSpaceTraits.h.

◆ Y_pos

template<typename _channels_type_ >
const qint32 KoYCbCrTraits< _channels_type_ >::Y_pos = 0
static

Definition at line 20 of file KoYcbcrColorSpaceTraits.h.


The documentation for this struct was generated from the following file: