/* * jdcolext.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2009, 2011, 2015, 2022-2023, D. R. Commander. * For conditions of distribution and use, see the accompanying README.ijg * file. * * This file contains output colorspace conversion routines.
*/
/* This file is included by jdcolor.c */
/* * Convert some rows of samples to the output colorspace. * * Note that we change from noninterleaved, one-plane-per-component format * to interleaved-pixel format. The output buffer is therefore three times * as wide as the input buffer. * A starting row offset is provided only for the input buffer. The caller * can easily adjust the passed output_buf value to accommodate any row * offset required on that side.
*/
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++; for (col = 0; col < num_cols; col++) {
y = inptr0[col];
cb = inptr1[col];
cr = inptr2[col]; /* Range-limiting is essential due to noise introduced by DCT losses. */
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
outptr[RGB_GREEN] = range_limit[y +
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
SCALEBITS))];
outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ /* opaque alpha channel value */ #ifdef RGB_ALPHA
outptr[RGB_ALPHA] = _MAXJSAMPLE; #endif
outptr += RGB_PIXELSIZE;
}
} #else
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); #endif
}
/* * Convert grayscale to RGB: just duplicate the graylevel three times. * This is provided to support applications that don't want to cope * with grayscale as a separate case.
*/
while (--num_rows >= 0) {
inptr = input_buf[0][input_row++];
outptr = *output_buf++; for (col = 0; col < num_cols; col++) {
outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ /* opaque alpha channel value */ #ifdef RGB_ALPHA
outptr[RGB_ALPHA] = _MAXJSAMPLE; #endif
outptr += RGB_PIXELSIZE;
}
}
}
/* * Convert RGB to extended RGB: just swap the order of source pixels
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.