• Home
  • Raw
  • Download

Lines Matching +full:set +full:- +full:image

2  * Copyright (C)2009-2015, 2017, 2020-2021, 2023 D. R. Commander.
8 * - Redistributions of source code must retain the above copyright notice,
10 * - Redistributions in binary form must reproduce the above copyright notice,
13 * - Neither the name of the libjpeg-turbo Project nor the names of its
47 * YUV Image Format Notes
48 * ----------------------
51 * digital video community, the TurboJPEG API uses "YUV" to refer to an image
52 * format consisting of Y, Cb, and Cr image planes.
56 * image. The width and height of each plane are determined by the image
58 * width is the image width padded to the nearest multiple of the horizontal
61 * plane height is the image height padded to the nearest multiple of the
70 * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
90 * to produce a smaller image with little perceptible loss of image clarity.
97 * YUV image will contain one chrominance component for every pixel in the
98 * source image.
102 * 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one
103 * chrominance component for every 2x1 block of pixels in the source image.
107 * 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one
108 * chrominance component for every 2x2 block of pixels in the source image.
112 * Grayscale. The JPEG or YUV image will contain no chrominance components.
116 * 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one
117 * chrominance component for every 1x2 block of pixels in the source image.
119 * @note 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
123 * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one
124 * chrominance component for every 4x1 block of pixels in the source image.
131 * @note 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.
139 * - 8x8 for no subsampling or grayscale
140 * - 16x8 for 4:2:2
141 * - 8x16 for 4:4:0
142 * - 16x16 for 4:2:0
143 * - 32x8 for 4:1:1
150 * - 8x8 for no subsampling or grayscale
151 * - 16x8 for 4:2:2
152 * - 8x16 for 4:4:0
153 * - 16x16 for 4:2:0
154 * - 32x8 for 4:1:1
169 * RGB pixel format. The red, green, and blue components in the image are
170 * stored in 3-byte pixels in the order R, G, B from lowest to highest byte
175 * BGR pixel format. The red, green, and blue components in the image are
176 * stored in 3-byte pixels in the order B, G, R from lowest to highest byte
181 * RGBX pixel format. The red, green, and blue components in the image are
182 * stored in 4-byte pixels in the order R, G, B from lowest to highest byte
188 * BGRX pixel format. The red, green, and blue components in the image are
189 * stored in 4-byte pixels in the order B, G, R from lowest to highest byte
195 * XBGR pixel format. The red, green, and blue components in the image are
196 * stored in 4-byte pixels in the order R, G, B from highest to lowest byte
202 * XRGB pixel format. The red, green, and blue components in the image are
203 * stored in 4-byte pixels in the order B, G, R from highest to lowest byte
209 * Grayscale pixel format. Each 1-byte pixel represents a luminance
249 * packed-pixel CMYK images into YCCK JPEG images (see #TJCS_YCCK) and
250 * decompressing YCCK JPEG images into packed-pixel CMYK images.
256 TJPF_UNKNOWN = -1
264 *`pixel[tjRedOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
268 0, 2, 0, 2, 3, 1, -1, 0, 2, 3, 1, -1
275 * `pixel[tjGreenOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
279 1, 1, 1, 1, 2, 2, -1, 1, 1, 2, 2, -1
286 * `pixel[tjBlueOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
290 2, 0, 2, 0, 1, 3, -1, 2, 0, 1, 3, -1
297 * `pixel[tjAlphaOffset[TJPF_BGRA]]`. This will be -1 if the pixel format does
301 -1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1
321 * RGB colorspace. When compressing the JPEG image, the R, G, and B
322 * components in the source image are reordered into image planes, but no
324 * decompressed to packed-pixel images with any of the extended RGB or
334 * component represents the black & white portion of the original image, and
336 * original image. Originally, the analog equivalent of this transformation
341 * compressed from and decompressed to packed-pixel images with any of the
347 * Grayscale colorspace. The JPEG image retains only the luminance data (Y
348 * component), and any color data from the source image is discarded.
350 * packed-pixel images with any of the extended RGB or grayscale pixel
356 * CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K
357 * components in the source image are reordered into image planes, but no
359 * only be decompressed to packed-pixel images with the CMYK pixel format.
369 * decompressed to packed-pixel images with the CMYK pixel format.
376 * Rows in the packed-pixel source/destination image are stored in bottom-up
377 * (Windows, OpenGL) order rather than in top-down (X11) order.
381 * When decompressing an image that was compressed using chrominance
385 * artifacts in the decompressed image.
397 * not specified is implementation-specific. For example, the implementation
398 * of the TurboJPEG API in libjpeg-turbo uses the fast algorithm by default
406 * flag is not specified is implementation-specific. For example, the
407 * implementation of the TurboJPEG API in libjpeg-turbo uses the fast algorithm
415 * operation if a warning (non-fatal error) occurs. The default behavior is to
428 * transform functions will process. If a progressive JPEG image contains an
431 * purpose of this is to allow security-critical applications to guard against
433 …* <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target…
448 * The error was non-fatal and recoverable, but the destination image may
453 * The error was fatal and non-recoverable.
469 * Do not transform the position of the image pixels
473 * Flip (mirror) image horizontally. This transform is imperfect if there
478 * Flip (mirror) image vertically. This transform is imperfect if there are
483 * Transpose image (flip/mirror along upper left to lower right axis.) This
488 * Transverse transpose image (flip/mirror along upper right to lower left
490 * the image (see #TJXOPT_PERFECT.)
494 * Rotate image clockwise by 90 degrees. This transform is imperfect if
500 * Rotate image 180 degrees. This transform is imperfect if there are any
501 * partial MCU blocks in the image (see #TJXOPT_PERFECT.)
505 * Rotate image counter-clockwise by 90 degrees. This transform is imperfect
517 * #tjMCUHeight.) If the image's width or height is not evenly divisible by
520 * the top or left of the image, so any transform that would require that is
523 * odd-looking strips on the right or bottom edge of the image.
537 * This option will discard the color data in the source image and produce a
538 * grayscale destination image.
542 * This option will prevent #tjTransform() from outputting a JPEG image for
549 * This option will enable progressive entropy coding in the JPEG image
557 * (including EXIF and ICC profile data) from the source image to the
558 * destination image.
593 * setting it to the width of the source JPEG image - x.
598 * setting it to the height of the source JPEG image - y.
628 * JPEG image. This allows for custom filters or other transformations to be
649 * @param transformID ID number of the transformed image to which `coeffs`
656 * @return 0 if the callback was successful, or -1 if an error occurred.
680 (((dimension) * scalingFactor.num + scalingFactor.denom - 1) / \
692 * @return a handle to the newly-created instance, or NULL if an error occurred
699 * Compress a packed-pixel RGB, grayscale, or CMYK image into a JPEG image.
703 * @param srcBuf pointer to a buffer containing a packed-pixel RGB, grayscale,
704 * or CMYK source image to be compressed
706 * @param width width (in pixels) of the source image
708 * @param pitch bytes per row in the source image. Normally this should be
709 * <tt>width * #tjPixelSize[pixelFormat]</tt>, if the image is unpadded, or
710 * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each row of the image
716 * @param height height (in pixels) of the source image
718 * @param pixelFormat pixel format of the source image (see @ref TJPF
722 * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
723 * accommodate the size of the JPEG image. Thus, you can choose to:
724 * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
726 * -# set `*jpegBuf` to NULL to tell TurboJPEG to allocate the buffer for you,
728 * -# pre-allocate the buffer to a "worst case" size determined by calling
730 * re-allocated. (Setting #TJFLAG_NOREALLOC guarantees that it won't be.)
732 * If you choose option 1, then `*jpegSize` should be set to the size of your
733 * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
738 * the JPEG buffer. If `*jpegBuf` points to a pre-allocated buffer, then
739 * `*jpegSize` should be set to the size of the buffer. Upon return,
740 * `*jpegSize` will contain the size of the JPEG image (in bytes.) If
745 * generating the JPEG image (see @ref TJSAMP
748 * @param jpegQual the image quality of the generated JPEG image (1 = worst,
754 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
764 * Compress a unified planar YUV image into a JPEG image.
769 * image to be compressed. The size of this buffer should match the value
770 * returned by #tjBufSizeYUV2() for the given image width, height, row
772 * image planes should be stored sequentially in the buffer. (Refer to
773 * @ref YUVnotes "YUV Image Format Notes".)
775 * @param width width (in pixels) of the source image. If the width is not an
779 * @param align row alignment (in bytes) of the source image (must be a power
781 * the source image is padded to the nearest multiple of n bytes
784 * @param height height (in pixels) of the source image. If the height is not
788 * @param subsamp the level of chrominance subsampling used in the source image
792 * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
793 * accommodate the size of the JPEG image. Thus, you can choose to:
794 * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
796 * -# set `*jpegBuf` to NULL to tell TurboJPEG to allocate the buffer for you,
798 * -# pre-allocate the buffer to a "worst case" size determined by calling
800 * re-allocated. (Setting #TJFLAG_NOREALLOC guarantees that it won't be.)
802 * If you choose option 1, then `*jpegSize` should be set to the size of your
803 * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
808 * the JPEG buffer. If `*jpegBuf` points to a pre-allocated buffer, then
809 * `*jpegSize` should be set to the size of the buffer. Upon return,
810 * `*jpegSize` will contain the size of the JPEG image (in bytes.) If
814 * @param jpegQual the image quality of the generated JPEG image (1 = worst,
820 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
831 * Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.
835 * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
836 * (or just a Y plane, if compressing a grayscale image) that contain a YUV
837 * source image to be compressed. These planes can be contiguous or
838 * non-contiguous in memory. The size of each plane should match the value
839 * returned by #tjPlaneSizeYUV() for the given image width, height, strides,
841 * "YUV Image Format Notes" for more details.
843 * @param width width (in pixels) of the source image. If the width is not an
848 * row in the corresponding plane of the YUV source image. Setting the stride
850 * @ref YUVnotes "YUV Image Format Notes".) If `strides` is NULL, then the
851 * strides for all planes will be set to their respective plane widths. You
853 * padding in each plane or to create a JPEG image from a subregion of a larger
854 * planar YUV image.
856 * @param height height (in pixels) of the source image. If the height is not
860 * @param subsamp the level of chrominance subsampling used in the source image
864 * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
865 * accommodate the size of the JPEG image. Thus, you can choose to:
866 * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
868 * -# set `*jpegBuf` to NULL to tell TurboJPEG to allocate the buffer for you,
870 * -# pre-allocate the buffer to a "worst case" size determined by calling
872 * re-allocated. (Setting #TJFLAG_NOREALLOC guarantees that it won't be.)
874 * If you choose option 1, then `*jpegSize` should be set to the size of your
875 * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
880 * the JPEG buffer. If `*jpegBuf` points to a pre-allocated buffer, then
881 * `*jpegSize` should be set to the size of the buffer. Upon return,
882 * `*jpegSize` will contain the size of the JPEG image (in bytes.) If
886 * @param jpegQual the image quality of the generated JPEG image (1 = worst,
892 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
905 * The maximum size of the buffer (in bytes) required to hold a JPEG image with
907 * larger than the size of the uncompressed source image. The reason for this
908 * is that the JPEG format uses 16-bit coefficients, so it is possible for a
909 * very high-quality source image with very high-frequency content to expand
912 * size of a JPEG image prior to compression, the corner cases have to be
915 * @param width width (in pixels) of the image
917 * @param height height (in pixels) of the image
920 * generating the JPEG image (see @ref TJSAMP
924 * image, or -1 if the arguments are out of bounds.
931 * image with the given parameters.
933 * @param width width (in pixels) of the image
935 * @param align row alignment (in bytes) of the image (must be a power of 2.)
937 * image will be padded to the nearest multiple of n bytes (1 = unpadded.)
939 * @param height height (in pixels) of the image
941 * @param subsamp level of chrominance subsampling in the image (see
944 * @return the size of the buffer (in bytes) required to hold the image, or -1
952 * The size of the buffer (in bytes) required to hold a YUV image plane with
955 * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
957 * @param width width (in pixels) of the YUV image. NOTE: this is the width of
958 * the whole image, not the plane width.
960 * @param stride bytes per row in the image plane. Setting this to 0 is the
963 * @param height height (in pixels) of the YUV image. NOTE: this is the height
964 * of the whole image, not the plane height.
966 * @param subsamp level of chrominance subsampling in the image (see
969 * @return the size of the buffer (in bytes) required to hold the YUV image
970 * plane, or -1 if the arguments are out of bounds.
977 * The plane width of a YUV image plane with the given parameters. Refer to
978 * @ref YUVnotes "YUV Image Format Notes" for a description of plane width.
980 * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
982 * @param width width (in pixels) of the YUV image
984 * @param subsamp level of chrominance subsampling in the image (see
987 * @return the plane width of a YUV image plane with the given parameters, or
988 * -1 if the arguments are out of bounds.
994 * The plane height of a YUV image plane with the given parameters. Refer to
995 * @ref YUVnotes "YUV Image Format Notes" for a description of plane height.
997 * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
999 * @param height height (in pixels) of the YUV image
1001 * @param subsamp level of chrominance subsampling in the image (see
1004 * @return the plane height of a YUV image plane with the given parameters, or
1005 * -1 if the arguments are out of bounds.
1011 * Encode a packed-pixel RGB or grayscale image into a unified planar YUV
1012 * image. This function performs color conversion (which is accelerated in the
1013 * libjpeg-turbo implementation) but does not execute any of the other steps in
1018 * @param srcBuf pointer to a buffer containing a packed-pixel RGB or grayscale
1019 * source image to be encoded
1021 * @param width width (in pixels) of the source image
1023 * @param pitch bytes per row in the source image. Normally this should be
1024 * <tt>width * #tjPixelSize[pixelFormat]</tt>, if the image is unpadded, or
1025 * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each row of the image
1031 * @param height height (in pixels) of the source image
1033 * @param pixelFormat pixel format of the source image (see @ref TJPF
1037 * image. Use #tjBufSizeYUV2() to determine the appropriate size for this
1038 * buffer based on the image width, height, row alignment, and level of
1039 * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be
1041 * "YUV Image Format Notes".)
1043 * @param align row alignment (in bytes) of the YUV image (must be a power of
1045 * YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.)
1046 * To generate images suitable for X Video, `align` should be set to 4.
1049 * generating the YUV image (see @ref TJSAMP
1051 * Video, `subsamp` should be set to @ref TJSAMP_420. This produces an image
1057 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1067 * Encode a packed-pixel RGB or grayscale image into separate Y, U (Cb), and
1068 * V (Cr) image planes. This function performs color conversion (which is
1069 * accelerated in the libjpeg-turbo implementation) but does not execute any of
1074 * @param srcBuf pointer to a buffer containing a packed-pixel RGB or grayscale
1075 * source image to be encoded
1077 * @param width width (in pixels) of the source image
1079 * @param pitch bytes per row in the source image. Normally this should be
1080 * <tt>width * #tjPixelSize[pixelFormat]</tt>, if the image is unpadded, or
1081 * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each row of the image
1087 * @param height height (in pixels) of the source image
1089 * @param pixelFormat pixel format of the source image (see @ref TJPF
1092 * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1093 * (or just a Y plane, if generating a grayscale image) that will receive the
1094 * encoded image. These planes can be contiguous or non-contiguous in memory.
1096 * on the image width, height, strides, and level of chrominance subsampling.
1097 * Refer to @ref YUVnotes "YUV Image Format Notes" for more details.
1100 * row in the corresponding plane of the YUV image. Setting the stride for any
1102 * "YUV Image Format Notes".) If `strides` is NULL, then the strides for all
1103 * planes will be set to their respective plane widths. You can adjust the
1105 * to encode an RGB or grayscale image into a subregion of a larger planar YUV
1106 * image.
1109 * generating the YUV image (see @ref TJSAMP
1111 * Video, `subsamp` should be set to @ref TJSAMP_420. This produces an image
1117 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1129 * @return a handle to the newly-created instance, or NULL if an error occurred
1136 * Retrieve information about a JPEG image without decompressing it, or prime
1141 * @param jpegBuf pointer to a byte buffer containing a JPEG image or an
1142 * "abbreviated table specification" (AKA "tables-only") datastream. Passing a
1143 * tables-only datastream to this function primes the decompressor with
1145 * subsequent "abbreviated image" datastreams. This is useful, for instance,
1149 * @param jpegSize size of the JPEG image or tables-only datastream (in bytes)
1152 * pixels) of the JPEG image. If `jpegBuf` points to a tables-only datastream,
1156 * (in pixels) of the JPEG image. If `jpegBuf` points to a tables-only
1160 * level of chrominance subsampling used when the JPEG image was compressed
1162 * a tables-only datastream, then `jpegSubsamp` is ignored.
1166 * image (see @ref TJCS "JPEG colorspaces".) If `jpegBuf` points to a
1167 * tables-only datastream, then `jpegColorspace` is ignored.
1169 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1193 * Decompress a JPEG image into a packed-pixel RGB, grayscale, or CMYK image.
1197 * @param jpegBuf pointer to a byte buffer containing the JPEG image to
1200 * @param jpegSize size of the JPEG image (in bytes)
1202 * @param dstBuf pointer to a buffer that will receive the packed-pixel
1203 * decompressed image. This buffer should normally be `pitch * scaledHeight`
1205 * with the JPEG image height and one of the scaling factors returned by
1209 * @param width desired width (in pixels) of the destination image. If this is
1210 * different than the width of the JPEG image being decompressed, then
1212 * possible image that will fit within the desired width. If `width` is set to
1213 * 0, then only the height will be considered when determining the scaled image
1216 * @param pitch bytes per row in the destination image. Normally this should
1217 * be set to <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt>, if the
1218 * destination image should be unpadded, or
1220 * destination image should be padded to the nearest multiple of 4 bytes, as is
1222 * calling #TJSCALED() with the JPEG image width and one of the scaling factors
1228 * @param height desired height (in pixels) of the destination image. If this
1229 * is different than the height of the JPEG image being decompressed, then
1231 * possible image that will fit within the desired height. If `height` is set
1233 * image size.
1235 * @param pixelFormat pixel format of the destination image (see @ref
1241 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1251 * Decompress a JPEG image into a unified planar YUV image. This function
1253 * planar YUV image is generated instead of a packed-pixel image.
1257 * @param jpegBuf pointer to a byte buffer containing the JPEG image to
1260 * @param jpegSize size of the JPEG image (in bytes)
1263 * decompressed image. Use #tjBufSizeYUV2() to determine the appropriate size
1264 * for this buffer based on the scaled image width, scaled image height, row
1266 * image planes will be stored sequentially in the buffer. (Refer to
1267 * @ref YUVnotes "YUV Image Format Notes".)
1269 * @param width desired width (in pixels) of the YUV image. If this is
1270 * different than the width of the JPEG image being decompressed, then
1272 * possible image that will fit within the desired width. If `width` is set to
1273 * 0, then only the height will be considered when determining the scaled image
1277 * @param align row alignment (in bytes) of the YUV image (must be a power of
1279 * YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.)
1280 * To generate images suitable for X Video, `align` should be set to 4.
1282 * @param height desired height (in pixels) of the YUV image. If this is
1283 * different than the height of the JPEG image being decompressed, then
1285 * possible image that will fit within the desired height. If `height` is set
1287 * image size. If the scaled height is not an even multiple of the MCU block
1294 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1303 * Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image
1305 * conversion step, so a planar YUV image is generated instead of a
1306 * packed-pixel image.
1310 * @param jpegBuf pointer to a byte buffer containing the JPEG image to
1313 * @param jpegSize size of the JPEG image (in bytes)
1315 * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1316 * (or just a Y plane, if decompressing a grayscale image) that will receive
1317 * the decompressed image. These planes can be contiguous or non-contiguous in
1319 * plane based on the scaled image width, scaled image height, strides, and
1321 * "YUV Image Format Notes" for more details.
1323 * @param width desired width (in pixels) of the YUV image. If this is
1324 * different than the width of the JPEG image being decompressed, then
1326 * possible image that will fit within the desired width. If `width` is set to
1327 * 0, then only the height will be considered when determining the scaled image
1332 * row in the corresponding plane of the YUV image. Setting the stride for any
1334 * @ref YUVnotes "YUV Image Format Notes".) If `strides` is NULL, then the
1335 * strides for all planes will be set to their respective scaled plane widths.
1337 * padding to each plane or to decompress the JPEG image into a subregion of a
1338 * larger planar YUV image.
1340 * @param height desired height (in pixels) of the YUV image. If this is
1341 * different than the height of the JPEG image being decompressed, then
1343 * possible image that will fit within the desired height. If `height` is set
1345 * image size. If the scaled height is not an even multiple of the MCU block
1352 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1363 * Decode a unified planar YUV image into a packed-pixel RGB or grayscale
1364 * image. This function performs color conversion (which is accelerated in the
1365 * libjpeg-turbo implementation) but does not execute any of the other steps in
1371 * image to be decoded. The size of this buffer should match the value
1372 * returned by #tjBufSizeYUV2() for the given image width, height, row
1374 * image planes should be stored sequentially in the source buffer. (Refer to
1375 * @ref YUVnotes "YUV Image Format Notes".)
1377 * @param align row alignment (in bytes) of the YUV source image (must be a
1379 * plane of the YUV source image is padded to the nearest multiple of n bytes
1383 * image (see @ref TJSAMP "Chrominance subsampling options".)
1385 * @param dstBuf pointer to a buffer that will receive the packed-pixel decoded
1386 * image. This buffer should normally be `pitch * height` bytes in size, but
1392 * @param pitch bytes per row in the destination image. Normally this should
1393 * be set to <tt>width * #tjPixelSize[pixelFormat]</tt>, if the destination
1394 * image should be unpadded, or
1396 * destination image should be padded to the nearest multiple of 4 bytes, as is
1403 * @param pixelFormat pixel format of the destination image (see @ref TJPF
1409 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1419 * Decode a set of Y, U (Cb), and V (Cr) image planes into a packed-pixel RGB
1420 * or grayscale image. This function performs color conversion (which is
1421 * accelerated in the libjpeg-turbo implementation) but does not execute any of
1426 * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
1427 * (or just a Y plane, if decoding a grayscale image) that contain a YUV image
1428 * to be decoded. These planes can be contiguous or non-contiguous in memory.
1430 * for the given image width, height, strides, and level of chrominance
1431 * subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" for more
1435 * row in the corresponding plane of the YUV source image. Setting the stride
1437 * @ref YUVnotes "YUV Image Format Notes".) If `strides` is NULL, then the
1438 * strides for all planes will be set to their respective plane widths. You
1440 * padding in each plane or to decode a subregion of a larger planar YUV image.
1443 * image (see @ref TJSAMP "Chrominance subsampling options".)
1445 * @param dstBuf pointer to a buffer that will receive the packed-pixel decoded
1446 * image. This buffer should normally be `pitch * height` bytes in size, but
1452 * @param pitch bytes per row in the destination image. Normally this should
1453 * be set to <tt>width * #tjPixelSize[pixelFormat]</tt>, if the destination
1454 * image should be unpadded, or
1456 * destination image should be padded to the nearest multiple of 4 bytes, as is
1463 * @param pixelFormat pixel format of the destination image (see @ref TJPF
1469 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1482 * @return a handle to the newly-created instance, or NULL if an error
1489 * Losslessly transform a JPEG image into another JPEG image. Lossless
1490 * transforms work by moving the raw DCT coefficients from one JPEG image
1492 * this is typically faster than decompressing the image, transforming it, and
1493 * re-compressing it, lossless transforms are not free. Each lossless
1495 * coefficients in the source image, regardless of the size of the destination
1496 * image. Thus, this function provides a means of generating multiple
1503 * @param jpegBuf pointer to a byte buffer containing the JPEG source image to
1506 * @param jpegSize size of the JPEG source image (in bytes)
1511 * receive a JPEG image that has been transformed using the parameters in
1513 * destination buffer to accommodate the size of the transformed JPEG image.
1515 * -# pre-allocate the JPEG destination buffer with an arbitrary size using
1517 * -# set `dstBufs[i]` to NULL to tell TurboJPEG to allocate the buffer for
1519 * -# pre-allocate the buffer to a "worst case" size determined by calling
1522 * re-allocated. (Setting #TJFLAG_NOREALLOC guarantees that it won't be.)
1525 * transformed JPEG image will be larger than the worst-case size, and
1528 * If you choose option 1, then `dstSizes[i]` should be set to the size of your
1529 * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
1534 * receive the actual sizes (in bytes) of each transformed JPEG image. If
1535 * `dstBufs[i]` points to a pre-allocated buffer, then `dstSizes[i]` should be
1536 * set to the size of the buffer. Upon return, `dstSizes[i]` will contain the
1537 * size of the transformed JPEG image (in bytes.)
1541 * corresponding transformed JPEG image.
1546 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2()
1561 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2().)
1574 * @return a pointer to a newly-allocated buffer with the specified number of
1583 * Load a packed-pixel image from disk into memory.
1585 * @param filename name of a file containing a packed-pixel image in Windows
1589 * pixels) of the packed-pixel image
1591 * @param align row alignment of the packed-pixel buffer to be returned (must
1596 * (in pixels) of the packed-pixel image
1599 * receive the pixel format of the packed-pixel buffer. The behavior of
1602 * - @ref TJPF_UNKNOWN : The packed-pixel buffer returned by this function will
1606 * - @ref TJPF_GRAY : Only PGM files and 8-bit-per-pixel BMP files with a
1608 * - @ref TJPF_CMYK : The RGB or grayscale pixels stored in the file will be
1612 * - Other @ref TJPF "pixel formats" : The packed-pixel buffer will use the
1619 * @return a pointer to a newly-allocated buffer containing the packed-pixel
1620 * image, converted to the chosen pixel format and with the chosen row
1630 * Save a packed-pixel image from memory to disk.
1632 * @param filename name of a file to which to save the packed-pixel image. The
1633 * image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending
1636 * @param buffer pointer to a buffer containing a packed-pixel RGB, grayscale,
1637 * or CMYK image to be saved
1639 * @param width width (in pixels) of the packed-pixel image
1641 * @param pitch bytes per row in the packed-pixel image. Setting this
1645 * @param height height (in pixels) of the packed-pixel image
1647 * @param pixelFormat pixel format of the packed-pixel image (see @ref TJPF
1648 * "Pixel formats".) If this parameter is set to @ref TJPF_GRAY, then the
1649 * image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format.
1650 * Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format.
1651 * If this parameter is set to @ref TJPF_CMYK, then the CMYK pixels will be
1659 * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2().)
1686 * is thread-safe only on platforms that support thread-local storage.)