8#ifndef KIS_HEIF_IMPORT_TOOLS_H
9#define KIS_HEIF_IMPORT_TOOLS_H
36 static_cast<uint16_t
>(
float(0x03ffu & (
source))
38 }
else if (luma == 12) {
41 static_cast<uint16_t
>(
float(0x0fffu & (
source))
51template<
int luma,
bool hasAlpha>
61 quint8(imgA[y * strideA + x]),
69 static_cast<qreal
>(
float(0x0fff & (
source))
72 }
else if (luma == 12) {
75 static_cast<qreal
>(
float(0x0fff & (
source))
94template<
int luma,
bool hasAlpha>
103 for (
int y = 0; y < height; y++) {
104 for (
int x = 0; x < width; x++) {
105 applyValue<luma>(it, imgG, strideG, x, y);
107 applyAlpha<luma, hasAlpha>(it, imgA, strideA, x, y);
115template<
int luma,
typename... Args>
119 return Gray::readLayer<luma, true>(std::forward<Args>(args)...);
121 return Gray::readLayer<luma, false>(std::forward<Args>(args)...);
125template<
typename... Args>
129 return readPlanarWithLuma<8>(std::forward<Args>(args)...);
130 }
else if (luma == 10) {
131 return readPlanarWithLuma<10>(std::forward<Args>(args)...);
132 }
else if (luma == 12) {
133 return readPlanarWithLuma<12>(std::forward<Args>(args)...);
135 return readPlanarWithLuma<16>(std::forward<Args>(args)...);
143 template<
typename Arch>
161 template<
typename Arch>
186 template<
typename Arch>
KisMagneticGraph::vertex_descriptor source(typename KisMagneticGraph::edge_descriptor e, KisMagneticGraph g)
const quint8 OPACITY_OPAQUE_U8
static constexpr float max16bit
LinearizePolicy
The KoColorTransferFunctions class.
static constexpr float multiplier12bit
static constexpr float multiplier10bit
static constexpr float multiplier16bit
auto readPlanarWithLuma(bool hasAlpha, Args &&...args)
void applyValue(const quint8 *data, uint8_t *ptrG, int strideG, int x, int y)
void readLayer(const int width, const int height, KisHLineIteratorSP it, const uint8_t *imgG, const uint8_t *imgA, const int strideG, const int strideA)
void applyAlpha(const quint8 *data, uint8_t *ptrA, const int strideA, int x, int y)
auto readPlanarLayer(const int luma, Args &&...args)
static void create(const int luma, LinearizePolicy linearizePolicy, bool applyOOTF, const int channels, const int width, const int height, const uint8_t *img, const int stride, KisHLineIteratorSP it, float displayGamma, float displayNits, const KoColorSpace *colorSpace)
static const channels_type * nativeArray(const quint8 *a)
static void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels)
static void setGray(quint8 *data, channels_type nv)
Set the gray component.
static void create(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)
static void create(LinearizePolicy policy, bool applyOOTF, bool hasAlpha, const int width, const int height, const uint8_t *img, const int stride, KisHLineIteratorSP it, float displayGamma, float displayNits, const KoColorSpace *colorSpace)