Added extended tjDecompressHeader() function which can determine the type of subsampling used in the JPEG image

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@310 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2010-12-14 01:21:29 +00:00
parent a6f4fca72c
commit 1fe80f80f5
2 changed files with 66 additions and 2 deletions

View File

@@ -169,9 +169,9 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
/*
int tjDecompressHeader(tjhandle j,
int tjDecompressHeader2(tjhandle j,
unsigned char *srcbuf, unsigned long size,
int *width, int *height)
int *width, int *height, int *jpegsub)
[INPUT] j = instance handle previously returned from a call to
tjInitDecompress()
@@ -180,9 +180,18 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
[INPUT] size = size of the JPEG image buffer (in bytes)
[OUTPUT] width = width (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
JPEG image
RETURNS: 0 on success, -1 on error
*/
DLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle j,
unsigned char *srcbuf, unsigned long size,
int *width, int *height, int *jpegsub);
/*
Deprecated version of the above function
*/
DLLEXPORT int DLLCALL tjDecompressHeader(tjhandle j,
unsigned char *srcbuf, unsigned long size,
int *width, int *height);