Convert tabs to spaces in Imaging.h

This commit is contained in:
Alexander 2017-09-16 20:46:09 +03:00
parent 1f61c4efd4
commit 763df3d90b

View File

@ -20,7 +20,7 @@ extern "C" {
#ifndef M_PI #ifndef M_PI
#define M_PI 3.1415926535897932384626433832795 #define M_PI 3.1415926535897932384626433832795
#endif #endif
@ -29,18 +29,18 @@ extern "C" {
/* /*
* Image data organization: * Image data organization:
* *
* mode bytes byte order * mode bytes byte order
* ------------------------------- * -------------------------------
* 1 1 1 * 1 1 1
* L 1 L * L 1 L
* P 1 P * P 1 P
* I 4 I (32-bit integer, native byte order) * I 4 I (32-bit integer, native byte order)
* F 4 F (32-bit IEEE float, native byte order) * F 4 F (32-bit IEEE float, native byte order)
* RGB 4 R, G, B, - * RGB 4 R, G, B, -
* RGBA 4 R, G, B, A * RGBA 4 R, G, B, A
* CMYK 4 C, M, Y, K * CMYK 4 C, M, Y, K
* YCbCr 4 Y, Cb, Cr, - * YCbCr 4 Y, Cb, Cr, -
* Lab 4 L, a, b, - * Lab 4 L, a, b, -
* *
* experimental modes (incomplete): * experimental modes (incomplete):
* LA 4 L, -, -, A * LA 4 L, -, -, A
@ -78,26 +78,26 @@ typedef struct ImagingPaletteInstance* ImagingPalette;
struct ImagingMemoryInstance { struct ImagingMemoryInstance {
/* Format */ /* Format */
char mode[IMAGING_MODE_LENGTH]; /* Band names ("1", "L", "P", "RGB", "RGBA", "CMYK", "YCbCr", "BGR;xy") */ char mode[IMAGING_MODE_LENGTH]; /* Band names ("1", "L", "P", "RGB", "RGBA", "CMYK", "YCbCr", "BGR;xy") */
int type; /* Data type (IMAGING_TYPE_*) */ int type; /* Data type (IMAGING_TYPE_*) */
int depth; /* Depth (ignored in this version) */ int depth; /* Depth (ignored in this version) */
int bands; /* Number of bands (1, 2, 3, or 4) */ int bands; /* Number of bands (1, 2, 3, or 4) */
int xsize; /* Image dimension. */ int xsize; /* Image dimension. */
int ysize; int ysize;
/* Colour palette (for "P" images only) */ /* Colour palette (for "P" images only) */
ImagingPalette palette; ImagingPalette palette;
/* Data pointers */ /* Data pointers */
UINT8 **image8; /* Set for 8-bit images (pixelsize=1). */ UINT8 **image8; /* Set for 8-bit images (pixelsize=1). */
INT32 **image32; /* Set for 32-bit images (pixelsize=4). */ INT32 **image32; /* Set for 32-bit images (pixelsize=4). */
/* Internals */ /* Internals */
char **image; /* Actual raster data. */ char **image; /* Actual raster data. */
char *block; /* Set if data is allocated in a single block. */ char *block; /* Set if data is allocated in a single block. */
int pixelsize; /* Size of a pixel, in bytes (1, 2 or 4) */ int pixelsize; /* Size of a pixel, in bytes (1, 2 or 4) */
int linesize; /* Size of a line, in bytes (xsize * pixelsize) */ int linesize; /* Size of a line, in bytes (xsize * pixelsize) */
/* Virtual methods */ /* Virtual methods */
void (*destroy)(Imaging im); void (*destroy)(Imaging im);
@ -130,11 +130,11 @@ struct ImagingAccessInstance {
struct ImagingHistogramInstance { struct ImagingHistogramInstance {
/* Format */ /* Format */
char mode[IMAGING_MODE_LENGTH]; /* Band names (of corresponding source image) */ char mode[IMAGING_MODE_LENGTH]; /* Band names (of corresponding source image) */
int bands; /* Number of bands (1, 3, or 4) */ int bands; /* Number of bands (1, 3, or 4) */
/* Data */ /* Data */
long *histogram; /* Histogram (bands*256 longs) */ long *histogram; /* Histogram (bands*256 longs) */
}; };
@ -142,13 +142,13 @@ struct ImagingHistogramInstance {
struct ImagingPaletteInstance { struct ImagingPaletteInstance {
/* Format */ /* Format */
char mode[IMAGING_MODE_LENGTH]; /* Band names */ char mode[IMAGING_MODE_LENGTH]; /* Band names */
/* Data */ /* Data */
UINT8 palette[1024];/* Palette data (same format as image data) */ UINT8 palette[1024];/* Palette data (same format as image data) */
INT16* cache; /* Palette cache (used for predefined palettes) */ INT16* cache; /* Palette cache (used for predefined palettes) */
int keep_cache; /* This palette will be reused; keep cache */ int keep_cache; /* This palette will be reused; keep cache */
}; };
@ -170,8 +170,8 @@ extern Imaging ImagingNewMap(const char* filename, int readonly,
extern Imaging ImagingNewPrologue(const char *mode, extern Imaging ImagingNewPrologue(const char *mode,
int xsize, int ysize); int xsize, int ysize);
extern Imaging ImagingNewPrologueSubtype(const char *mode, extern Imaging ImagingNewPrologueSubtype(const char *mode,
int xsize, int ysize, int xsize, int ysize,
int structure_size); int structure_size);
extern void ImagingCopyInfo(Imaging destination, Imaging source); extern void ImagingCopyInfo(Imaging destination, Imaging source);
@ -181,8 +181,6 @@ extern void ImagingAccessInit(void);
extern ImagingAccess ImagingAccessNew(Imaging im); extern ImagingAccess ImagingAccessNew(Imaging im);
extern void _ImagingAccessDelete(Imaging im, ImagingAccess access); extern void _ImagingAccessDelete(Imaging im, ImagingAccess access);
#define ImagingAccessDelete(im, access) /* nop, for now */ #define ImagingAccessDelete(im, access) /* nop, for now */
/*#define ImagingAccessDelete(im, access) \
((access)->dynamic ? _ImagingAccessDelete((im), (access)), 0 : 0)) */
extern ImagingPalette ImagingPaletteNew(const char *mode); extern ImagingPalette ImagingPaletteNew(const char *mode);
extern ImagingPalette ImagingPaletteNewBrowser(void); extern ImagingPalette ImagingPaletteNewBrowser(void);
@ -191,10 +189,10 @@ extern void ImagingPaletteDelete(ImagingPalette palette);
extern int ImagingPaletteCachePrepare(ImagingPalette palette); extern int ImagingPaletteCachePrepare(ImagingPalette palette);
extern void ImagingPaletteCacheUpdate(ImagingPalette palette, extern void ImagingPaletteCacheUpdate(ImagingPalette palette,
int r, int g, int b); int r, int g, int b);
extern void ImagingPaletteCacheDelete(ImagingPalette palette); extern void ImagingPaletteCacheDelete(ImagingPalette palette);
#define ImagingPaletteCache(p, r, g, b)\ #define ImagingPaletteCache(p, r, g, b)\
p->cache[(r>>2) + (g>>2)*64 + (b>>2)*64*64] p->cache[(r>>2) + (g>>2)*64 + (b>>2)*64*64]
extern Imaging ImagingQuantize(Imaging im, int colours, int mode, int kmeans); extern Imaging ImagingQuantize(Imaging im, int colours, int mode, int kmeans);
@ -264,14 +262,14 @@ extern Imaging ImagingFilter(
extern Imaging ImagingFlipLeftRight(Imaging imOut, Imaging imIn); extern Imaging ImagingFlipLeftRight(Imaging imOut, Imaging imIn);
extern Imaging ImagingFlipTopBottom(Imaging imOut, Imaging imIn); extern Imaging ImagingFlipTopBottom(Imaging imOut, Imaging imIn);
extern Imaging ImagingGaussianBlur(Imaging imOut, Imaging imIn, float radius, extern Imaging ImagingGaussianBlur(Imaging imOut, Imaging imIn, float radius,
int passes); int passes);
extern Imaging ImagingGetBand(Imaging im, int band); extern Imaging ImagingGetBand(Imaging im, int band);
extern Imaging ImagingMerge(const char* mode, Imaging bands[4]); extern Imaging ImagingMerge(const char* mode, Imaging bands[4]);
extern int ImagingSplit(Imaging im, Imaging bands[4]); extern int ImagingSplit(Imaging im, Imaging bands[4]);
extern int ImagingGetBBox(Imaging im, int bbox[4]); extern int ImagingGetBBox(Imaging im, int bbox[4]);
typedef struct { int x, y; INT32 count; INT32 pixel; } ImagingColorItem; typedef struct { int x, y; INT32 count; INT32 pixel; } ImagingColorItem;
extern ImagingColorItem* ImagingGetColors(Imaging im, int maxcolors, extern ImagingColorItem* ImagingGetColors(Imaging im, int maxcolors,
int *colors); int *colors);
extern int ImagingGetExtrema(Imaging im, void *extrema); extern int ImagingGetExtrema(Imaging im, void *extrema);
extern int ImagingGetProjection(Imaging im, UINT8* xproj, UINT8* yproj); extern int ImagingGetProjection(Imaging im, UINT8* xproj, UINT8* yproj);
extern ImagingHistogram ImagingGetHistogram( extern ImagingHistogram ImagingGetHistogram(
@ -336,7 +334,7 @@ extern int ImagingDrawChord(Imaging im, int x0, int y0, int x1, int y1,
extern int ImagingDrawEllipse(Imaging im, int x0, int y0, int x1, int y1, extern int ImagingDrawEllipse(Imaging im, int x0, int y0, int x1, int y1,
const void* ink, int fill, int op); const void* ink, int fill, int op);
extern int ImagingDrawLine(Imaging im, int x0, int y0, int x1, int y1, extern int ImagingDrawLine(Imaging im, int x0, int y0, int x1, int y1,
const void* ink, int op); const void* ink, int op);
extern int ImagingDrawWideLine(Imaging im, int x0, int y0, int x1, int y1, extern int ImagingDrawWideLine(Imaging im, int x0, int y0, int x1, int y1,
const void* ink, int width, int op); const void* ink, int width, int op);
extern int ImagingDrawPieslice(Imaging im, int x0, int y0, int x1, int y1, extern int ImagingDrawPieslice(Imaging im, int x0, int y0, int x1, int y1,
@ -344,9 +342,9 @@ extern int ImagingDrawPieslice(Imaging im, int x0, int y0, int x1, int y1,
int op); int op);
extern int ImagingDrawPoint(Imaging im, int x, int y, const void* ink, int op); extern int ImagingDrawPoint(Imaging im, int x, int y, const void* ink, int op);
extern int ImagingDrawPolygon(Imaging im, int points, int *xy, extern int ImagingDrawPolygon(Imaging im, int points, int *xy,
const void* ink, int fill, int op); const void* ink, int fill, int op);
extern int ImagingDrawRectangle(Imaging im, int x0, int y0, int x1, int y1, extern int ImagingDrawRectangle(Imaging im, int x0, int y0, int x1, int y1,
const void* ink, int fill, int op); const void* ink, int fill, int op);
/* Level 2 graphics (WORK IN PROGRESS) */ /* Level 2 graphics (WORK IN PROGRESS) */
extern ImagingOutline ImagingOutlineNew(void); extern ImagingOutline ImagingOutlineNew(void);
@ -358,7 +356,7 @@ extern int ImagingDrawOutline(Imaging im, ImagingOutline outline,
extern int ImagingOutlineMove(ImagingOutline outline, float x, float y); extern int ImagingOutlineMove(ImagingOutline outline, float x, float y);
extern int ImagingOutlineLine(ImagingOutline outline, float x, float y); extern int ImagingOutlineLine(ImagingOutline outline, float x, float y);
extern int ImagingOutlineCurve(ImagingOutline outline, float x1, float y1, extern int ImagingOutlineCurve(ImagingOutline outline, float x1, float y1,
float x2, float y2, float x3, float y3); float x2, float y2, float x3, float y3);
extern int ImagingOutlineTransform(ImagingOutline outline, double a[6]); extern int ImagingOutlineTransform(ImagingOutline outline, double a[6]);
extern int ImagingOutlineClose(ImagingOutline outline); extern int ImagingOutlineClose(ImagingOutline outline);
@ -387,30 +385,30 @@ extern UINT32 ImagingCRC32(UINT32 crc, UINT8* buffer, int bytes);
/* Codecs */ /* Codecs */
typedef struct ImagingCodecStateInstance *ImagingCodecState; typedef struct ImagingCodecStateInstance *ImagingCodecState;
typedef int (*ImagingCodec)(Imaging im, ImagingCodecState state, typedef int (*ImagingCodec)(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingBcnDecode(Imaging im, ImagingCodecState state, extern int ImagingBcnDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingBitDecode(Imaging im, ImagingCodecState state, extern int ImagingBitDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingEpsEncode(Imaging im, ImagingCodecState state, extern int ImagingEpsEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingFliDecode(Imaging im, ImagingCodecState state, extern int ImagingFliDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingGifDecode(Imaging im, ImagingCodecState state, extern int ImagingGifDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingGifEncode(Imaging im, ImagingCodecState state, extern int ImagingGifEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingHexDecode(Imaging im, ImagingCodecState state, extern int ImagingHexDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#ifdef HAVE_LIBJPEG #ifdef HAVE_LIBJPEG
extern int ImagingJpegDecode(Imaging im, ImagingCodecState state, extern int ImagingJpegDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingJpegDecodeCleanup(ImagingCodecState state); extern int ImagingJpegDecodeCleanup(ImagingCodecState state);
extern int ImagingJpegUseJCSExtensions(void); extern int ImagingJpegUseJCSExtensions(void);
extern int ImagingJpegEncode(Imaging im, ImagingCodecState state, extern int ImagingJpegEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#endif #endif
#ifdef HAVE_OPENJPEG #ifdef HAVE_OPENJPEG
extern int ImagingJpeg2KDecode(Imaging im, ImagingCodecState state, extern int ImagingJpeg2KDecode(Imaging im, ImagingCodecState state,
@ -421,45 +419,45 @@ extern int ImagingJpeg2KEncode(Imaging im, ImagingCodecState state,
extern int ImagingJpeg2KEncodeCleanup(ImagingCodecState state); extern int ImagingJpeg2KEncodeCleanup(ImagingCodecState state);
#endif #endif
extern int ImagingLzwDecode(Imaging im, ImagingCodecState state, extern int ImagingLzwDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#ifdef HAVE_LIBTIFF #ifdef HAVE_LIBTIFF
extern int ImagingLibTiffDecode(Imaging im, ImagingCodecState state, extern int ImagingLibTiffDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingLibTiffEncode(Imaging im, ImagingCodecState state, extern int ImagingLibTiffEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#endif #endif
#ifdef HAVE_LIBMPEG #ifdef HAVE_LIBMPEG
extern int ImagingMpegDecode(Imaging im, ImagingCodecState state, extern int ImagingMpegDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#endif #endif
extern int ImagingMspDecode(Imaging im, ImagingCodecState state, extern int ImagingMspDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingPackbitsDecode(Imaging im, ImagingCodecState state, extern int ImagingPackbitsDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingPcdDecode(Imaging im, ImagingCodecState state, extern int ImagingPcdDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingPcxDecode(Imaging im, ImagingCodecState state, extern int ImagingPcxDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingPcxEncode(Imaging im, ImagingCodecState state, extern int ImagingPcxEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingRawDecode(Imaging im, ImagingCodecState state, extern int ImagingRawDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingRawEncode(Imaging im, ImagingCodecState state, extern int ImagingRawEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingSunRleDecode(Imaging im, ImagingCodecState state, extern int ImagingSunRleDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingTgaRleDecode(Imaging im, ImagingCodecState state, extern int ImagingTgaRleDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingXbmDecode(Imaging im, ImagingCodecState state, extern int ImagingXbmDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingXbmEncode(Imaging im, ImagingCodecState state, extern int ImagingXbmEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
#ifdef HAVE_LIBZ #ifdef HAVE_LIBZ
extern int ImagingZipDecode(Imaging im, ImagingCodecState state, extern int ImagingZipDecode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingZipDecodeCleanup(ImagingCodecState state); extern int ImagingZipDecodeCleanup(ImagingCodecState state);
extern int ImagingZipEncode(Imaging im, ImagingCodecState state, extern int ImagingZipEncode(Imaging im, ImagingCodecState state,
UINT8* buffer, int bytes); UINT8* buffer, int bytes);
extern int ImagingZipEncodeCleanup(ImagingCodecState state); extern int ImagingZipEncodeCleanup(ImagingCodecState state);
#endif #endif
@ -503,12 +501,12 @@ extern Py_ssize_t _imaging_tell_pyFd(PyObject *fd);
/* Errcodes */ /* Errcodes */
#define IMAGING_CODEC_END 1 #define IMAGING_CODEC_END 1
#define IMAGING_CODEC_OVERRUN -1 #define IMAGING_CODEC_OVERRUN -1
#define IMAGING_CODEC_BROKEN -2 #define IMAGING_CODEC_BROKEN -2
#define IMAGING_CODEC_UNKNOWN -3 #define IMAGING_CODEC_UNKNOWN -3
#define IMAGING_CODEC_CONFIG -8 #define IMAGING_CODEC_CONFIG -8
#define IMAGING_CODEC_MEMORY -9 #define IMAGING_CODEC_MEMORY -9