47 pdfium::span<
const float> pBuf)
const {
50 const float pix = NormalizeChannel(pBuf.front());
51 return FX_RGB_STRUCT<
float>{pix, pix, pix};
57 NormalizeChannel(rgb.red),
58 NormalizeChannel(rgb.green),
59 NormalizeChannel(rgb.blue),
67 1.0f -
std::min(1.0f, cmyk.cyan + cmyk.key),
68 1.0f -
std::min(1.0f, cmyk.magenta + cmyk.key),
69 1.0f -
std::min(1.0f, cmyk.yellow + cmyk.key),
72 return AdobeCMYK_to_sRGB(
73 NormalizeChannel(cmyk.cyan), NormalizeChannel(cmyk.magenta),
74 NormalizeChannel(cmyk.yellow), NormalizeChannel(cmyk.key));
82 pdfium::span<
const uint8_t> src_span,
86 bool bTransMask)
const {
93 for (
const auto pix : src_span.first(pixels)) {
94 rgb_out.front().red = pix;
95 rgb_out.front().green = pix;
96 rgb_out.front().blue = pix;
97 rgb_out = rgb_out.subspan(1);
110 for (
const auto cmyk : cmyk_in.first(pixels)) {
111 const int k = 255 - cmyk.key;
112 rgb_out.front().red = ((255 - cmyk.cyan) * k) / 255;
113 rgb_out.front().green = ((255 - cmyk.magenta) * k) / 255;
114 rgb_out.front().blue = ((255 - cmyk.yellow) * k) / 255;
115 rgb_out = rgb_out.subspan(1);
122 for (
const auto cmyk : cmyk_in.first(pixels)) {
123 const uint8_t k = cmyk.key;
124 rgb_out.front().blue = 255 - std::min(255, cmyk.cyan + k);
125 rgb_out.front().green = 255 - std::min(255, cmyk.magenta + k);
126 rgb_out.front().red = 255 - std::min(255, cmyk.yellow + k);
127 rgb_out = rgb_out.subspan(1);
131 for (
const auto& cmyk : cmyk_in.first(pixels)) {
133 FX_RGB_STRUCT<uint8_t> rgb =
134 AdobeCMYK_to_sRGB1(cmyk.cyan, cmyk.magenta, cmyk.yellow, cmyk.key);
135 rgb_out.front().red = rgb.blue;
136 rgb_out.front().green = rgb.green;
137 rgb_out.front().blue = rgb.red;
138 rgb_out = rgb_out.subspan(1);
void TranslateImageLine(pdfium::span< uint8_t > dest_span, pdfium::span< const uint8_t > src_span, int pixels, int image_width, int image_height, bool bTransMask) const override