31 uint16_t &sample_format,
38 destColorSpace =
nullptr;
44 color_type = PHOTOMETRIC_RGB;
46 sample_format = SAMPLEFORMAT_IEEEFP;
51 color_type = PHOTOMETRIC_SEPARATED;
52 TIFFSetField(
image, TIFFTAG_INKSET, INKSET_CMYK);
55 sample_format = SAMPLEFORMAT_IEEEFP;
60 color_type = PHOTOMETRIC_ICCLAB;
63 sample_format = SAMPLEFORMAT_IEEEFP;
68 color_type = PHOTOMETRIC_MINISBLACK;
70 sample_format = SAMPLEFORMAT_IEEEFP;
74 color_type = PHOTOMETRIC_YCBCR;
76 sample_format = SAMPLEFORMAT_IEEEFP;
80 color_type = PHOTOMETRIC_RGB;
86 sample_format = SAMPLEFORMAT_IEEEFP;
95 uint16_t sample_format,
96 uint8_t nbcolorssamples,
97 const std::array<quint8, 5> &poses)
100 Q_ASSERT(sample_format == SAMPLEFORMAT_IEEEFP);
101 float *dst =
reinterpret_cast<float *
>(buff);
103 const float *d =
reinterpret_cast<const float *
>(it->
oldRawData());
104 for (uint8_t i = 0; i < nbcolorssamples; i++) {
105 *(dst++) = d[poses.at(i)];
108 *(dst++) = d[poses.at(nbcolorssamples)];
111 }
else if (depth == 16) {
112 if (sample_format == SAMPLEFORMAT_IEEEFP) {
114 half *dst =
reinterpret_cast<half *
>(buff);
116 const half *d =
reinterpret_cast<const half *
>(it->
oldRawData());
117 for (uint8_t i = 0; i < nbcolorssamples; i++) {
118 *(dst++) = d[poses.at(i)];
121 *(dst++) = d[poses.at(nbcolorssamples)];
127 quint16 *dst =
reinterpret_cast<quint16 *
>(buff);
129 const quint16 *d =
reinterpret_cast<const quint16 *
>(it->
oldRawData());
130 for (uint8_t i = 0; i < nbcolorssamples; i++) {
131 *(dst++) = d[poses.at(i)];
134 *(dst++) = d[poses.at(nbcolorssamples)];
139 }
else if (depth == 8) {
140 quint8 *dst =
reinterpret_cast<quint8 *
>(buff);
143 for (uint8_t i = 0; i < nbcolorssamples; i++) {
144 *(dst++) = d[poses.at(i)];
147 *(dst++) = d[poses.at(nbcolorssamples)];
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID YCbCrAColorModelID("YCbCrA", ki18n("YCbCr/Alpha"))
const KoID Float64BitsColorDepthID("F64", ki18n("64-bit float/channel"))
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
virtual const quint8 * oldRawData() const =0
virtual bool nextPixel()=0
static bool isBitDepthFloat(const KoID depth)
bool copyDataToStrips(KisHLineConstIteratorSP it, tdata_t buff, uint32_t depth, uint16_t sample_format, uint8_t nbcolorssamples, const std::array< quint8, 5 > &poses)
KisTIFFOptions * m_options
static bool writeColorSpaceInformation(TIFF *image, const KoColorSpace *cs, uint16_t &color_type, uint16_t &sample_format, const KoColorSpace *&destColorSpace)
KisTIFFBaseWriter(TIFF *image, KisTIFFOptions *options)
virtual KoID colorModelId() const =0
virtual KoID colorDepthId() const =0
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()
const KoColorProfile * p709SRGBProfile() const