diff --git a/ChangeLog.md b/ChangeLog.md index f12ad387..5e385bb5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,4 @@ -1.6 pre-beta +2.0 pre-beta ============ ### Significant changes relative to 1.5.3: diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 8172f55f..50286d27 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -24,7 +24,7 @@
Functions | |
| DLLEXPORT tjhandle DLLCALL | tjInitCompress (void) |
| Create a TurboJPEG compressor instance. More... | |
| DLLEXPORT int DLLCALL | tjCompress2 (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags) |
| Compress an RGB, grayscale, or CMYK image into a JPEG image. More... | |
| DLLEXPORT int DLLCALL | tjCompressFromYUV (tjhandle handle, const unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags) |
| Compress a YUV planar image into a JPEG image. More... | |
| DLLEXPORT int DLLCALL | tjCompressFromYUVPlanes (tjhandle handle, const unsigned char **srcPlanes, int width, const int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags) |
| Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. More... | |
| DLLEXPORT unsigned long DLLCALL | tjBufSize (int width, int height, int jpegSubsamp) |
| The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. More... | |
| DLLEXPORT unsigned long DLLCALL | tjBufSizeYUV2 (int width, int pad, int height, int subsamp) |
| The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. More... | |
| DLLEXPORT unsigned long DLLCALL | tjPlaneSizeYUV (int componentID, int width, int stride, int height, int subsamp) |
| The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. More... | |
| DLLEXPORT tjhandle | tjInitCompress (void) |
| Create a TurboJPEG compressor instance. More... | |
| DLLEXPORT int | tjCompress2 (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags) |
| Compress an RGB, grayscale, or CMYK image into a JPEG image. More... | |
| DLLEXPORT int | tjCompressFromYUV (tjhandle handle, const unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags) |
| Compress a YUV planar image into a JPEG image. More... | |
| DLLEXPORT int | tjCompressFromYUVPlanes (tjhandle handle, const unsigned char **srcPlanes, int width, const int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags) |
| Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. More... | |
| DLLEXPORT unsigned long | tjBufSize (int width, int height, int jpegSubsamp) |
| The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. More... | |
| DLLEXPORT unsigned long | tjBufSizeYUV2 (int width, int pad, int height, int subsamp) |
| The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. More... | |
| DLLEXPORT unsigned long | tjPlaneSizeYUV (int componentID, int width, int stride, int height, int subsamp) |
| The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. More... | |
| DLLEXPORT int | tjPlaneWidth (int componentID, int width, int subsamp) |
| The plane width of a YUV image plane with the given parameters. More... | |
| DLLEXPORT int | tjPlaneHeight (int componentID, int height, int subsamp) |
| The plane height of a YUV image plane with the given parameters. More... | |
| DLLEXPORT int DLLCALL | tjEncodeYUV3 (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags) |
| Encode an RGB or grayscale image into a YUV planar image. More... | |
| DLLEXPORT int DLLCALL | tjEncodeYUVPlanes (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags) |
| Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. More... | |
| DLLEXPORT tjhandle DLLCALL | tjInitDecompress (void) |
| Create a TurboJPEG decompressor instance. More... | |
| DLLEXPORT int DLLCALL | tjDecompressHeader3 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace) |
| Retrieve information about a JPEG image without decompressing it. More... | |
| DLLEXPORT tjscalingfactor *DLLCALL | tjGetScalingFactors (int *numscalingfactors) |
| Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. More... | |
| DLLEXPORT int DLLCALL | tjDecompress2 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decompress a JPEG image to an RGB, grayscale, or CMYK image. More... | |
| DLLEXPORT int DLLCALL | tjDecompressToYUV2 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags) |
| Decompress a JPEG image to a YUV planar image. More... | |
| DLLEXPORT int DLLCALL | tjDecompressToYUVPlanes (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags) |
| Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. More... | |
| DLLEXPORT int DLLCALL | tjDecodeYUV (tjhandle handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decode a YUV planar image into an RGB or grayscale image. More... | |
| DLLEXPORT int DLLCALL | tjDecodeYUVPlanes (tjhandle handle, const unsigned char **srcPlanes, const int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. More... | |
| DLLEXPORT tjhandle DLLCALL | tjInitTransform (void) |
| Create a new TurboJPEG transformer instance. More... | |
| DLLEXPORT int DLLCALL | tjTransform (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags) |
| Losslessly transform a JPEG image into another JPEG image. More... | |
| DLLEXPORT int DLLCALL | tjDestroy (tjhandle handle) |
| Destroy a TurboJPEG compressor, decompressor, or transformer instance. More... | |
| DLLEXPORT unsigned char *DLLCALL | tjAlloc (int bytes) |
| Allocate an image buffer for use with TurboJPEG. More... | |
| DLLEXPORT unsigned char *DLLCALL | tjLoadImage (const char *filename, int *width, int align, int *height, int *pixelFormat, int flags) |
| Load an uncompressed image from disk into memory. More... | |
| DLLEXPORT int DLLCALL | tjSaveImage (const char *filename, unsigned char *buffer, int width, int pitch, int height, int pixelFormat, int flags) |
| Save an uncompressed image from memory to disk. More... | |
| DLLEXPORT void DLLCALL | tjFree (unsigned char *buffer) |
| Free an image buffer previously allocated by TurboJPEG. More... | |
| DLLEXPORT char *DLLCALL | tjGetErrorStr2 (tjhandle handle) |
| Returns a descriptive error message explaining why the last command failed. More... | |
| DLLEXPORT int DLLCALL | tjGetErrorCode (tjhandle handle) |
| Returns a code indicating the severity of the last error. More... | |
| DLLEXPORT int | tjEncodeYUV3 (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags) |
| Encode an RGB or grayscale image into a YUV planar image. More... | |
| DLLEXPORT int | tjEncodeYUVPlanes (tjhandle handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags) |
| Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. More... | |
| DLLEXPORT tjhandle | tjInitDecompress (void) |
| Create a TurboJPEG decompressor instance. More... | |
| DLLEXPORT int | tjDecompressHeader3 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace) |
| Retrieve information about a JPEG image without decompressing it. More... | |
| DLLEXPORT tjscalingfactor * | tjGetScalingFactors (int *numscalingfactors) |
| Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. More... | |
| DLLEXPORT int | tjDecompress2 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decompress a JPEG image to an RGB, grayscale, or CMYK image. More... | |
| DLLEXPORT int | tjDecompressToYUV2 (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags) |
| Decompress a JPEG image to a YUV planar image. More... | |
| DLLEXPORT int | tjDecompressToYUVPlanes (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags) |
| Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. More... | |
| DLLEXPORT int | tjDecodeYUV (tjhandle handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decode a YUV planar image into an RGB or grayscale image. More... | |
| DLLEXPORT int | tjDecodeYUVPlanes (tjhandle handle, const unsigned char **srcPlanes, const int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags) |
| Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. More... | |
| DLLEXPORT tjhandle | tjInitTransform (void) |
| Create a new TurboJPEG transformer instance. More... | |
| DLLEXPORT int | tjTransform (tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags) |
| Losslessly transform a JPEG image into another JPEG image. More... | |
| DLLEXPORT int | tjDestroy (tjhandle handle) |
| Destroy a TurboJPEG compressor, decompressor, or transformer instance. More... | |
| DLLEXPORT unsigned char * | tjAlloc (int bytes) |
| Allocate an image buffer for use with TurboJPEG. More... | |
| DLLEXPORT unsigned char * | tjLoadImage (const char *filename, int *width, int align, int *height, int *pixelFormat, int flags) |
| Load an uncompressed image from disk into memory. More... | |
| DLLEXPORT int | tjSaveImage (const char *filename, unsigned char *buffer, int width, int pitch, int height, int pixelFormat, int flags) |
| Save an uncompressed image from memory to disk. More... | |
| DLLEXPORT void | tjFree (unsigned char *buffer) |
| Free an image buffer previously allocated by TurboJPEG. More... | |
| DLLEXPORT char * | tjGetErrorStr2 (tjhandle handle) |
| Returns a descriptive error message explaining why the last command failed. More... | |
| DLLEXPORT int | tjGetErrorCode (tjhandle handle) |
| Returns a code indicating the severity of the last error. More... | |
Variables |
This option will prevent tjTransform() from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image.
+This option will prevent tjTransform() from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image.
This option will enable lossless cropping.
-See tjTransform() for more information.
+See tjTransform() for more information.
This option will prevent tjTransform() from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.)
+This option will prevent tjTransform() from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.)
This option will cause tjTransform() to return an error if the transform is not perfect.
+This option will cause tjTransform() to return an error if the transform is not perfect.
Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see tjMCUWidth and tjMCUHeight.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image.
This option will cause tjTransform() to discard any partial MCU blocks that cannot be transformed.
+This option will cause tjTransform() to discard any partial MCU blocks that cannot be transformed.
Unknown pixel format.
-Currently this is only used by tjLoadImage().
+Currently this is only used by tjLoadImage().
Transform operations for tjTransform()
+Transform operations for tjTransform()
| Enumerator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TJXOP_NONE |
Do not transform the position of the image pixels. @@ -930,12 +930,12 @@ Variables | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DLLEXPORT unsigned char* DLLCALL tjAlloc | +DLLEXPORT unsigned char* tjAlloc | ( | int | bytes | ) | @@ -953,16 +953,16 @@ Variables
| DLLEXPORT unsigned long DLLCALL tjBufSize | +DLLEXPORT unsigned long tjBufSize | ( | int | width, | @@ -1001,12 +1001,12 @@ Variables
| DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2 | +DLLEXPORT unsigned long tjBufSizeYUV2 | ( | int | width, | @@ -1051,12 +1051,12 @@ Variables
| DLLEXPORT int DLLCALL tjCompress2 | +DLLEXPORT int tjCompress2 | ( | tjhandle | handle, | @@ -1139,9 +1139,9 @@ Variables
| height | height (in pixels) of the source image | |||
| pixelFormat | pixel format of the source image (see Pixel formats.) | |||
| jpegBuf | address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:
*jpegSize should be set to the size of your pre-allocated buffer. In any case, unless you have set TJFLAG_NOREALLOC, you should always check *jpegBuf upon return from this function, as it may have changed. | |||
| jpegSize | pointer to an unsigned long variable that holds the size of the JPEG image buffer. If *jpegBuf points to a pre-allocated buffer, then *jpegSize should be set to the size of the buffer. Upon return, *jpegSize will contain the size of the JPEG image (in bytes.) If *jpegBuf points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then *jpegSize is ignored. |
| DLLEXPORT int DLLCALL tjCompressFromYUV | +DLLEXPORT int tjCompressFromYUV | ( | tjhandle | handle, | @@ -1231,15 +1231,15 @@ If you choose option 1,
| handle | a handle to a TurboJPEG compressor or transformer instance |
| srcBuf | pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) |
| srcBuf | pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) |
| width | width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG. |
| pad | the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then pad should be set to 4. |
| height | height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG. |
| subsamp | the level of chrominance subsampling used in the source image (see Chrominance subsampling options.) |
| jpegBuf | address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:
*jpegSize should be set to the size of your pre-allocated buffer. In any case, unless you have set TJFLAG_NOREALLOC, you should always check *jpegBuf upon return from this function, as it may have changed. |
| jpegSize | pointer to an unsigned long variable that holds the size of the JPEG image buffer. If *jpegBuf points to a pre-allocated buffer, then *jpegSize should be set to the size of the buffer. Upon return, *jpegSize will contain the size of the JPEG image (in bytes.) If *jpegBuf points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then *jpegSize is ignored. |
| DLLEXPORT int DLLCALL tjCompressFromYUVPlanes | +DLLEXPORT int tjCompressFromYUVPlanes | ( | tjhandle | handle, | @@ -1328,15 +1328,15 @@ If you choose option 1,
| handle | a handle to a TurboJPEG compressor or transformer instance |
| srcPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. |
| srcPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. |
| width | width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG. |
| strides | an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image. |
| height | height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG. |
| subsamp | the level of chrominance subsampling used in the source image (see Chrominance subsampling options.) |
| jpegBuf | address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:
*jpegSize should be set to the size of your pre-allocated buffer. In any case, unless you have set TJFLAG_NOREALLOC, you should always check *jpegBuf upon return from this function, as it may have changed. |
| jpegSize | pointer to an unsigned long variable that holds the size of the JPEG image buffer. If *jpegBuf points to a pre-allocated buffer, then *jpegSize should be set to the size of the buffer. Upon return, *jpegSize will contain the size of the JPEG image (in bytes.) If *jpegBuf points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then *jpegSize is ignored. |
| DLLEXPORT int DLLCALL tjDecodeYUV | +DLLEXPORT int tjDecodeYUV | ( | tjhandle | handle, | @@ -1426,7 +1426,7 @@ If you choose option 1,
| handle | a handle to a TurboJPEG decompressor or transformer instance |
| srcBuf | pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) |
| srcBuf | pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by tjBufSizeYUV2() for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to YUV Image Format Notes.) |
| pad | Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.) |
| subsamp | the level of chrominance subsampling used in the YUV source image (see Chrominance subsampling options.) |
| dstBuf | pointer to an image buffer that will receive the decoded image. This buffer should normally be pitch * height bytes in size, but the dstBuf pointer can also be used to decode into a specific region of a larger buffer. |
| DLLEXPORT int DLLCALL tjDecodeYUVPlanes | +DLLEXPORT int tjDecodeYUVPlanes | ( | tjhandle | handle, | @@ -1519,7 +1519,7 @@ If you choose option 1,
| handle | a handle to a TurboJPEG decompressor or transformer instance |
| srcPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. |
| srcPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by tjPlaneSizeYUV() for the given image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. |
| strides | an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image. |
| subsamp | the level of chrominance subsampling used in the YUV source image (see Chrominance subsampling options.) |
| dstBuf | pointer to an image buffer that will receive the decoded image. This buffer should normally be pitch * height bytes in size, but the dstBuf pointer can also be used to decode into a specific region of a larger buffer. |
| DLLEXPORT int DLLCALL tjDecompress2 | +DLLEXPORT int tjDecompress2 | ( | tjhandle | handle, | @@ -1607,25 +1607,25 @@ If you choose option 1,
| handle | a handle to a TurboJPEG decompressor or transformer instance | |||
| jpegBuf | pointer to a buffer containing the JPEG image to decompress | |||
| jpegSize | size of the JPEG image (in bytes) | |||
| dstBuf | pointer to an image buffer that will receive the decompressed image. This buffer should normally be pitch * scaledHeight bytes in size, where scaledHeight can be determined by calling TJSCALED() with the JPEG image height and one of the scaling factors returned by tjGetScalingFactors(). The dstBuf pointer may also be used to decompress into a specific region of a larger buffer. | |||
| dstBuf | pointer to an image buffer that will receive the decompressed image. This buffer should normally be pitch * scaledHeight bytes in size, where scaledHeight can be determined by calling TJSCALED() with the JPEG image height and one of the scaling factors returned by tjGetScalingFactors(). The dstBuf pointer may also be used to decompress into a specific region of a larger buffer. | |||
| width | desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. | |||
| pitch | bytes per line in the destination image. Normally, this is scaledWidth * tjPixelSize[pixelFormat] if the decompressed image is unpadded, else TJPAD(scaledWidth * tjPixelSize[pixelFormat]) if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: scaledWidth can be determined by calling TJSCALED() with the JPEG image width and one of the scaling factors returned by tjGetScalingFactors().) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to scaledWidth * tjPixelSize[pixelFormat]. | |||
| pitch | bytes per line in the destination image. Normally, this is scaledWidth * tjPixelSize[pixelFormat] if the decompressed image is unpadded, else TJPAD(scaledWidth * tjPixelSize[pixelFormat]) if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: scaledWidth can be determined by calling TJSCALED() with the JPEG image width and one of the scaling factors returned by tjGetScalingFactors().) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to scaledWidth * tjPixelSize[pixelFormat]. | |||
| height | desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If height is set to 0, then only the width will be considered when determining the scaled image size. | |||
| pixelFormat | pixel format of the destination image (see Pixel formats.) | |||
| flags | the bitwise OR of one or more of the flags |
| DLLEXPORT int DLLCALL tjDecompressHeader3 | +DLLEXPORT int tjDecompressHeader3 | ( | tjhandle | handle, | @@ -1687,16 +1687,16 @@ If you choose option 1,
| DLLEXPORT int DLLCALL tjDecompressToYUV2 | +DLLEXPORT int tjDecompressToYUV2 | ( | tjhandle | handle, | @@ -1758,7 +1758,7 @@ If you choose option 1,
| handle | a handle to a TurboJPEG decompressor or transformer instance | |||
| jpegBuf | pointer to a buffer containing the JPEG image to decompress | |||
| jpegSize | size of the JPEG image (in bytes) | |||
| dstBuf | pointer to an image buffer that will receive the YUV image. Use tjBufSizeYUV2() to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to YUV Image Format Notes.) | |||
| dstBuf | pointer to an image buffer that will receive the YUV image. Use tjBufSizeYUV2() to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to YUV Image Format Notes.) | |||
| width | desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG. | |||
| pad | the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, pad should be set to 4. | |||
| height | desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If height is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG. |
| DLLEXPORT int DLLCALL tjDecompressToYUVPlanes | +DLLEXPORT int tjDecompressToYUVPlanes | ( | tjhandle | handle, | @@ -1837,7 +1837,7 @@ If you choose option 1,
| handle | a handle to a TurboJPEG decompressor or transformer instance | |||
| jpegBuf | pointer to a buffer containing the JPEG image to decompress | |||
| jpegSize | size of the JPEG image (in bytes) | |||
| dstPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use tjPlaneSizeYUV() to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. | |||
| dstPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use tjPlaneSizeYUV() to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. | |||
| width | desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If width is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see tjMCUWidth), then an intermediate buffer copy will be performed within TurboJPEG. | |||
| strides | an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image. | |||
| height | desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If height is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG. |
| DLLEXPORT int DLLCALL tjDestroy | +DLLEXPORT int tjDestroy | ( | tjhandle | handle | ) | @@ -1870,16 +1870,16 @@ If you choose option 1,
| DLLEXPORT int DLLCALL tjEncodeYUV3 | +DLLEXPORT int tjEncodeYUV3 | ( | tjhandle | handle, | @@ -1956,23 +1956,23 @@ If you choose option 1,
| pitch | bytes per line in the source image. Normally, this should be width * tjPixelSize[pixelFormat] if the image is unpadded, or TJPAD(width * tjPixelSize[pixelFormat]) if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows 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 width * tjPixelSize[pixelFormat]. | |||
| height | height (in pixels) of the source image | |||
| pixelFormat | pixel format of the source image (see Pixel formats.) | |||
| dstBuf | pointer to an image buffer that will receive the YUV image. Use tjBufSizeYUV2() to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to YUV Image Format Notes.) | |||
| dstBuf | pointer to an image buffer that will receive the YUV image. Use tjBufSizeYUV2() to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to YUV Image Format Notes.) | |||
| pad | the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, pad should be set to 4. | |||
| subsamp | the level of chrominance subsampling to be used when generating the YUV image (see Chrominance subsampling options.) To generate images suitable for X Video, subsamp should be set to TJSAMP_420. This produces an image compatible with the I420 (AKA "YUV420P") format. | |||
| flags | the bitwise OR of one or more of the flags |
| DLLEXPORT int DLLCALL tjEncodeYUVPlanes | +DLLEXPORT int tjEncodeYUVPlanes | ( | tjhandle | handle, | @@ -2049,23 +2049,23 @@ If you choose option 1,
| pitch | bytes per line in the source image. Normally, this should be width * tjPixelSize[pixelFormat] if the image is unpadded, or TJPAD(width * tjPixelSize[pixelFormat]) if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows 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 width * tjPixelSize[pixelFormat]. | |||
| height | height (in pixels) of the source image | |||
| pixelFormat | pixel format of the source image (see Pixel formats.) | |||
| dstPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use tjPlaneSizeYUV() to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. | |||
| dstPlanes | an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use tjPlaneSizeYUV() to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to YUV Image Format Notes for more details. | |||
| strides | an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see YUV Image Format Notes.) If strides is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image. | |||
| subsamp | the level of chrominance subsampling to be used when generating the YUV image (see Chrominance subsampling options.) To generate images suitable for X Video, subsamp should be set to TJSAMP_420. This produces an image compatible with the I420 (AKA "YUV420P") format. | |||
| flags | the bitwise OR of one or more of the flags |
| DLLEXPORT void DLLCALL tjFree | +DLLEXPORT void tjFree | ( | unsigned char * | buffer | ) | @@ -2075,23 +2075,23 @@ If you choose option 1,
| buffer | address of the buffer to free |
| DLLEXPORT int DLLCALL tjGetErrorCode | +DLLEXPORT int tjGetErrorCode | ( | tjhandle | handle | ) | @@ -2112,12 +2112,12 @@ If you choose option 1,
| DLLEXPORT char* DLLCALL tjGetErrorStr2 | +DLLEXPORT char* tjGetErrorStr2 | ( | tjhandle | handle | ) | @@ -2137,12 +2137,12 @@ If you choose option 1,
| DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors | +DLLEXPORT tjscalingfactor* tjGetScalingFactors | ( | int * | numscalingfactors | ) | @@ -2158,16 +2158,16 @@ If you choose option 1,
| DLLEXPORT tjhandle DLLCALL tjInitCompress | +DLLEXPORT tjhandle tjInitCompress | ( | void | ) | @@ -2177,16 +2177,16 @@ If you choose option 1,
| DLLEXPORT tjhandle DLLCALL tjInitDecompress | +DLLEXPORT tjhandle tjInitDecompress | ( | void | ) | @@ -2196,16 +2196,16 @@ If you choose option 1,
| DLLEXPORT tjhandle DLLCALL tjInitTransform | +DLLEXPORT tjhandle tjInitTransform | ( | void | ) | @@ -2215,16 +2215,16 @@ If you choose option 1,
| DLLEXPORT unsigned char* DLLCALL tjLoadImage | +DLLEXPORT unsigned char* tjLoadImage | ( | const char * | filename, | @@ -2274,7 +2274,7 @@ If you choose option 1,
| width | pointer to an integer variable that will receive the width (in pixels) of the uncompressed image | |||
| align | row alignment of the image buffer to be returned (must be a power of 2.) For instance, setting this parameter to 4 will cause all rows in the image buffer to be padded to the nearest 32-bit boundary, and setting this parameter to 1 will cause all rows in the image buffer to be unpadded. | |||
| height | pointer to an integer variable that will receive the height (in pixels) of the uncompressed image | |||
| pixelFormat | pointer to an integer variable that specifies or will receive the pixel format of the uncompressed image buffer. The behavior of tjLoadImage() will vary depending on the value of *pixelFormat passed to the function:
pixelFormat | pointer to an integer variable that specifies or will receive the pixel format of the uncompressed image buffer. The behavior of tjLoadImage() will vary depending on the value of | *pixelFormat passed to the function:*jpegSize should be set to the size of your
|
*jpegSize should be set to the size of your
-
+
| DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV | +DLLEXPORT unsigned long tjPlaneSizeYUV | ( | int | componentID, | @@ -2434,12 +2434,12 @@ If you choose option 1,
| DLLEXPORT int DLLCALL tjSaveImage | +DLLEXPORT int tjSaveImage | ( | const char * | filename, | @@ -2501,16 +2501,16 @@ If you choose option 1,
| DLLEXPORT int DLLCALL tjTransform | +DLLEXPORT int tjTransform | ( | tjhandle | handle, | @@ -2574,9 +2574,9 @@ If you choose option 1,
| jpegSize | size of the JPEG source image (in bytes) | |||
| n | the number of transformed JPEG images to generate | |||
| dstBufs | pointer to an array of n image buffers. dstBufs[i] will receive a JPEG image that has been transformed using the parameters in transforms[i]. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:
dstSizes[i] should be set to the size of your pre-allocated buffer. In any case, unless you have set TJFLAG_NOREALLOC, you should always check dstBufs[i] upon return from this function, as it may have changed. | |||
| dstSizes | pointer to an array of n unsigned long variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If dstBufs[i] points to a pre-allocated buffer, then dstSizes[i] should be set to the size of the buffer. Upon return, dstSizes[i] will contain the size of the JPEG image (in bytes.) |
coeffs as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.coeffs belongscoeffs belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.)coeffs belongs. This is the same as the index of the transform in the transforms array that was passed to tjTransform().coeffs belongs. This is the same as the index of the transform in the transforms array that was passed to tjTransform().