Wordsmithing

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@410 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-02-19 16:42:14 +00:00
parent db8df01c85
commit 3e87c8b0a4

View File

@@ -111,40 +111,40 @@ DLLEXPORT tjhandle DLLCALL tjInitCompress(void);
[INPUT] j = instance handle previously returned from a call to [INPUT] j = instance handle previously returned from a call to
tjInitCompress() tjInitCompress()
[INPUT] srcbuf = pointer to user-allocated image buffer containing pixels in [INPUT] srcbuf = pointer to user-allocated image buffer containing RGB or
RGB(A) or BGR(A) form grayscale pixels to be compressed
[INPUT] width = width (in pixels) of the source image [INPUT] width = width (in pixels) of the source image
[INPUT] pitch = bytes per line of the source image (width*pixelsize if the [INPUT] pitch = bytes per line of the source image (width*pixelsize if the
bitmap is unpadded, else TJPAD(width*pixelsize) if each line of the bitmap bitmap is unpadded, else TJPAD(width*pixelsize) if each line of the bitmap
is padded to the nearest 32-bit boundary, such as is the case for Windows is padded to the nearest 32-bit boundary, such as is the case for Windows
bitmaps. You can also be clever and use this parameter to skip lines, bitmaps. You can also be clever and use this parameter to skip lines,
etc. Setting this parameter to 0 is the equivalent of setting it to etc. Setting this parameter to 0 is the equivalent of setting it to
width*pixelsize; width*pixelsize.
[INPUT] height = height (in pixels) of the source image [INPUT] height = height (in pixels) of the source image
[INPUT] pixelsize = size (in bytes) of each pixel in the source image [INPUT] pixelsize = size (in bytes) of each pixel in the source image
RGBA and BGRA: 4, RGB and BGR: 3, Grayscale: 1 RGBX/BGRX/XRGB/XBGR: 4, RGB/BGR: 3, Grayscale: 1
[INPUT] dstbuf = pointer to user-allocated image buffer which will receive [INPUT] dstbuf = pointer to user-allocated image buffer which will receive
the JPEG image. Use the macro TJBUFSIZE(width, height) to determine the JPEG image. Use the TJBUFSIZE(width, height) function to determine
the appropriate size for this buffer based on the image width and height. the appropriate size for this buffer based on the image width and height.
[OUTPUT] size = pointer to unsigned long which receives the size (in bytes) [OUTPUT] size = pointer to unsigned long which receives the size (in bytes)
of the compressed image of the compressed image
[INPUT] jpegsubsamp = Specifies either 4:2:0, 4:2:2, or 4:4:4 subsampling. [INPUT] jpegsubsamp = Specifies either 4:2:0, 4:2:2, or 4:4:4 subsampling.
When the image is converted from the RGB to YCbCr colorspace as part of the When the image is converted from the RGB to YCbCr colorspace as part of
JPEG compression process, every other Cb and Cr (chrominance) pixel can be the JPEG compression process, every other Cb and Cr (chrominance) pixel
discarded to produce a smaller image with little perceptible loss of can be discarded to produce a smaller image with little perceptible loss
image clarity (the human eye is more sensitive to small changes in of image clarity (the human eye is more sensitive to small changes in
brightness than small changes in color.) brightness than small changes in color.)
TJ_420: 4:2:0 subsampling. Discards every other Cb, Cr pixel in both TJ_420: 4:2:0 subsampling. Discards every other Cb, Cr pixel in both
horizontal and vertical directions. horizontal and vertical directions
TJ_422: 4:2:2 subsampling. Discards every other Cb, Cr pixel only in TJ_422: 4:2:2 subsampling. Discards every other Cb, Cr pixel only in
the horizontal direction. the horizontal direction
TJ_444: no subsampling. TJ_444: no subsampling
TJ_GRAYSCALE: Generate grayscale JPEG image TJ_GRAYSCALE: Generate grayscale JPEG image
[INPUT] jpegqual = JPEG quality (an integer between 0 and 100 inclusive.) [INPUT] jpegqual = JPEG quality (an integer between 0 and 100 inclusive)
[INPUT] flags = the bitwise OR of one or more of the flags described in the [INPUT] flags = the bitwise OR of one or more of the flags described in the
"Flags" section above. "Flags" section above
RETURNS: 0 on success, -1 on error RETURNS: 0 on success, -1 on error
*/ */
@@ -172,7 +172,7 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
/* /*
int tjDecompressHeader2(tjhandle j, int tjDecompressHeader2(tjhandle j,
unsigned char *srcbuf, unsigned long size, unsigned char *srcbuf, unsigned long size,
int *width, int *height, int *jpegsub) int *width, int *height, int *jpegsubsamp)
[INPUT] j = instance handle previously returned from a call to [INPUT] j = instance handle previously returned from a call to
tjInitDecompress() tjInitDecompress()
@@ -181,14 +181,14 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
[INPUT] size = size of the JPEG image buffer (in bytes) [INPUT] size = size of the JPEG image buffer (in bytes)
[OUTPUT] width = width (in pixels) of the JPEG image [OUTPUT] width = width (in pixels) of the JPEG image
[OUTPUT] height = height (in pixels) of the JPEG image [OUTPUT] height = height (in pixels) of the JPEG image
[OUTPUT] jpegsub = type of chrominance subsampling used when compressing the [OUTPUT] jpegsubsamp = type of chrominance subsampling used when compressing
JPEG image the JPEG image
RETURNS: 0 on success, -1 on error RETURNS: 0 on success, -1 on error
*/ */
DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle j, DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle j,
unsigned char *srcbuf, unsigned long size, unsigned char *srcbuf, unsigned long size,
int *width, int *height, int *jpegsub); int *width, int *height, int *jpegsubsamp);
/* /*
Legacy version of the above function Legacy version of the above function
@@ -214,15 +214,15 @@ DLLEXPORT int DLLCALL tjDecompressHeader(tjhandle j,
bytes in size, although this pointer may also be used to decompress into bytes in size, although this pointer may also be used to decompress into
a specific region of a larger buffer. a specific region of a larger buffer.
[INPUT] width = width (in pixels) of the destination image [INPUT] width = width (in pixels) of the destination image
[INPUT] pitch = bytes per line of the destination image (width*pixelsize if the [INPUT] pitch = bytes per line of the destination image (width*pixelsize if
bitmap is unpadded, else TJPAD(width*pixelsize) if each line of the bitmap the bitmap is unpadded, else TJPAD(width*pixelsize) if each line of the
is padded to the nearest 32-bit boundary, such as is the case for Windows bitmap is padded to the nearest 32-bit boundary, such as is the case for
bitmaps. You can also be clever and use this parameter to skip lines, Windows bitmaps. You can also be clever and use this parameter to skip
etc. Setting this parameter to 0 is the equivalent of setting it to lines, etc. Setting this parameter to 0 is the equivalent of setting it
width*pixelsize. to width*pixelsize.
[INPUT] height = height (in pixels) of the destination image [INPUT] height = height (in pixels) of the destination image
[INPUT] pixelsize = size (in bytes) of each pixel in the destination image [INPUT] pixelsize = size (in bytes) of each pixel in the destination image
RGBA/RGBx and BGRA/BGRx: 4, RGB and BGR: 3, Grayscale: 1 RGBX/BGRX/XRGB/XBGR: 4, RGB/BGR: 3, Grayscale: 1
[INPUT] flags = the bitwise OR of one or more of the flags described in the [INPUT] flags = the bitwise OR of one or more of the flags described in the
"Flags" section above. "Flags" section above.