Krita Source Code Documentation
Loading...
Searching...
No Matches
Planar Namespace Reference

Classes

struct  readLayerImpl
 

Functions

auto readPlanarLayer (const int luma, LinearizePolicy policy, bool applyOOTF, bool hasAlpha, const int width, const int height, const uint8_t *imgR, const int strideR, const uint8_t *imgG, const int strideG, const uint8_t *imgB, const int strideB, const uint8_t *imgA, const int strideA, KisHLineIteratorSP it, float displayGamma, float displayNits, const KoColorSpace *colorSpace)
 
template<typename... Args>
auto writeLayer (bool hasAlpha, Args &&...args)
 
template<bool hasAlpha>
void writeLayerImpl (const int width, const int height, uint8_t *ptrR, const int strideR, uint8_t *ptrG, const int strideG, uint8_t *ptrB, const int strideB, uint8_t *ptrA, const int strideA, KisHLineConstIteratorSP it)
 

Function Documentation

◆ readPlanarLayer()

auto Planar::readPlanarLayer ( const int luma,
LinearizePolicy policy,
bool applyOOTF,
bool hasAlpha,
const int width,
const int height,
const uint8_t * imgR,
const int strideR,
const uint8_t * imgG,
const int strideG,
const uint8_t * imgB,
const int strideB,
const uint8_t * imgA,
const int strideA,
KisHLineIteratorSP it,
float displayGamma,
float displayNits,
const KoColorSpace * colorSpace )
inline

Definition at line 111 of file HeifImport.cpp.

129{
130 return createOptimizedClass<readLayerImpl>(luma,
131 policy,
132 applyOOTF,
133 hasAlpha,
134 width,
135 height,
136 imgR,
137 strideR,
138 imgG,
139 strideG,
140 imgB,
141 strideB,
142 imgA,
143 strideA,
144 it,
145 displayGamma,
146 displayNits,
147 colorSpace);
148}

◆ writeLayer()

template<typename... Args>
auto Planar::writeLayer ( bool hasAlpha,
Args &&... args )
inline

Definition at line 158 of file kis_heif_export_tools.h.

159{
160 if (hasAlpha) {
161 return Planar::writeLayerImpl<true>(std::forward<Args>(args)...);
162 } else {
163 return Planar::writeLayerImpl<false>(std::forward<Args>(args)...);
164 }
165}

◆ writeLayerImpl()

template<bool hasAlpha>
void Planar::writeLayerImpl ( const int width,
const int height,
uint8_t * ptrR,
const int strideR,
uint8_t * ptrG,
const int strideG,
uint8_t * ptrB,
const int strideB,
uint8_t * ptrA,
const int strideA,
KisHLineConstIteratorSP it )
inline

Definition at line 125 of file kis_heif_export_tools.h.

136{
137 for (int y = 0; y < height; y++) {
138 for (int x = 0; x < width; x++) {
139 const quint8 *data = it->rawDataConst();
140 ptrR[y * strideR + x] = KoBgrU8Traits::red(data);
141 ptrG[y * strideG + x] = KoBgrU8Traits::green(data);
142 ptrB[y * strideB + x] = KoBgrU8Traits::blue(data);
143
144 // If we already employ KoBgrU8Traits to access the iterator,
145 // we can use it for the opacity too. -amyspark
146 if (hasAlpha) {
147 ptrA[y * strideA + x] = KoBgrU8Traits::opacityU8(data);
148 }
149
150 it->nextPixel();
151 }
152
153 it->nextRow();
154 }
155}
virtual const quint8 * rawDataConst() const =0
virtual bool nextPixel()=0
virtual void nextRow()=0
static channels_type blue(const quint8 *data)
static channels_type green(const quint8 *data)
static channels_type red(const quint8 *data)
static quint8 opacityU8(const quint8 *U8_pixel)

References KoBgrTraits< quint8 >::blue(), KoBgrTraits< quint8 >::green(), KisBaseConstIteratorNG::nextPixel(), KisHLineConstIteratorNG::nextRow(), KoColorSpaceTrait< _channels_type_, _channels_nb_, _alpha_pos_ >::opacityU8(), KisBaseConstAccessor::rawDataConst(), and KoBgrTraits< quint8 >::red().