From d0c3aa900b0feb9c80072eda640d108b717969aa Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 27 Jun 2017 11:36:25 -0500 Subject: [PATCH] TurboJPEG: C API documentation buglet TJFLAG_NOREALLOC, tjAlloc(), and tjFree() apply to all TurboJPEG compression functions, not just tjCompress2(). --- doc/html/group___turbo_j_p_e_g.html | 6 +++--- turbojpeg.h | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html index 4b8d306e..9363117c 100644 --- a/doc/html/group___turbo_j_p_e_g.html +++ b/doc/html/group___turbo_j_p_e_g.html @@ -455,7 +455,7 @@ Variables

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.

+

If passed to one of the JPEG compression or transform functions, 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.

@@ -812,7 +812,7 @@ 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.)

+

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 TJFLAG_NOREALLOC.)

Parameters
@@ -1942,7 +1942,7 @@ 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().

+

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 tjAlloc().

Parameters
bytesthe number of bytes to allocate
diff --git a/turbojpeg.h b/turbojpeg.h index 583029fa..aa332642 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -1,5 +1,5 @@ /* - * Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. + * Copyright (C)2009-2015, 2017 D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -348,7 +348,7 @@ enum TJCS * The uncompressed source/destination image is stored in bottom-up (Windows, * OpenGL) order, not top-down (X11) order. */ -#define TJFLAG_BOTTOMUP 2 +#define TJFLAG_BOTTOMUP 2 /** * When decompressing an image that was compressed using chrominance * subsampling, use the fastest chrominance upsampling algorithm available in @@ -358,11 +358,11 @@ enum TJCS */ #define TJFLAG_FASTUPSAMPLE 256 /** - * 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. + * Disable buffer (re)allocation. If passed to one of the JPEG compression or + * transform functions, 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. */ #define TJFLAG_NOREALLOC 1024 /** @@ -1435,8 +1435,8 @@ DLLEXPORT int DLLCALL tjDestroy(tjhandle handle); /** * 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 + * 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 #TJFLAG_NOREALLOC.) * * @param bytes the number of bytes to allocate @@ -1452,8 +1452,8 @@ DLLEXPORT unsigned char* DLLCALL tjAlloc(int bytes); /** * 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(). + * (re)allocated by the compression and transform functions or that were + * manually allocated using #tjAlloc(). * * @param buffer address of the buffer to free *
bufferaddress of the buffer to free