176{
177 std::array<KoBgrU16Traits::channels_type, channels> pixelValues{};
178
179 for (int y = 0; y < height; y++) {
180 for (int x = 0; x < width; x++) {
185 if (channels == 4) {
188 }
189
190 for (int ch = 0; ch < channels; ch++) {
191 uint16_t
v = qBound<uint16_t>(
192 0,
193 static_cast<uint16_t>(float(pixelValues[ch])
196 ptr[2 * (
x * channels) + y * stride + endValue0 + (ch * 2)] =
197 static_cast<uint8_t
>(
v >> 8);
198 ptr[2 * (
x * channels) + y * stride + endValue1 + (ch * 2)] =
199 static_cast<uint8_t
>(
v & 0xFF);
200 }
201
203 }
204
206 }
207}
static constexpr float max16bit
static constexpr uint16_t max12bit
static constexpr float multiplier16bit
virtual const quint8 * rawDataConst() const =0
virtual bool nextPixel()=0
static channels_type blue(const quint8 *data)
static channels_type green(const quint8 *data)
static channels_type red(const quint8 *data)
_channels_type_ channels_type
the type of the value of the channels of this color space
static qreal opacityF(const quint8 *U8_pixel)