Krita Source Code Documentation
Loading...
Searching...
No Matches
EncoderImpl< _T_, size, alphaPos > Class Template Reference
+ Inheritance diagram for EncoderImpl< _T_, size, alphaPos >:

Public Member Functions

void encodeData (int line) override
 
 EncoderImpl (Imf::OutputFile *_file, const ExrPaintLayerSaveInfo *_info, int width)
 
void prepareFrameBuffer (Imf::FrameBuffer *, int line) override
 
 ~EncoderImpl () override
 
- Public Member Functions inherited from Encoder
virtual ~Encoder ()
 

Private Types

typedef ExrPixel_< _T_, size > ExrPixel
 

Private Attributes

Imf::OutputFile * file
 
const ExrPaintLayerSaveInfoinfo
 
int m_width
 
QVector< ExrPixelpixels
 

Detailed Description

template<typename _T_, int size, int alphaPos>
class EncoderImpl< _T_, size, alphaPos >

Definition at line 986 of file exr_converter.cc.

Member Typedef Documentation

◆ ExrPixel

template<typename _T_ , int size, int alphaPos>
typedef ExrPixel_<_T_, size> EncoderImpl< _T_, size, alphaPos >::ExrPixel
private

Definition at line 994 of file exr_converter.cc.

Constructor & Destructor Documentation

◆ EncoderImpl()

template<typename _T_ , int size, int alphaPos>
EncoderImpl< _T_, size, alphaPos >::EncoderImpl ( Imf::OutputFile * _file,
const ExrPaintLayerSaveInfo * _info,
int width )
inline

Definition at line 989 of file exr_converter.cc.

989: file(_file), info(_info), pixels(width), m_width(width) {}
Imf::OutputFile * file
QVector< ExrPixel > pixels
const ExrPaintLayerSaveInfo * info

◆ ~EncoderImpl()

template<typename _T_ , int size, int alphaPos>
EncoderImpl< _T_, size, alphaPos >::~EncoderImpl ( )
inlineoverride

Definition at line 990 of file exr_converter.cc.

990{}

Member Function Documentation

◆ encodeData()

template<typename _T_ , int size, int alphaPos>
void EncoderImpl< _T_, size, alphaPos >::encodeData ( int line)
overridevirtual

Implements Encoder.

Definition at line 1016 of file exr_converter.cc.

1017{
1018 ExrPixel *rgba = pixels.data();
1020 do {
1021 const _T_* dst = reinterpret_cast < const _T_* >(it->oldRawData());
1022
1023 for (int i = 0; i < size; ++i) {
1024 rgba->data[i] = dst[i];
1025 }
1026
1027 if (alphaPos != -1) {
1028 multiplyAlpha<_T_, ExrPixel, size, alphaPos>(rgba);
1029 }
1030
1031 ++rgba;
1032 } while (it->nextPixel());
1033}
ExrPixel_< _T_, size > ExrPixel
virtual const quint8 * oldRawData() const =0
virtual bool nextPixel()=0
KisHLineConstIteratorSP createHLineConstIteratorNG(qint32 x, qint32 y, qint32 w) const
int size(const Forest< T > &forest)
Definition KisForest.h:1232
uint32_t rgba
Definition pixels.h:44
KisPaintDeviceSP layerDevice

References ExrPixel_< _T_, size >::data, KisBaseConstIteratorNG::nextPixel(), and KisBaseConstAccessor::oldRawData().

◆ prepareFrameBuffer()

template<typename _T_ , int size, int alphaPos>
void EncoderImpl< _T_, size, alphaPos >::prepareFrameBuffer ( Imf::FrameBuffer * frameBuffer,
int line )
overridevirtual

Implements Encoder.

Definition at line 1002 of file exr_converter.cc.

1003{
1004 int xstart = 0;
1005 int ystart = 0;
1006 ExrPixel* frameBufferData = (pixels.data()) - xstart - (ystart + line) * m_width;
1007 for (int k = 0; k < size; ++k) {
1008 frameBuffer->insert(info->channels[k].toUtf8(),
1009 Imf::Slice(info->pixelType, (char *) &frameBufferData->data[k],
1010 sizeof(ExrPixel) * 1,
1011 sizeof(ExrPixel) * m_width));
1012 }
1013}
QList< QString > channels
Imf::PixelType pixelType

References ExrPixel_< _T_, size >::data.

Member Data Documentation

◆ file

template<typename _T_ , int size, int alphaPos>
Imf::OutputFile* EncoderImpl< _T_, size, alphaPos >::file
private

Definition at line 995 of file exr_converter.cc.

◆ info

template<typename _T_ , int size, int alphaPos>
const ExrPaintLayerSaveInfo* EncoderImpl< _T_, size, alphaPos >::info
private

Definition at line 996 of file exr_converter.cc.

◆ m_width

template<typename _T_ , int size, int alphaPos>
int EncoderImpl< _T_, size, alphaPos >::m_width
private

Definition at line 998 of file exr_converter.cc.

◆ pixels

template<typename _T_ , int size, int alphaPos>
QVector<ExrPixel> EncoderImpl< _T_, size, alphaPos >::pixels
private

Definition at line 997 of file exr_converter.cc.


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