Crate turbojpeg_sys

Source

Structs§

max_align_t
tjregion
Cropping region
tjscalingfactor
Scaling factor
tjtransform
Lossless transform

Constants§

NUMSUBOPT
TJCS_TJCS_CMYK
CMYK colorspace
TJCS_TJCS_GRAY
Grayscale colorspace
TJCS_TJCS_RGB
RGB colorspace
TJCS_TJCS_YCCK
YCCK colorspace
TJCS_TJCS_YCbCr
YCbCr colorspace
TJERR_TJERR_FATAL
The error was fatal and non-recoverable.
TJERR_TJERR_WARNING
The error was non-fatal and recoverable, but the destination image may still be corrupt.
TJFLAG_ACCURATEDCT
TJFLAG_BOTTOMUP
TJFLAG_FASTDCT
TJFLAG_FASTUPSAMPLE
TJFLAG_FORCEMMX
TJFLAG_FORCESSE
TJFLAG_FORCESSE2
TJFLAG_FORCESSE3
TJFLAG_LIMITSCANS
TJFLAG_NOREALLOC
TJFLAG_PROGRESSIVE
TJFLAG_STOPONWARNING
TJINIT_TJINIT_COMPRESS
Initialize the TurboJPEG instance for compression.
TJINIT_TJINIT_DECOMPRESS
Initialize the TurboJPEG instance for decompression.
TJINIT_TJINIT_TRANSFORM
Initialize the TurboJPEG instance for lossless transformation (both compression and decompression.)
TJPARAM_TJPARAM_ARITHMETIC
Arithmetic entropy coding
TJPARAM_TJPARAM_BOTTOMUP
Row order in packed-pixel source/destination images
TJPARAM_TJPARAM_COLORSPACE
JPEG colorspace
TJPARAM_TJPARAM_DENSITYUNITS
JPEG pixel density units
TJPARAM_TJPARAM_FASTDCT
DCT/IDCT algorithm [lossy compression and decompression]
TJPARAM_TJPARAM_FASTUPSAMPLE
Chrominance upsampling algorithm [lossy decompression only]
TJPARAM_TJPARAM_JPEGHEIGHT
JPEG height (in pixels) [decompression only, read-only]
TJPARAM_TJPARAM_JPEGWIDTH
JPEG width (in pixels) [decompression only, read-only]
TJPARAM_TJPARAM_LOSSLESS
Lossless JPEG
TJPARAM_TJPARAM_LOSSLESSPSV
Lossless JPEG predictor selection value (PSV)
TJPARAM_TJPARAM_LOSSLESSPT
Lossless JPEG point transform (Pt)
TJPARAM_TJPARAM_MAXMEMORY
Memory limit for intermediate buffers
TJPARAM_TJPARAM_MAXPIXELS
Image size limit [decompression, lossless transformation, packed-pixel image loading]
TJPARAM_TJPARAM_NOREALLOC
JPEG destination buffer (re)allocation [compression, lossless transformation]
TJPARAM_TJPARAM_OPTIMIZE
Huffman table optimization [lossy compression, lossless transformation]
TJPARAM_TJPARAM_PRECISION
Data precision (bits per sample)
TJPARAM_TJPARAM_PROGRESSIVE
Progressive JPEG
TJPARAM_TJPARAM_QUALITY
Perceptual quality of lossy JPEG images [compression only]
TJPARAM_TJPARAM_RESTARTBLOCKS
JPEG restart marker interval in MCUs [lossy compression, lossless transformation]
TJPARAM_TJPARAM_RESTARTROWS
JPEG restart marker interval in MCU rows [compression, lossless transformation]
TJPARAM_TJPARAM_SAVEMARKERS
Marker copying behavior [decompression, lossless transformation]
TJPARAM_TJPARAM_SCANLIMIT
Progressive JPEG scan limit for lossy JPEG images [decompression, lossless transformation]
TJPARAM_TJPARAM_STOPONWARNING
Error handling behavior
TJPARAM_TJPARAM_SUBSAMP
Chrominance subsampling level
TJPARAM_TJPARAM_XDENSITY
JPEG horizontal pixel density
TJPARAM_TJPARAM_YDENSITY
JPEG vertical pixel density
TJPF_TJPF_ABGR
ABGR pixel format
TJPF_TJPF_ARGB
ARGB pixel format
TJPF_TJPF_BGR
BGR pixel format
TJPF_TJPF_BGRA
BGRA pixel format
TJPF_TJPF_BGRX
BGRX pixel format
TJPF_TJPF_CMYK
CMYK pixel format
TJPF_TJPF_GRAY
Grayscale pixel format
TJPF_TJPF_RGB
RGB pixel format
TJPF_TJPF_RGBA
RGBA pixel format
TJPF_TJPF_RGBX
RGBX pixel format
TJPF_TJPF_UNKNOWN
Unknown pixel format
TJPF_TJPF_XBGR
XBGR pixel format
TJPF_TJPF_XRGB
XRGB pixel format
TJSAMP_TJSAMP_411
4:1:1 chrominance subsampling
TJSAMP_TJSAMP_420
4:2:0 chrominance subsampling
TJSAMP_TJSAMP_422
4:2:2 chrominance subsampling
TJSAMP_TJSAMP_440
4:4:0 chrominance subsampling
TJSAMP_TJSAMP_441
4:4:1 chrominance subsampling
TJSAMP_TJSAMP_444
4:4:4 chrominance subsampling (no chrominance subsampling)
TJSAMP_TJSAMP_GRAY
Grayscale
TJSAMP_TJSAMP_UNKNOWN
Unknown subsampling
TJXOPT_ARITHMETIC
TJXOPT_COPYNONE
TJXOPT_CROP
TJXOPT_GRAY
TJXOPT_NOOUTPUT
TJXOPT_OPTIMIZE
TJXOPT_PERFECT
TJXOPT_PROGRESSIVE
TJXOPT_TRIM
TJXOP_TJXOP_HFLIP
Flip (mirror) image horizontally. This transform is imperfect if there are any partial iMCUs on the right edge (see #TJXOPT_PERFECT.)
TJXOP_TJXOP_NONE
Do not transform the position of the image pixels.
TJXOP_TJXOP_ROT90
Rotate image clockwise by 90 degrees. This transform is imperfect if there are any partial iMCUs on the bottom edge (see #TJXOPT_PERFECT.)
TJXOP_TJXOP_ROT180
Rotate image 180 degrees. This transform is imperfect if there are any partial iMCUs in the image (see #TJXOPT_PERFECT.)
TJXOP_TJXOP_ROT270
Rotate image counter-clockwise by 90 degrees. This transform is imperfect if there are any partial iMCUs on the right edge (see #TJXOPT_PERFECT.)
TJXOP_TJXOP_TRANSPOSE
Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect.
TJXOP_TJXOP_TRANSVERSE
Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial iMCUs in the image (see #TJXOPT_PERFECT.)
TJXOP_TJXOP_VFLIP
Flip (mirror) image vertically. This transform is imperfect if there are any partial iMCUs on the bottom edge (see #TJXOPT_PERFECT.)
TJ_ALPHAFIRST
TJ_BGR
TJ_NUMCS
TJ_NUMERR
TJ_NUMINIT
TJ_NUMPF
TJ_NUMSAMP
TJ_NUMXOP
TJ_YUV

Statics§

TJUNCROPPED
TJUNSCALED
tjAlphaOffset
tjBlueOffset
tjGreenOffset
tjMCUHeight
tjMCUWidth
tjPixelSize
tjRedOffset

Functions§

TJBUFSIZE
TJBUFSIZEYUV
tj3Alloc
Allocate a byte buffer for use with TurboJPEG. You should always use this function to allocate the JPEG destination buffer(s) for the compression and transform functions unless you are disabling automatic buffer (re)allocation (by setting #TJPARAM_NOREALLOC.)
tj3Compress8
Compress a packed-pixel RGB, grayscale, or CMYK image with 2 to 8 bits of data precision per sample into a JPEG image with the same data precision.
tj3Compress12
Compress a packed-pixel RGB, grayscale, or CMYK image with 9 to 12 bits of data precision per sample into a JPEG image with the same data precision.
tj3Compress16
Compress a packed-pixel RGB, grayscale, or CMYK image with 13 to 16 bits of data precision per sample into a lossless JPEG image with the same data precision.
tj3CompressFromYUV8
Compress an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample JPEG image.
tj3CompressFromYUVPlanes8
Compress a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample JPEG image.
tj3DecodeYUV8
Decode an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample packed-pixel RGB or grayscale image. This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.
tj3DecodeYUVPlanes8
Decode a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample packed-pixel RGB or grayscale image. This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.
tj3Decompress8
Decompress a JPEG image with 2 to 8 bits of data precision per sample into a packed-pixel RGB, grayscale, or CMYK image with the same data precision. The @ref TJPARAM “parameters” that describe the JPEG image will be set when this function returns.
tj3Decompress12
Decompress a JPEG image with 9 to 12 bits of data precision per sample into a packed-pixel RGB, grayscale, or CMYK image with the same data precision.
tj3Decompress16
Decompress a lossless JPEG image with 13 to 16 bits of data precision per sample into a packed-pixel RGB, grayscale, or CMYK image with the same data precision.
tj3DecompressHeader
Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables. If a JPEG image is passed to this function, then the @ref TJPARAM “parameters” that describe the JPEG image will be set when the function returns. If a JPEG image is passed to this function and #TJPARAM_SAVEMARKERS is set to 2 or 4, then the ICC profile (if any) will be extracted from the JPEG image. (#tj3GetICCProfile() can then be used to retrieve the profile.)
tj3DecompressToYUV8
Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample unified planar YUV image. This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The @ref TJPARAM “parameters” that describe the JPEG image will be set when this function returns.
tj3DecompressToYUVPlanes8
Decompress an 8-bit-per-sample JPEG image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The @ref TJPARAM “parameters” that describe the JPEG image will be set when this function returns.
tj3Destroy
Destroy a TurboJPEG instance.
tj3EncodeYUV8
Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into an 8-bit-per-sample unified planar YUV image. This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.
tj3EncodeYUVPlanes8
Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.
tj3Free
Free a byte buffer previously allocated by TurboJPEG. You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by the compression and transform functions or that were manually allocated using #tj3Alloc().
tj3Get
Get the value of a parameter.
tj3GetErrorCode
Returns a code indicating the severity of the last error. See @ref TJERR “Error codes”.
tj3GetErrorStr
Returns a descriptive error message explaining why the last command failed.
tj3GetICCProfile
Retrieve the ICC (International Color Consortium) color management profile (if any) that was previously extracted from a JPEG image.
tj3GetScalingFactors
Returns a list of fractional scaling factors that the JPEG decompressor supports.
tj3Init
Create a new TurboJPEG instance.
tj3JPEGBufSize
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, so it is possible for a very high-quality source image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent very rare corner cases, but since there is no way to predict the size of a JPEG image prior to compression, the corner cases have to be handled.
tj3LoadImage8
Load a packed-pixel image with 2 to 8 bits of data precision per sample from disk into memory.
tj3LoadImage12
Load a packed-pixel image with 9 to 12 bits of data precision per sample from disk into memory.
tj3LoadImage16
Load a packed-pixel image with 13 to 16 bits of data precision per sample from disk into memory.
tj3SaveImage8
Save a packed-pixel image with 2 to 8 bits of data precision per sample from memory to disk.
tj3SaveImage12
Save a packed-pixel image with 9 to 12 bits of data precision per sample from memory to disk.
tj3SaveImage16
Save a packed-pixel image with 13 to 16 bits of data precision per sample from memory to disk.
tj3Set
Set the value of a parameter.
tj3SetCroppingRegion
Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image
tj3SetICCProfile
Embed an ICC (International Color Consortium) color management profile in JPEG images generated by subsequent compression and lossless transformation operations.
tj3SetScalingFactor
Set the scaling factor for subsequent lossy decompression operations.
tj3Transform
Losslessly transform a JPEG image into another JPEG image. Lossless transforms work by moving the raw DCT 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 entropy 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.
tj3TransformBufSize
The maximum size of the buffer (in bytes) required to hold a JPEG image transformed with the given transform parameters and/or cropping region. This function is a wrapper for #tj3JPEGBufSize() that takes into account cropping, transposition of the width and height (which affects the destination image dimensions and level of chrominance subsampling), grayscale conversion, and the ICC profile (if any) that was previously associated with the TurboJPEG instance (see #tj3SetICCProfile()) or extracted from the source image (see #tj3GetICCProfile() and #TJPARAM_SAVEMARKERS.) The JPEG header must be read (see tj3DecompressHeader()) prior to calling this function.
tj3YUVBufSize
The size of the buffer (in bytes) required to hold a unified planar YUV image with the given parameters.
tj3YUVPlaneHeight
The plane height of a YUV image plane with the given parameters. Refer to @ref YUVnotes “YUV Image Format Notes” for a description of plane height.
tj3YUVPlaneSize
The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.
tj3YUVPlaneWidth
The plane width of a YUV image plane with the given parameters. Refer to @ref YUVnotes “YUV Image Format Notes” for a description of plane width.
tjAlloc
tjBufSize
tjBufSizeYUV
tjBufSizeYUV2
tjCompress
tjCompress2
tjCompressFromYUV
tjCompressFromYUVPlanes
tjDecodeYUV
tjDecodeYUVPlanes
tjDecompress
tjDecompress2
tjDecompressHeader
tjDecompressHeader2
tjDecompressHeader3
tjDecompressToYUV
tjDecompressToYUV2
tjDecompressToYUVPlanes
tjDestroy
tjEncodeYUV
tjEncodeYUV2
tjEncodeYUV3
tjEncodeYUVPlanes
tjFree
tjGetErrorCode
tjGetErrorStr
tjGetErrorStr2
tjGetScalingFactors
tjInitCompress
tjInitDecompress
tjInitTransform
tjLoadImage
tjPlaneHeight
tjPlaneSizeYUV
tjPlaneWidth
tjSaveImage
tjTransform

Type Aliases§

TJCS
JPEG colorspaces
TJERR
Error codes
TJINIT
Initialization options
TJPARAM
Parameters
TJPF
Pixel formats
TJSAMP
Chrominance subsampling options
TJXOP
Transform operations for #tj3Transform()
size_t
tjhandle
TurboJPEG instance handle
wchar_t