111{
112 const uint32_t xPos =
d.m_header.layer_info.crop_x0;
113 const uint32_t yPos =
d.m_header.layer_info.crop_y0;
114 const uint32_t width =
d.m_header.layer_info.xsize;
115 const uint32_t height =
d.m_header.layer_info.ysize;
117
118 const auto *
src =
reinterpret_cast<const channelsType *
>(
d.m_rawData.data());
119 const uint32_t channels =
d.m_pixelFormat.num_channels;
120
123 const double *lCoef =
d.lCoef.constData();
125 float *
tmp = pixelValues.data();
126 const quint32 alphaPos = cs->
alphaPos();
127
128 for (size_t j = 0; j < height; j++) {
129 for (size_t i = 0; i < width; i++) {
130 for (size_t i = 0; i < channels; i++) {
132 }
133
134 for (size_t ch = 0; ch < channels; ch++) {
135 if (ch == alphaPos) {
136 tmp[ch] = value<LinearizePolicy::KeepTheSame, channelsType>(src, ch);
137 } else {
138 tmp[ch] = value<policy, channelsType>(src, ch);
139 }
140 }
141
142 if (swap) {
143 std::swap(
tmp[0],
tmp[2]);
144 }
145
148 }
149
151
152 src +=
d.m_pixelFormat.num_channels;
153
154 it->nextPixel();
155 }
156 it->nextRow();
157 }
158 } else {
159 for (size_t j = 0; j < height; j++) {
160 for (size_t i = 0; i < width; i++) {
161 auto *dst = reinterpret_cast<channelsType *>(it->rawData());
162
163 std::memcpy(dst, src, channels * sizeof(channelsType));
164
165 if (swap) {
166 std::swap(dst[0], dst[2]);
167 }
else if (
d.isCMYK &&
d.m_info.uses_original_profile) {
168
169 std::swap(dst[3], dst[4]);
170 }
171
172 src +=
d.m_pixelFormat.num_channels;
173
174 it->nextPixel();
175 }
176 it->nextRow();
177 }
178 }
179}
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