When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec.
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.)
When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec. More...
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.) More...
tjCompress2 (tjhandle handle, 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 or grayscale image into a JPEG image.
-
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.
The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.
-
DLLEXPORT int DLLCALL
tjEncodeYUV2 (tjhandle handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int subsamp, int flags)
-
Encode an RGB or grayscale image into a YUV planar image.
Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports.
-
DLLEXPORT int DLLCALL
tjDecompress2 (tjhandle handle, 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 or grayscale image.
-
DLLEXPORT int DLLCALL
tjDecompressToYUV (tjhandle handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int flags)
tjTransform (tjhandle handle, 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.
tjCompress2 (tjhandle handle, 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 or grayscale image 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...
The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. More...
+
+
DLLEXPORT int DLLCALL
tjEncodeYUV2 (tjhandle handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int subsamp, int flags)
+
Encode an RGB or grayscale image into a YUV planar image. More...
Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. More...
+
+
DLLEXPORT int DLLCALL
tjDecompress2 (tjhandle handle, 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 or grayscale image. More...
+
+
DLLEXPORT int DLLCALL
tjDecompressToYUV (tjhandle handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int flags)
+
Decompress a JPEG image to a YUV planar image. More...
Create a new TurboJPEG transformer instance. More...
+
+
DLLEXPORT int DLLCALL
tjTransform (tjhandle handle, 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...
Pixel size (in bytes) for a given pixel format. More...
+
-
Detailed Description
+
Detailed Description
TurboJPEG API.
This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.
-
Define Documentation
-
+
Macro Definition Documentation
+
@@ -222,14 +300,13 @@ Variables
#define TJ_NUMPF
-
-
+
The number of pixel formats.
-
+
@@ -237,14 +314,13 @@ Variables
#define TJ_NUMSAMP
-
-
+
The number of chrominance subsampling options.
-
+
@@ -252,14 +328,13 @@ Variables
#define TJ_NUMXOP
-
-
+
The number of transform operations.
-
+
@@ -267,15 +342,14 @@ Variables
#define TJFLAG_ACCURATEDCT
-
-
+
Use the most accurate DCT/IDCT algorithm available in the underlying codec.
The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect.
-
+
@@ -283,14 +357,13 @@ Variables
#define TJFLAG_BOTTOMUP
-
-
+
The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order.
-
+
@@ -298,15 +371,14 @@ Variables
#define TJFLAG_FASTDCT
-
-
+
Use the fastest DCT/IDCT algorithm available in the underlying codec.
The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect.
-
+
@@ -314,15 +386,14 @@ Variables
#define TJFLAG_FASTUPSAMPLE
-
-
+
When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec.
The default is to use smooth upsampling, which creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image.
-
+
@@ -330,14 +401,13 @@ Variables
#define TJFLAG_FORCEMMX
-
-
+
Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the underlying codec supports it.)
-
+
@@ -345,14 +415,13 @@ Variables
#define TJFLAG_FORCESSE
-
-
+
Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the underlying codec supports it.)
-
+
@@ -360,14 +429,13 @@ Variables
#define TJFLAG_FORCESSE2
-
-
+
Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the underlying codec supports it.)
-
+
@@ -375,14 +443,13 @@ Variables
#define TJFLAG_FORCESSE3
-
-
+
Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the underlying codec supports it.)
-
+
@@ -390,15 +457,14 @@ Variables
#define TJFLAG_NOREALLOC
-
-
+
Disable buffer (re)allocation.
If passed to tjCompress2() or tjTransform(), this flag will cause those functions to generate an error if the JPEG image buffer is invalid or too small rather than attempting to allocate or reallocate that buffer. This reproduces the behavior of earlier versions of TurboJPEG.
-
+
@@ -410,14 +476,13 @@ Variables
-
-
+
Pad the given width to the nearest 32-bit boundary.
-
+
@@ -439,15 +504,14 @@ Variables
-
-
+
Compute the scaled value of dimension using the given scaling factor.
This macro performs the integer equivalent of ceil(dimension * scalingFactor).
This option will discard the color data in the input image and produce a grayscale output image.
-
+
@@ -486,14 +548,13 @@ Variables
#define TJXOPT_NOOUTPUT
-
-
+
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.)
-
+
@@ -501,15 +562,14 @@ Variables
#define TJXOPT_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.
-
+
@@ -517,15 +577,14 @@ Variables
#define TJXOPT_TRIM
-
-
+
This option will cause tjTransform() to discard any partial MCU blocks that cannot be transformed.
The red, green, and blue components in the image are stored in 3-byte pixels in the order R, G, B from lowest to highest byte address within each pixel.
-
TJPF_BGR
+
TJPF_BGR
BGR pixel format.
The red, green, and blue components in the image are stored in 3-byte pixels in the order B, G, R from lowest to highest byte address within each pixel.
-
TJPF_RGBX
+
TJPF_RGBX
RGBX pixel format.
The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing.
-
TJPF_BGRX
+
TJPF_BGRX
BGRX pixel format.
The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing.
-
TJPF_XBGR
+
TJPF_XBGR
XBGR pixel format.
The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing.
-
TJPF_XRGB
+
TJPF_XRGB
XRGB pixel format.
The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing.
-
TJPF_GRAY
+
TJPF_GRAY
Grayscale pixel format.
Each 1-byte pixel represents a luminance (brightness) level from 0 to 255.
-
TJPF_RGBA
+
TJPF_RGBA
RGBA pixel format.
This is the same as TJPF_RGBX, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel.
-
TJPF_BGRA
+
TJPF_BGRA
BGRA pixel format.
This is the same as TJPF_BGRX, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel.
-
TJPF_ABGR
+
TJPF_ABGR
ABGR pixel format.
This is the same as TJPF_XBGR, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel.
-
TJPF_ARGB
+
TJPF_ARGB
ARGB pixel format.
This is the same as TJPF_XRGB, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel.
When an image is converted from the RGB to the YUV colorspace as part of the JPEG compression process, some of the U and V (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than small changes in color.) This is called "chrominance subsampling".
-
Enumerator:
-
TJSAMP_444
+
+
Enumerator
TJSAMP_444
4:4:4 chrominance subsampling (no chrominance subsampling).
The JPEG or YUV image will contain one chrominance component for every pixel in the source image.
-
TJSAMP_422
+
TJSAMP_422
4:2:2 chrominance subsampling.
The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image.
-
TJSAMP_420
+
TJSAMP_420
4:2:0 chrominance subsampling.
The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image.
-
TJSAMP_GRAY
+
TJSAMP_GRAY
Grayscale.
The JPEG or YUV image will contain no chrominance components.
-
TJSAMP_440
+
TJSAMP_440
4:4:0 chrominance subsampling.
-
The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.
+
The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image. Note that 4:4:0 subsampling is not fully accelerated in the libjpeg-turbo implementation of TurboJPEG.
Do not transform the position of the image pixels.
-
TJXOP_HFLIP
+
TJXOP_HFLIP
Flip (mirror) image horizontally.
This transform is imperfect if there are any partial MCU blocks on the right edge (see TJXOPT_PERFECT.)
-
TJXOP_VFLIP
+
TJXOP_VFLIP
Flip (mirror) image vertically.
This transform is imperfect if there are any partial MCU blocks on the bottom edge (see TJXOPT_PERFECT.)
-
TJXOP_TRANSPOSE
+
TJXOP_TRANSPOSE
Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect.
-
TJXOP_TRANSVERSE
+
TJXOP_TRANSVERSE
Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see TJXOPT_PERFECT.)
-
TJXOP_ROT90
+
TJXOP_ROT90
Rotate image clockwise by 90 degrees.
This transform is imperfect if there are any partial MCU blocks on the bottom edge (see TJXOPT_PERFECT.)
-
TJXOP_ROT180
+
TJXOP_ROT180
Rotate image 180 degrees.
This transform is imperfect if there are any partial MCU blocks in the image (see TJXOPT_PERFECT.)
-
TJXOP_ROT270
+
TJXOP_ROT270
Rotate image counter-clockwise by 90 degrees.
This transform is imperfect if there are any partial MCU blocks on the right edge (see TJXOPT_PERFECT.)
-
-
-
Function Documentation
-
+
Function Documentation
+
@@ -720,23 +768,22 @@ Variables
-
-
+
Allocate an image buffer for use with TurboJPEG.
You should always use this function to allocate the JPEG destination buffer(s) for tjCompress2() and tjTransform() unless you are disabling automatic buffer (re)allocation (by setting TJFLAG_NOREALLOC.)
-
Parameters:
+
Parameters
bytes
the number of bytes to allocate
-
Returns:
a pointer to a newly-allocated buffer with the specified number of bytes
The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.
The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.
-
Parameters:
+
Parameters
width
width of the image (in pixels)
height
height of the image (in pixels)
@@ -777,11 +823,11 @@ Variables
-
Returns:
the maximum size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds.
+
Returns
the maximum size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds.
-
+
@@ -809,11 +855,10 @@ Variables
-
-
+
The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.
-
Parameters:
+
Parameters
width
width of the image (in pixels)
height
height of the image (in pixels)
@@ -821,11 +866,11 @@ Variables
-
Returns:
the size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds.
+
Returns
the size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds.
-
+
@@ -901,11 +946,10 @@ Variables
-
-
+
Compress an RGB or grayscale image into a JPEG image.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG compressor or transformer instance
srcBuf
pointer to an image buffer containing RGB or grayscale pixels to be compressed
@@ -926,11 +970,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -994,29 +1038,31 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Decompress a JPEG image to an RGB or grayscale image.
-
Parameters:
+
Parameters
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.
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 of 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.)
bytes per line of 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
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.)
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -1062,11 +1108,10 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Retrieve information about a JPEG image without decompressing it.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG decompressor or transformer instance
jpegBuf
pointer to a buffer containing a JPEG image
@@ -1077,11 +1122,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -1121,12 +1166,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Decompress a JPEG image to a YUV planar image.
This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The padding of the planes in this image is the same as in the images generated by tjEncodeYUV2(). Note that, if the width or height of the image is not an even multiple of the MCU block size (see tjMCUWidth and tjMCUHeight), then an intermediate buffer copy will be performed within TurboJPEG.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG decompressor or transformer instance
jpegBuf
pointer to a buffer containing the JPEG image to decompress
@@ -1136,11 +1180,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -1152,21 +1196,20 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Destroy a TurboJPEG compressor, decompressor, or transformer instance.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG compressor, decompressor or transformer instance
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -1230,12 +1273,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Encode an RGB or grayscale image into a YUV planar image.
This function uses the accelerated color conversion routines in TurboJPEG's underlying codec to produce a planar YUV image that is suitable for X Video. Specifically, if the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) Also, each line of each plane in the output image is padded to 4 bytes. Although this will work with any subsampling option, it is really only useful in combination with TJ_420, which produces an image compatible with the I420 (AKA "YUV420P") format.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG compressor or transformer instance
srcBuf
pointer to an image buffer containing RGB or grayscale pixels to be encoded
@@ -1249,11 +1291,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
-
+
@@ -1265,22 +1307,21 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Free an image buffer previously allocated by TurboJPEG.
You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by tjCompress2() or tjTransform() or that were manually allocated using tjAlloc().
@@ -1292,15 +1333,14 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Returns a descriptive error message explaining why the last command failed.
-
Returns:
a descriptive error message explaining why the last command failed.
+
Returns
a descriptive error message explaining why the last command failed.
-
+
@@ -1312,21 +1352,20 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports.
-
Parameters:
+
Parameters
numscalingfactors
pointer to an integer variable that will receive the number of elements in the list
-
Returns:
a pointer to a list of fractional scaling factors, or NULL if an error is encountered (see tjGetErrorStr().)
+
Returns
a pointer to a list of fractional scaling factors, or NULL if an error is encountered (see tjGetErrorStr().)
-
+
@@ -1338,15 +1377,14 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Create a TurboJPEG compressor instance.
-
Returns:
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
+
Returns
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
-
+
@@ -1358,15 +1396,14 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Create a TurboJPEG decompressor instance.
-
Returns:
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
+
Returns
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
-
+
@@ -1378,15 +1415,14 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Create a new TurboJPEG transformer instance.
-
Returns:
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
+
Returns
a handle to the newly-created instance, or NULL if an error occurred (see tjGetErrorStr().)
-
+
@@ -1444,12 +1480,11 @@ If you choose option 1, *jpegSize should be set to the size of your
-
-
+
Losslessly transform a JPEG image into another JPEG image.
Lossless transforms work by moving the raw coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.
-
Parameters:
+
Parameters
handle
a handle to a TurboJPEG transformer instance
jpegBuf
pointer to a buffer containing the JPEG image to transform
@@ -1467,53 +1502,74 @@ If you choose option 1, dstSizes[i] should be set to the size of yo
-
Returns:
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
+
Returns
0 if successful, or -1 if an error occurred (see tjGetErrorStr().)
This specifies the number of bytes that the Blue component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in char pixel[], then the blue component will be pixel[tjBlueOffset[TJ_BGRX]].
This specifies the number of bytes that the green component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in char pixel[], then the green component will be pixel[tjGreenOffset[TJ_BGRX]].
This specifies the number of bytes that the red component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in char pixel[], then the red component will be pixel[tjRedOffset[TJ_BGRX]].
-
-Generated on Fri Apr 26 2013 03:53:12 for TurboJPEG by
-
- 1.7.4
+
+
+
+Generated on Sun Aug 18 2013 04:01:39 for TurboJPEG by
+
+ 1.8.3.1
+
diff --git a/doc/html/index.html b/doc/html/index.html
index 3c85393e..3c2a6622 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -38,6 +38,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
@@ -79,7 +81,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
-Generated on Sun Aug 18 2013 03:59:36 for TurboJPEG by
+Generated on Sun Aug 18 2013 04:01:39 for TurboJPEG by 1.8.3.1
diff --git a/doc/html/modules.html b/doc/html/modules.html
index 6fe4726a..3795ae87 100644
--- a/doc/html/modules.html
+++ b/doc/html/modules.html
@@ -2,35 +2,45 @@
+
+
TurboJPEG: Modules
+
+
-
+
+
-
-
-
-
A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG file.
A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG file. More...
int(* tjtransform::customFilter)(short *coeffs, tjregion arrayRegion, tjregion planeRegion, int componentIndex, int transformIndex, struct tjtransform *transform)
-
-
+
A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG file.
This allows for custom filters or other transformations to be applied in the frequency domain.
-
Parameters:
+
Parameters
coeffs
pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.)
arrayRegion
tjregion structure containing the width and height of the array pointed to by 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.
@@ -109,65 +137,61 @@ Data Fields
-
Returns:
0 if the callback was successful, or -1 if an error occurred.
+
Returns
0 if the callback was successful, or -1 if an error occurred.