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 110 of file HeifImport.cpp.

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

◆ 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().