Format preprocessor macros more consistently
Within the libjpeg API code, it seems to be more the convention than not to separate the macro name and value by two or more spaces, which improves general readability. Making this consistent across all of libjpeg-turbo is less about my individual preferences and more about making it easy to automatically detect variations from our chosen formatting convention. I intend to release the script I'm using to validate this stuff, once it matures and stabilizes a bit.
This commit is contained in:
78
turbojpeg.h
78
turbojpeg.h
@@ -30,7 +30,7 @@
|
||||
#define __TURBOJPEG_H__
|
||||
|
||||
#if defined(_WIN32) && defined(DLLDEFINE)
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
@@ -78,7 +78,7 @@
|
||||
/**
|
||||
* The number of chrominance subsampling options
|
||||
*/
|
||||
#define TJ_NUMSAMP 6
|
||||
#define TJ_NUMSAMP 6
|
||||
|
||||
/**
|
||||
* Chrominance subsampling options.
|
||||
@@ -157,7 +157,7 @@ static const int tjMCUHeight[TJ_NUMSAMP] = { 8, 8, 16, 8, 16, 8 };
|
||||
/**
|
||||
* The number of pixel formats
|
||||
*/
|
||||
#define TJ_NUMPF 12
|
||||
#define TJ_NUMPF 12
|
||||
|
||||
/**
|
||||
* Pixel formats
|
||||
@@ -307,7 +307,7 @@ static const int tjPixelSize[TJ_NUMPF] = {
|
||||
/**
|
||||
* The number of JPEG colorspaces
|
||||
*/
|
||||
#define TJ_NUMCS 5
|
||||
#define TJ_NUMCS 5
|
||||
|
||||
/**
|
||||
* JPEG colorspaces
|
||||
@@ -369,7 +369,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
|
||||
@@ -385,7 +385,7 @@ enum TJCS {
|
||||
* attempting to allocate or reallocate that buffer. This reproduces the
|
||||
* behavior of earlier versions of TurboJPEG.
|
||||
*/
|
||||
#define TJFLAG_NOREALLOC 1024
|
||||
#define TJFLAG_NOREALLOC 1024
|
||||
/**
|
||||
* Use the fastest DCT/IDCT algorithm available in the underlying codec. The
|
||||
* default if this flag is not specified is implementation-specific. For
|
||||
@@ -394,7 +394,7 @@ enum TJCS {
|
||||
* 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.
|
||||
*/
|
||||
#define TJFLAG_FASTDCT 2048
|
||||
#define TJFLAG_FASTDCT 2048
|
||||
/**
|
||||
* Use the most accurate DCT/IDCT algorithm available in the underlying codec.
|
||||
* The default if this flag is not specified is implementation-specific. For
|
||||
@@ -403,27 +403,27 @@ enum TJCS {
|
||||
* 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.
|
||||
*/
|
||||
#define TJFLAG_ACCURATEDCT 4096
|
||||
#define TJFLAG_ACCURATEDCT 4096
|
||||
/**
|
||||
* Immediately discontinue the current compression/decompression/transform
|
||||
* operation if the underlying codec throws a warning (non-fatal error). The
|
||||
* default behavior is to allow the operation to complete unless a fatal error
|
||||
* is encountered.
|
||||
*/
|
||||
#define TJFLAG_STOPONWARNING 8192
|
||||
#define TJFLAG_STOPONWARNING 8192
|
||||
/**
|
||||
* Use progressive entropy coding in JPEG images generated by the compression
|
||||
* and transform functions. Progressive entropy coding will generally improve
|
||||
* compression relative to baseline entropy coding (the default), but it will
|
||||
* reduce compression and decompression performance considerably.
|
||||
*/
|
||||
#define TJFLAG_PROGRESSIVE 16384
|
||||
#define TJFLAG_PROGRESSIVE 16384
|
||||
|
||||
|
||||
/**
|
||||
* The number of error codes
|
||||
*/
|
||||
#define TJ_NUMERR 2
|
||||
#define TJ_NUMERR 2
|
||||
|
||||
/**
|
||||
* Error codes
|
||||
@@ -444,7 +444,7 @@ enum TJERR {
|
||||
/**
|
||||
* The number of transform operations
|
||||
*/
|
||||
#define TJ_NUMXOP 8
|
||||
#define TJ_NUMXOP 8
|
||||
|
||||
/**
|
||||
* Transform operations for #tjTransform()
|
||||
@@ -507,29 +507,29 @@ enum TJXOP {
|
||||
* that cannot be transformed will be left in place, which will create
|
||||
* odd-looking strips on the right or bottom edge of the image.
|
||||
*/
|
||||
#define TJXOPT_PERFECT 1
|
||||
#define TJXOPT_PERFECT 1
|
||||
/**
|
||||
* This option will cause #tjTransform() to discard any partial MCU blocks that
|
||||
* cannot be transformed.
|
||||
*/
|
||||
#define TJXOPT_TRIM 2
|
||||
#define TJXOPT_TRIM 2
|
||||
/**
|
||||
* This option will enable lossless cropping. See #tjTransform() for more
|
||||
* information.
|
||||
*/
|
||||
#define TJXOPT_CROP 4
|
||||
#define TJXOPT_CROP 4
|
||||
/**
|
||||
* This option will discard the color data in the input image and produce
|
||||
* a grayscale output image.
|
||||
*/
|
||||
#define TJXOPT_GRAY 8
|
||||
#define TJXOPT_GRAY 8
|
||||
/**
|
||||
* 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.)
|
||||
*/
|
||||
#define TJXOPT_NOOUTPUT 16
|
||||
#define TJXOPT_NOOUTPUT 16
|
||||
/**
|
||||
* This option will enable progressive entropy coding in the output image
|
||||
* generated by this particular transform. Progressive entropy coding will
|
||||
@@ -537,13 +537,13 @@ enum TJXOP {
|
||||
* default), but it will reduce compression and decompression performance
|
||||
* considerably.
|
||||
*/
|
||||
#define TJXOPT_PROGRESSIVE 32
|
||||
#define TJXOPT_PROGRESSIVE 32
|
||||
/**
|
||||
* This option will prevent #tjTransform() from copying any extra markers
|
||||
* (including EXIF and ICC profile data) from the source image to the output
|
||||
* image.
|
||||
*/
|
||||
#define TJXOPT_COPYNONE 64
|
||||
#define TJXOPT_COPYNONE 64
|
||||
|
||||
|
||||
/**
|
||||
@@ -654,7 +654,7 @@ typedef void *tjhandle;
|
||||
/**
|
||||
* Pad the given width to the nearest 32-bit boundary
|
||||
*/
|
||||
#define TJPAD(width) (((width) + 3) & (~3))
|
||||
#define TJPAD(width) (((width) + 3) & (~3))
|
||||
|
||||
/**
|
||||
* Compute the scaled value of <tt>dimension</tt> using the given scaling
|
||||
@@ -1670,29 +1670,29 @@ DLLEXPORT int tjGetErrorCode(tjhandle handle);
|
||||
|
||||
|
||||
/* Deprecated functions and macros */
|
||||
#define TJFLAG_FORCEMMX 8
|
||||
#define TJFLAG_FORCESSE 16
|
||||
#define TJFLAG_FORCESSE2 32
|
||||
#define TJFLAG_FORCESSE3 128
|
||||
#define TJFLAG_FORCEMMX 8
|
||||
#define TJFLAG_FORCESSE 16
|
||||
#define TJFLAG_FORCESSE2 32
|
||||
#define TJFLAG_FORCESSE3 128
|
||||
|
||||
|
||||
/* Backward compatibility functions and macros (nothing to see here) */
|
||||
#define NUMSUBOPT TJ_NUMSAMP
|
||||
#define TJ_444 TJSAMP_444
|
||||
#define TJ_422 TJSAMP_422
|
||||
#define TJ_420 TJSAMP_420
|
||||
#define TJ_411 TJSAMP_420
|
||||
#define TJ_GRAYSCALE TJSAMP_GRAY
|
||||
#define NUMSUBOPT TJ_NUMSAMP
|
||||
#define TJ_444 TJSAMP_444
|
||||
#define TJ_422 TJSAMP_422
|
||||
#define TJ_420 TJSAMP_420
|
||||
#define TJ_411 TJSAMP_420
|
||||
#define TJ_GRAYSCALE TJSAMP_GRAY
|
||||
|
||||
#define TJ_BGR 1
|
||||
#define TJ_BOTTOMUP TJFLAG_BOTTOMUP
|
||||
#define TJ_FORCEMMX TJFLAG_FORCEMMX
|
||||
#define TJ_FORCESSE TJFLAG_FORCESSE
|
||||
#define TJ_FORCESSE2 TJFLAG_FORCESSE2
|
||||
#define TJ_ALPHAFIRST 64
|
||||
#define TJ_FORCESSE3 TJFLAG_FORCESSE3
|
||||
#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE
|
||||
#define TJ_YUV 512
|
||||
#define TJ_BGR 1
|
||||
#define TJ_BOTTOMUP TJFLAG_BOTTOMUP
|
||||
#define TJ_FORCEMMX TJFLAG_FORCEMMX
|
||||
#define TJ_FORCESSE TJFLAG_FORCESSE
|
||||
#define TJ_FORCESSE2 TJFLAG_FORCESSE2
|
||||
#define TJ_ALPHAFIRST 64
|
||||
#define TJ_FORCESSE3 TJFLAG_FORCESSE3
|
||||
#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE
|
||||
#define TJ_YUV 512
|
||||
|
||||
DLLEXPORT unsigned long TJBUFSIZE(int width, int height);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user