Krita Source Code Documentation
Loading...
Searching...
No Matches
KoOptimizedPixelDataScalerU8ToU16Base Class Referenceabstract

Converts an RGB-like color space between U8 and U16 formats. More...

#include <KoOptimizedPixelDataScalerU8ToU16Base.h>

+ Inheritance diagram for KoOptimizedPixelDataScalerU8ToU16Base:

Public Member Functions

int channelsPerPixel () const
 
virtual void convertU16ToU8 (const quint8 *src, int srcRowStride, quint8 *dst, int dstRowStride, int numRows, int numColumns) const =0
 
virtual void convertU8ToU16 (const quint8 *src, int srcRowStride, quint8 *dst, int dstRowStride, int numRows, int numColumns) const =0
 
 KoOptimizedPixelDataScalerU8ToU16Base (int channelsPerPixel)
 
virtual ~KoOptimizedPixelDataScalerU8ToU16Base ()
 

Protected Attributes

int m_channelsPerPixel
 

Detailed Description

Converts an RGB-like color space between U8 and U16 formats.

In some places we need to extend precision of the color space in a very efficient way. It is specifically needed in the colorsmudge engine, because it operates at an extremely low levels of opacity. The conversion should also happen very efficiently, because colorsmudge requests it on the fly right when the user is painting on the canvas.

The actual implementation is placed in class KoOptimizedPixelDataScalerU8ToU16.

To create a scaler, just call a factory. It will create a version of the scaler optimized for your CPU architecture.

QScopedPointer<KoOptimizedPixelDataScalerU8ToU16Base> scaler(
// ...
// convert the data from U8 to U16
scaler->convertU8ToU16(src, srcRowStride,
dst, dstRowStride,
numRows, numColumns);
// ...
// convert the data back from U16 to U8
scaler->convertU16ToU8(src, srcRowStride,
dst, dstRowStride,
numRows, numColumns);
static KoOptimizedPixelDataScalerU8ToU16Base * createRgbaScaler()

Definition at line 49 of file KoOptimizedPixelDataScalerU8ToU16Base.h.

Constructor & Destructor Documentation

◆ KoOptimizedPixelDataScalerU8ToU16Base()

KoOptimizedPixelDataScalerU8ToU16Base::KoOptimizedPixelDataScalerU8ToU16Base ( int channelsPerPixel)

◆ ~KoOptimizedPixelDataScalerU8ToU16Base()

KoOptimizedPixelDataScalerU8ToU16Base::~KoOptimizedPixelDataScalerU8ToU16Base ( )
virtual

Definition at line 15 of file KoOptimizedPixelDataScalerU8ToU16Base.cpp.

16{
17}

Member Function Documentation

◆ channelsPerPixel()

int KoOptimizedPixelDataScalerU8ToU16Base::channelsPerPixel ( ) const

Definition at line 19 of file KoOptimizedPixelDataScalerU8ToU16Base.cpp.

20{
21 return m_channelsPerPixel;
22}

References m_channelsPerPixel.

◆ convertU16ToU8()

virtual void KoOptimizedPixelDataScalerU8ToU16Base::convertU16ToU8 ( const quint8 * src,
int srcRowStride,
quint8 * dst,
int dstRowStride,
int numRows,
int numColumns ) const
pure virtual

◆ convertU8ToU16()

virtual void KoOptimizedPixelDataScalerU8ToU16Base::convertU8ToU16 ( const quint8 * src,
int srcRowStride,
quint8 * dst,
int dstRowStride,
int numRows,
int numColumns ) const
pure virtual

Member Data Documentation

◆ m_channelsPerPixel

int KoOptimizedPixelDataScalerU8ToU16Base::m_channelsPerPixel
protected

Definition at line 67 of file KoOptimizedPixelDataScalerU8ToU16Base.h.


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