110{
111 const uint32_t xPos =
d.m_header.layer_info.crop_x0;
112 const uint32_t yPos =
d.m_header.layer_info.crop_y0;
113 const uint32_t width =
d.m_header.layer_info.xsize;
114 const uint32_t height =
d.m_header.layer_info.ysize;
116
117 const auto *
src =
reinterpret_cast<const channelsType *
>(
d.m_rawData.data());
118 const uint32_t channels =
d.m_pixelFormat.num_channels;
119
122 const double *lCoef =
d.lCoef.constData();
124 float *
tmp = pixelValues.data();
125 const quint32 alphaPos = cs->
alphaPos();
126
127 for (size_t j = 0; j < height; j++) {
128 for (size_t i = 0; i < width; i++) {
129 for (size_t i = 0; i < channels; i++) {
131 }
132
133 for (size_t ch = 0; ch < channels; ch++) {
134 if (ch == alphaPos) {
135 tmp[ch] = value<LinearizePolicy::KeepTheSame, channelsType>(src, ch);
136 } else {
137 tmp[ch] = value<policy, channelsType>(src, ch);
138 }
139 }
140
141 if (swap) {
142 std::swap(
tmp[0],
tmp[2]);
143 }
144
147 }
148
150
151 src +=
d.m_pixelFormat.num_channels;
152
153 it->nextPixel();
154 }
155 it->nextRow();
156 }
157 } else {
158 for (size_t j = 0; j < height; j++) {
159 for (size_t i = 0; i < width; i++) {
160 auto *dst = reinterpret_cast<channelsType *>(it->rawData());
161
162 std::memcpy(dst, src, channels * sizeof(channelsType));
163
164 if (swap) {
165 std::swap(dst[0], dst[2]);
166 }
else if (
d.isCMYK &&
d.m_info.uses_original_profile) {
167
168 std::swap(dst[3], dst[4]);
169 }
170
171 src +=
d.m_pixelFormat.num_channels;
172
173 it->nextPixel();
174 }
175 it->nextRow();
176 }
177 }
178}
ALWAYS_INLINE void applyHLGOOTF(float *rgb, const double *lumaCoefficients, float gamma=1.2f, float nominalPeak=1000.0f) noexcept
virtual quint32 alphaPos() const =0
virtual quint32 channelCount() const =0
virtual void fromNormalisedChannelsValue(quint8 *pixel, const QVector< float > &values) const =0