diff options
author | Kent Mein <mein@cs.umn.edu> | 2005-01-03 22:53:04 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2005-01-03 22:53:04 +0300 |
commit | 3bbc65a5f418e7b9658ef791518e5b9872745d29 (patch) | |
tree | 262b35502d49731ce9f1021583a49cf9a297bd46 /source | |
parent | 40813b301aff7c1cb1c574f0f6570e05a5ca5eed (diff) |
This is a pretty lame commit but here it is:
I just fixed indentation (replaced spaces with tabs where needed) and removed
#include config.h stuff from the above files.
Kent
Diffstat (limited to 'source')
29 files changed, 208 insertions, 293 deletions
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index a4de48ec053..08741824290 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -47,15 +47,11 @@ #include <vfw.h> #endif -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #undef AVIIF_KEYFRAME // redefined in AVI_avi.h #undef AVIIF_LIST // redefined in AVI_avi.h -#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ - if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); +#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ + if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); #endif #include <sys/types.h> @@ -112,7 +108,7 @@ /****/ #define ANIM_NONE (0) -#define ANIM_SEQUENCE (1 << 0) +#define ANIM_SEQUENCE (1 << 0) #define ANIM_DIR (1 << 1) #define ANIM_ANIM5 (1 << 2) #define ANIM_TGA (1 << 3) @@ -122,11 +118,11 @@ #define ANIM_QTIME (1 << 7) #define ANIM5_MMAP 0 -#define ANIM5_MALLOC 1 -#define ANIM5_SNGBUF 2 +#define ANIM5_MALLOC 1 +#define ANIM5_SNGBUF 2 #define ANIM5_XOR 4 -#define MAXNUMSTREAMS 50 +#define MAXNUMSTREAMS 50 struct anim { int ib_flags; diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 0abf9d5c91a..4e6407c8d6e 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -44,10 +44,6 @@ #include "IMB_divers.h" #include "IMB_allocimbuf.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - static unsigned int dfltcmap[16] = { 0x00000000, 0xffffffff, 0x777777ff, 0xccccccff, 0xcc3344ff, 0xdd8844ff, 0xccdd44ff, 0x888833ff, diff --git a/source/blender/imbuf/intern/amiga.c b/source/blender/imbuf/intern/amiga.c index 6feb1e29166..a75df327e23 100644 --- a/source/blender/imbuf/intern/amiga.c +++ b/source/blender/imbuf/intern/amiga.c @@ -43,10 +43,6 @@ #include "IMB_bitplanes.h" #include "IMB_amiga.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /* actually hard coded endianness */ #define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3]) #define GET_LITTLE_LONG(x) (((uchar *) (x))[3] << 24 | ((uchar *) (x))[2] << 16 | ((uchar *) (x))[1] << 8 | ((uchar *) (x))[0]) diff --git a/source/blender/imbuf/intern/anim.c b/source/blender/imbuf/intern/anim.c index e3ae7a372f8..99cfad34324 100644 --- a/source/blender/imbuf/intern/anim.c +++ b/source/blender/imbuf/intern/anim.c @@ -47,8 +47,8 @@ #undef AVIIF_KEYFRAME // redefined in AVI_avi.h #undef AVIIF_LIST // redefined in AVI_avi.h -#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ - if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); +#define FIXCC(fcc) if (fcc == 0) fcc = mmioFOURCC('N', 'o', 'n', 'e'); \ + if (fcc == BI_RLE8) fcc = mmioFOURCC('R', 'l', 'e', '8'); #endif #include <sys/types.h> @@ -144,23 +144,22 @@ static ImBuf * movie_fetchibuf(struct anim * anim, int position) { ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect, 0); if ( mvReadFrames(anim->track, position, 1, ibuf->x * ibuf->y * - sizeof(int), ibuf->rect ) != DM_SUCCESS ) { + sizeof(int), ibuf->rect ) != DM_SUCCESS ) { movie_printerror("mvReadFrames"); IMB_freeImBuf(ibuf); return(0); } - /* - if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN) - { - rect1 = ibuf->rect + (ibuf->x * ibuf->y) - 1; - rect2 = rect1 - ibuf->x; +/* + if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN) { + rect1 = ibuf->rect + (ibuf->x * ibuf->y) - 1; + rect2 = rect1 - ibuf->x; - for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){ - *rect1-- = *rect2--; - } - } - */ + for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){ + *rect1-- = *rect2--; + } + } +*/ if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN) { @@ -209,7 +208,7 @@ static int an_stringdec(char *string, char* kop, char *staart,unsigned short *nu short i,found=FALSE; len=strlen(string); - nume = len; + nume = len; for(i=len-1;i>=0;i--){ if (string[i]=='/') break; @@ -446,7 +445,7 @@ static ImBuf * avi_fetchibuf (struct anim *anim, int position) { LPBITMAPINFOHEADER lpbi; if (anim->pgf) { - lpbi = AVIStreamGetFrame(anim->pgf, position + AVIStreamStart(anim->pavi[anim->firstvideo])); + lpbi = AVIStreamGetFrame(anim->pgf, position + AVIStreamStart(anim->pavi[anim->firstvideo])); if (lpbi) { ibuf = IMB_ibImageFromMemory((int *) lpbi, 100, IB_rect); //Oh brother... @@ -521,7 +520,7 @@ static struct ImBuf * anim_getnew(struct anim * anim) { ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); break; #ifdef WITH_QUICKTIME - case ANIM_QTIME: + case ANIM_QTIME: if (startquicktime(anim)) return (0); ibuf = IMB_allocImBuf (anim->x, anim->y, 24, 0, 0); break; @@ -586,11 +585,11 @@ struct ImBuf * IMB_anim_absolute(struct anim * anim, int position) { break; #ifdef WITH_QUICKTIME case ANIM_QTIME: - ibuf = qtime_fetchibuf(anim, position); - if (ibuf) anim->curposition = position; - break; + ibuf = qtime_fetchibuf(anim, position); + if (ibuf) anim->curposition = position; + break; #endif - } + } if (ibuf) { if (anim->ib_flags & IB_ttob) IMB_flipy(ibuf); diff --git a/source/blender/imbuf/intern/anim5.c b/source/blender/imbuf/intern/anim5.c index 00e5eac9b43..aa2a5cf6469 100644 --- a/source/blender/imbuf/intern/anim5.c +++ b/source/blender/imbuf/intern/anim5.c @@ -170,7 +170,7 @@ static void planes_to_rect(struct ImBuf * ibuf, int flags) { for(i=ibuf->x * ibuf->y ; i>0 ; i--){ col = *rect; col = ((col & 0x3f000) << 6) + ((col & 0xfc0) << 4) - + ((col & 0x3f) << 2); + + ((col & 0x3f) << 2); col += (col & 0xc0c0c0) >> 6; *rect++ = col; } @@ -418,7 +418,7 @@ int startanim5(struct anim * anim) { } if ((GET_ID(buf) != FORM) || (GET_ID(buf + 2) != ANIM) - || (GET_ID(buf + 3) != FORM) || (GET_ID(buf + 5) != ILBM)){ + || (GET_ID(buf + 3) != FORM) || (GET_ID(buf + 5) != ILBM)){ printf("No anim5 file %s\n",anim->name); close(file); return (-1); diff --git a/source/blender/imbuf/intern/antialias.c b/source/blender/imbuf/intern/antialias.c index 6c261eb7750..0a6e0fcafce 100644 --- a/source/blender/imbuf/intern/antialias.c +++ b/source/blender/imbuf/intern/antialias.c @@ -42,10 +42,6 @@ #include "IMB_imbuf.h" #include "IMB_allocimbuf.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /* how it works: 1 - seek for a transistion in a collumn diff --git a/source/blender/imbuf/intern/bitplanes.c b/source/blender/imbuf/intern/bitplanes.c index 56f3dc01eb1..6bc2155c949 100644 --- a/source/blender/imbuf/intern/bitplanes.c +++ b/source/blender/imbuf/intern/bitplanes.c @@ -42,10 +42,6 @@ #include "IMB_allocimbuf.h" #include "IMB_bitplanes.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - unsigned int **imb_copyplanelist(struct ImBuf *ibuf) { int nobp,i; diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index 9ef70a824ef..004a01d0ded 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -183,65 +183,63 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, int size, int flags) /* Couple of helper functions for writing our data */ int putIntLSB(unsigned int ui,FILE *ofile) { - putc((ui>>0)&0xFF,ofile); - putc((ui>>8)&0xFF,ofile); - putc((ui>>16)&0xFF,ofile); - return putc((ui>>24)&0xFF,ofile); + putc((ui>>0)&0xFF,ofile); + putc((ui>>8)&0xFF,ofile); + putc((ui>>16)&0xFF,ofile); + return putc((ui>>24)&0xFF,ofile); } int putShortLSB(unsigned short us,FILE *ofile) { - putc((us>>0)&0xFF,ofile); - return putc((us>>8)&0xFF,ofile); + putc((us>>0)&0xFF,ofile); + return putc((us>>8)&0xFF,ofile); } /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ short imb_savebmp(struct ImBuf *ibuf, char *name, int flags) { - BMPINFOHEADER infoheader; - int bytesize, extrabytes, x, y, t, ptr; - uchar *data; - FILE *ofile; - - extrabytes = (4 - ibuf->x*3 % 4) % 4; - bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y; - - data = (uchar *) ibuf->rect; - ofile = fopen(name,"wb"); - - putShortLSB(19778,ofile); /* "BM" */ - putIntLSB(0,ofile); /* This can be 0 for BI_RGB bitmaps */ - putShortLSB(0,ofile); /* Res1 */ - putShortLSB(0,ofile); /* Res2 */ - putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); - - putIntLSB(sizeof(infoheader),ofile); - putIntLSB(ibuf->x,ofile); - putIntLSB(ibuf->y,ofile); - putShortLSB(1,ofile); - putShortLSB(24,ofile); - putIntLSB(0,ofile); - putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); - putIntLSB(0,ofile); - - /* Need to write out padded image data in bgr format */ - for (y=0;y<ibuf->y;y++) { - for (x=0;x<ibuf->x;x++) { - - ptr=(x + y * ibuf->x) * 4; - if (putc(data[ptr+2],ofile) == EOF) return 0; - if (putc(data[ptr+1],ofile) == EOF) return 0; - if (putc(data[ptr],ofile) == EOF) return 0; - - } - /* add padding here */ - for (t=0;t<extrabytes;t++) if (putc(0,ofile) == EOF) return 0; - } - if (ofile) { - fflush(ofile); - fclose(ofile); - } - return 1; + BMPINFOHEADER infoheader; + int bytesize, extrabytes, x, y, t, ptr; + uchar *data; + FILE *ofile; + + extrabytes = (4 - ibuf->x*3 % 4) % 4; + bytesize = (ibuf->x * 3 + extrabytes) * ibuf->y; + + data = (uchar *) ibuf->rect; + ofile = fopen(name,"wb"); + + putShortLSB(19778,ofile); /* "BM" */ + putIntLSB(0,ofile); /* This can be 0 for BI_RGB bitmaps */ + putShortLSB(0,ofile); /* Res1 */ + putShortLSB(0,ofile); /* Res2 */ + putIntLSB(BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); + + putIntLSB(sizeof(infoheader),ofile); + putIntLSB(ibuf->x,ofile); + putIntLSB(ibuf->y,ofile); + putShortLSB(1,ofile); + putShortLSB(24,ofile); + putIntLSB(0,ofile); + putIntLSB(bytesize + BMP_FILEHEADER_SIZE + sizeof(infoheader),ofile); + putIntLSB(0,ofile); + putIntLSB(0,ofile); + putIntLSB(0,ofile); + putIntLSB(0,ofile); + + /* Need to write out padded image data in bgr format */ + for (y=0;y<ibuf->y;y++) { + for (x=0;x<ibuf->x;x++) { + ptr=(x + y * ibuf->x) * 4; + if (putc(data[ptr+2],ofile) == EOF) return 0; + if (putc(data[ptr+1],ofile) == EOF) return 0; + if (putc(data[ptr],ofile) == EOF) return 0; + } + /* add padding here */ + for (t=0;t<extrabytes;t++) if (putc(0,ofile) == EOF) return 0; + } + if (ofile) { + fflush(ofile); + fclose(ofile); + } + return 1; } diff --git a/source/blender/imbuf/intern/cmap.c b/source/blender/imbuf/intern/cmap.c index 9174293fe13..f5302b311d8 100644 --- a/source/blender/imbuf/intern/cmap.c +++ b/source/blender/imbuf/intern/cmap.c @@ -42,10 +42,6 @@ #include "IMB_cmap.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - static short *lastcube = 0; static uchar *lastcoltab = 0; static short lastmaxcol; @@ -88,12 +84,12 @@ void imb_losecmapbits(struct ImBuf *ibuf, unsigned int *coltab) if (ibuf->cbits == 0) return; if (ibuf->cbits >= 8) return; - /* - bij cbits = 5: - and1 = 11100000; - bij cbits = 6: - and1 = 11000000; - */ +/* + bij cbits = 5: + and1 = 11100000; + bij cbits = 6: + and1 = 11000000; +*/ bits = ibuf->cbits; and1 = ((1 << (8-bits)) - 1) & 0xff; @@ -352,17 +348,17 @@ short *imb_coldeltatab(unsigned char *coltab, short mincol, short maxcol, short if (colp[3]){ if ((b + sizep - 1) > max) colp[3] = 0; else done |= colp[3] = addplanetocube(cube + (sizep -1) * addcb, _plane, r, g, sizep, addcr, - addcg, max, j); + addcg, max, j); } if (colp[4]){ if ((g + sizep - 1) > max) colp[4] = 0; else done |= colp[4] = addplanetocube(cube + (sizep -1) * addcg, _plane, r, b, sizep, addcr, - addcb, max, j); + addcb, max, j); } if (colp[5]){ if ((r + sizep - 1) > max) colp[5] = 0; else done |= colp[5] = addplanetocube(cube + (sizep -1) * addcr, _plane, b, g, sizep, addcb, - addcg, max, j); + addcg, max, j); } colp += 6; diff --git a/source/blender/imbuf/intern/cspace.c b/source/blender/imbuf/intern/cspace.c index 51b1c3c6639..5cd2da5a998 100644 --- a/source/blender/imbuf/intern/cspace.c +++ b/source/blender/imbuf/intern/cspace.c @@ -37,10 +37,6 @@ #include "imbuf_patch.h" #include "IMB_imbuf_types.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /************************************************************************/ /* COLORSPACE */ /************************************************************************/ diff --git a/source/blender/imbuf/intern/data.c b/source/blender/imbuf/intern/data.c index 12e7b34436f..ad9194cb80e 100644 --- a/source/blender/imbuf/intern/data.c +++ b/source/blender/imbuf/intern/data.c @@ -35,10 +35,6 @@ #include "imbuf.h" #include "matrix.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /* static short quadbase[31] = { 150,133,117,102, diff --git a/source/blender/imbuf/intern/dither.c b/source/blender/imbuf/intern/dither.c index 367e23abcd9..608332af244 100644 --- a/source/blender/imbuf/intern/dither.c +++ b/source/blender/imbuf/intern/dither.c @@ -39,10 +39,6 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - void IMB_dit0(struct ImBuf * ibuf, short ofs, short bits) { int x, y, and, add, pix; diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 70958b08c21..3603128ce44 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -40,10 +40,6 @@ #include "IMB_imbuf.h" #include "IMB_divers.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - void imb_checkncols(struct ImBuf *ibuf) { unsigned int i; @@ -114,55 +110,55 @@ void IMB_de_interlace(struct ImBuf *ibuf) void IMB_interlace(struct ImBuf *ibuf) { - struct ImBuf * tbuf1, * tbuf2; + struct ImBuf * tbuf1, * tbuf2; - if (ibuf == 0) return; - ibuf->flags &= ~IB_fields; + if (ibuf == 0) return; + ibuf->flags &= ~IB_fields; - ibuf->y *= 2; + ibuf->y *= 2; - if (ibuf->rect) { - /* make copies */ - tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); - tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); + if (ibuf->rect) { + /* make copies */ + tbuf1 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); + tbuf2 = IMB_allocImBuf(ibuf->x, ibuf->y / 2, 32, IB_rect, 0); - IMB_rectop(tbuf1, ibuf, 0, 0, 0, 0, 32767, 32767, IMB_rectcpy, + IMB_rectop(tbuf1, ibuf, 0, 0, 0, 0, 32767, 32767, IMB_rectcpy, 0); - IMB_rectop(tbuf2, ibuf, 0, 0, 0, tbuf2->y, 32767, 32767, - IMB_rectcpy,0); + IMB_rectop(tbuf2, ibuf, 0, 0, 0, tbuf2->y, 32767, 32767, + IMB_rectcpy,0); - ibuf->x *= 2; - IMB_rectop(ibuf, tbuf1, 0, 0, 0, 0, 32767, 32767, IMB_rectcpy, + ibuf->x *= 2; + IMB_rectop(ibuf, tbuf1, 0, 0, 0, 0, 32767, 32767, IMB_rectcpy, 0); - IMB_rectop(ibuf, tbuf2, tbuf2->x, 0, 0, 0, 32767, 32767, - IMB_rectcpy,0); - ibuf->x /= 2; + IMB_rectop(ibuf, tbuf2, tbuf2->x, 0, 0, 0, 32767, 32767, + IMB_rectcpy,0); + ibuf->x /= 2; - IMB_freeImBuf(tbuf1); - IMB_freeImBuf(tbuf2); - } + IMB_freeImBuf(tbuf1); + IMB_freeImBuf(tbuf2); + } } void IMB_gamwarp(struct ImBuf *ibuf, double gamma) { - uchar gam[256]; - int i; - uchar *rect; - - if (ibuf == 0) return; - if (ibuf->rect == 0) return; - if (gamma == 1.0) return; - - gamma = 1.0 / gamma; - for (i = 255 ; i >= 0 ; i--) gam[i] = (255.0 * pow(i / 255.0 , - gamma)) + 0.5; - - rect = (uchar *) ibuf->rect; - for (i = ibuf->x * ibuf->y ; i>0 ; i--){ - rect ++; - *rect ++ = gam[*rect]; - *rect ++ = gam[*rect]; - *rect ++ = gam[*rect]; - } + uchar gam[256]; + int i; + uchar *rect; + + if (ibuf == 0) return; + if (ibuf->rect == 0) return; + if (gamma == 1.0) return; + + gamma = 1.0 / gamma; + for (i = 255 ; i >= 0 ; i--) gam[i] = (255.0 * pow(i / 255.0 , + gamma)) + 0.5; + + rect = (uchar *) ibuf->rect; + for (i = ibuf->x * ibuf->y ; i>0 ; i--){ + rect ++; + *rect ++ = gam[*rect]; + *rect ++ = gam[*rect]; + *rect ++ = gam[*rect]; + } } diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 74f9ec4508d..8aea42c7008 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -40,10 +40,6 @@ #include "IMB_imbuf.h" #include "IMB_filter.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /************************************************************************/ /* FILTERS */ diff --git a/source/blender/imbuf/intern/ham.c b/source/blender/imbuf/intern/ham.c index 3673b954c0e..383c79334bc 100644 --- a/source/blender/imbuf/intern/ham.c +++ b/source/blender/imbuf/intern/ham.c @@ -42,10 +42,6 @@ #include "IMB_hamx.h" #include "IMB_ham.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - extern short alpha_col0; #define HAMB 0x0100 diff --git a/source/blender/imbuf/intern/hamx.c b/source/blender/imbuf/intern/hamx.c index d1f4db1494a..d86b8b24bdf 100644 --- a/source/blender/imbuf/intern/hamx.c +++ b/source/blender/imbuf/intern/hamx.c @@ -34,10 +34,6 @@ #include "BLI_blenlib.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #ifdef WIN32 #include "BLI_winstuff.h" #include <io.h> @@ -544,7 +540,7 @@ short imb_enc_anim(struct ImBuf *ibuf, int file) steps = 2; break; } - if (steps == 0) return 0; + if (steps == 0) return 0; size = ((ibuf->x + 1)* (ibuf->y + 1)) / steps + 1024; if ((_buf1 = malloc(size)) == 0) return(0); diff --git a/source/blender/imbuf/intern/iff.c b/source/blender/imbuf/intern/iff.c index 04994e4820a..251799c9126 100644 --- a/source/blender/imbuf/intern/iff.c +++ b/source/blender/imbuf/intern/iff.c @@ -38,10 +38,6 @@ #include "IMB_imbuf_types.h" #include "IMB_iff.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - unsigned short imb_start_iff(struct ImBuf *ibuf, int file) { unsigned int *point, size, *buf; diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 78550903b69..dcdd0692fc4 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -42,10 +42,6 @@ #include "IMB_imbuf.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /* Only this one is used liberally here, and in imbuf */ void IMB_convert_rgba_to_abgr(int size, unsigned int *rect) { diff --git a/source/blender/imbuf/intern/imbuf_patch.h b/source/blender/imbuf/intern/imbuf_patch.h index e8d8faa14a1..f2d490d235b 100644 --- a/source/blender/imbuf/intern/imbuf_patch.h +++ b/source/blender/imbuf/intern/imbuf_patch.h @@ -62,7 +62,7 @@ typedef unsigned char uchar; /* These defines loop back to the internal Blender memory management * system, implemented in blenlib. */ #define NEW(x) (x*)MEM_mallocN(sizeof(x),# x) -#define mallocstruct(x,y) (x*)malloc((y)* sizeof(x)) +#define mallocstruct(x,y) (x*)malloc((y)* sizeof(x)) #define callocstruct(x,y) (x*)calloc((y), sizeof(x)) /* These vars are used thoughout the image buffer for conversions. */ diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 48b6f9bcf15..d9bb290ed74 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -42,39 +42,39 @@ #include "IMB_iris.h" typedef struct { - unsigned short imagic; /* stuff saved on disk . . */ - unsigned short type; - unsigned short dim; - unsigned short xsize; - unsigned short ysize; - unsigned short zsize; - unsigned int min; - unsigned int max; - unsigned int wastebytes; - char name[80]; - unsigned int colormap; - - int file; /* stuff used in core only */ - unsigned short flags; - short dorev; - short x; - short y; - short z; - short cnt; - unsigned short *ptr; - unsigned short *base; - unsigned short *tmpbuf; - unsigned int offset; - unsigned int rleend; /* for rle images */ - unsigned int *rowstart; /* for rle images */ - int *rowsize; /* for rle images */ + unsigned short imagic; /* stuff saved on disk . . */ + unsigned short type; + unsigned short dim; + unsigned short xsize; + unsigned short ysize; + unsigned short zsize; + unsigned int min; + unsigned int max; + unsigned int wastebytes; + char name[80]; + unsigned int colormap; + + int file; /* stuff used in core only */ + unsigned short flags; + short dorev; + short x; + short y; + short z; + short cnt; + unsigned short *ptr; + unsigned short *base; + unsigned short *tmpbuf; + unsigned int offset; + unsigned int rleend; /* for rle images */ + unsigned int *rowstart; /* for rle images */ + int *rowsize; /* for rle images */ } IMAGE; #define RINTLUM (79) #define GINTLUM (156) #define BINTLUM (21) -#define ILUM(r,g,b) ((int)(RINTLUM*(r)+GINTLUM*(g)+BINTLUM*(b))>>8) +#define ILUM(r,g,b) ((int)(RINTLUM*(r)+GINTLUM*(g)+BINTLUM*(b))>>8) #define OFFSET_R 0 /* this is byte order dependent */ #define OFFSET_G 1 @@ -374,14 +374,14 @@ struct ImBuf *imb_loadiris(unsigned char *mem, int flags) rect[1] = rect[2] = rect[3]; rect += 4; } - } else if (image.zsize == 2){ - /* grayscale with alpha */ - rect = (uchar *) ibuf->rect; - for (x = ibuf->x * ibuf->y; x > 0; x--) { - rect[0] = rect[2]; - rect[1] = rect[2] = rect[3]; - rect += 4; - } + } else if (image.zsize == 2){ + /* grayscale with alpha */ + rect = (uchar *) ibuf->rect; + for (x = ibuf->x * ibuf->y; x > 0; x--) { + rect[0] = rect[2]; + rect[1] = rect[2] = rect[3]; + rect += 4; + } } else if (image.zsize == 3){ /* add alpha */ rect = (uchar *) ibuf->rect; diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 378c43bc2ba..7cc4e4fdefe 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -44,10 +44,6 @@ #include "IMB_jpeg.h" #include "jpeglib.h" -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - /* the types are from the jpeg lib */ static void jpeg_error (j_common_ptr cinfo); static void init_source(j_decompress_ptr cinfo); @@ -93,16 +89,16 @@ static void jpeg_error (j_common_ptr cinfo) } //---------------------------------------------------------- -// INPUT HANDLER FROM MEMORY +// INPUT HANDLER FROM MEMORY //---------------------------------------------------------- typedef struct { - unsigned char *buffer; - int filled; + unsigned char *buffer; + int filled; } buffer_struct; typedef struct { - struct jpeg_source_mgr pub; /* public fields */ + struct jpeg_source_mgr pub; /* public fields */ unsigned char *buffer; int size; @@ -150,28 +146,27 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, int siz my_src_ptr src; if (cinfo->src == NULL) - { /* first time for this JPEG object? */ + { /* first time for this JPEG object? */ cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_PERMANENT, - sizeof(my_source_mgr)); + ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr)); } src = (my_src_ptr) cinfo->src; - src->pub.init_source = init_source; - src->pub.fill_input_buffer = fill_input_buffer; - src->pub.skip_input_data = skip_input_data; - src->pub.resync_to_restart = jpeg_resync_to_restart; - src->pub.term_source = term_source; + src->pub.init_source = init_source; + src->pub.fill_input_buffer = fill_input_buffer; + src->pub.skip_input_data = skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; + src->pub.term_source = term_source; - src->pub.bytes_in_buffer = size; - src->pub.next_input_byte = buffer; + src->pub.bytes_in_buffer = size; + src->pub.next_input_byte = buffer; src->buffer = buffer; src->size = size; } -#define MAKESTMT(stuff) do { stuff } while (0) +#define MAKESTMT(stuff) do { stuff } while (0) #define INPUT_VARS(cinfo) \ struct jpeg_source_mgr * datasrc = (cinfo)->src; \ @@ -194,9 +189,9 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, int siz */ #define MAKE_BYTE_AVAIL(cinfo,action) \ if (bytes_in_buffer == 0) { \ - if (! (*datasrc->fill_input_buffer) (cinfo)) \ - { action; } \ - INPUT_RELOAD(cinfo); \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ } \ bytes_in_buffer-- @@ -344,7 +339,7 @@ static ImBuf * ibJpegImageFromCinfo(struct jpeg_decompress_struct * cinfo, int f jpeg_destroy((j_common_ptr) cinfo); ibuf->ftype = ibuf_ftype; - } + } return(ibuf); } diff --git a/source/blender/imbuf/intern/matrix.h b/source/blender/imbuf/intern/matrix.h index f2db8057b32..e062ee38f8f 100644 --- a/source/blender/imbuf/intern/matrix.h +++ b/source/blender/imbuf/intern/matrix.h @@ -41,7 +41,7 @@ float rgbyuv[4][4]={ /* afgeleid uit videoframer = Y Cr Cb in kopieen van Fra {-.16874, .29900, .50000, 0.0,}, /* r */ { 128.0, 0.0, 128.0, 1.0}}; - /* b-y (u) y r-y (v) */ + /* b-y (u) y r-y (v) */ float rgbbeta[4][4]={ /* afgeleid uit videoframer = Y Cr Cb in kopieen van Francois*/ @@ -51,7 +51,7 @@ float rgbbeta[4][4]={ /* afgeleid uit videoframer = Y Cr Cb in kopieen van Fr {-.16874, .29900, .50000, 0.0,}, /* r-y -> r */ { 128.0, 0.0, 128.0, 1.0}}; - /* b-y y r-y */ + /* b-y y r-y */ diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 50b65befe48..27957a34351 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -49,9 +49,9 @@ #include "IMB_png.h" typedef struct PNGReadStruct { - unsigned char *data; - unsigned int size; - unsigned int seek; + unsigned char *data; + unsigned int size; + unsigned int seek; }PNGReadStruct; static void ReadData( png_structp png_ptr, png_bytep data, png_size_t length); @@ -60,13 +60,10 @@ static void Flush( png_structp png_ptr); int imb_is_a_png(void *mem) { - int ret_val = 0; + int ret_val = 0; - if (mem) { - ret_val = !png_sig_cmp(mem, 0, 8); - } - - return(ret_val); + if (mem) ret_val = !png_sig_cmp(mem, 0, 8); + return(ret_val); } static void Flush(png_structp png_ptr) diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 60983bdff1e..a694fca862f 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -32,10 +32,6 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #ifdef WIN32 #include "BLI_winstuff.h" #endif @@ -99,22 +95,22 @@ void IMB_rectop(struct ImBuf *dbuf, tmp = dbuf->x - destx; if (width > tmp) width = tmp; - tmp = dbuf->y - desty; + tmp = dbuf->y - desty; if (height > tmp) height = tmp; drect = dbuf->rect + desty * dbuf->x + destx; destx = dbuf->x; if (sbuf){ - tmp = sbuf->x - srcx; + tmp = sbuf->x - srcx; if (width > tmp) width = tmp; - tmp = sbuf->y - srcy; + tmp = sbuf->y - srcy; if (height > tmp) height = tmp; if (width <= 0) return; if (height <= 0) return; - srect = sbuf->rect; + srect = sbuf->rect; srect += srcy * sbuf->x; srect += srcx; srcx = sbuf->x; @@ -134,10 +130,8 @@ void IMB_rectop(struct ImBuf *dbuf, } -void IMB_rectoptot(struct ImBuf *dbuf, - struct ImBuf *sbuf, - void (*operation)(unsigned int *, unsigned int*, int, int), - int value) +void IMB_rectoptot(struct ImBuf *dbuf, struct ImBuf *sbuf, + void (*operation)(unsigned int *, unsigned int*, int, int), int value) { IMB_rectop(dbuf,sbuf,0,0,0,0,32767,32767,operation, value); } diff --git a/source/blender/imbuf/intern/rotate.c b/source/blender/imbuf/intern/rotate.c index 34ea65af1ab..edd82347a8c 100644 --- a/source/blender/imbuf/intern/rotate.c +++ b/source/blender/imbuf/intern/rotate.c @@ -32,10 +32,6 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #ifdef WIN32 #include "BLI_winstuff.h" #endif diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index 477fbecf5c8..eb397f6bced 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -32,10 +32,6 @@ * $Id$ */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #ifdef WIN32 #include "BLI_winstuff.h" #endif diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 40e1b60d36c..6b8427339d2 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -285,11 +285,11 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags) if (flags & IB_ttob) buf[17] ^= 0x20; - /* Don't forget to indicate that your 32 bit - * targa uses 8 bits for the alpha channel! */ - if (ibuf->depth==32) { - buf[17] |= 0x08; - } + /* Don't forget to indicate that your 32 bit + * targa uses 8 bits for the alpha channel! */ + if (ibuf->depth==32) { + buf[17] |= 0x08; + } fildes = fopen(name,"wb"); diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 07756d62d96..729e95612f0 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -215,7 +215,7 @@ int IMB_ispic(char *filename) static int isavi (char *name) { - return AVI_is_avi (name); + return AVI_is_avi (name); } #ifdef WITH_QUICKTIME @@ -230,8 +230,8 @@ int imb_get_anim_type(char * name) { if(UTIL_DEBUG) printf("in getanimtype: %s\n", name); - if (ib_stat(name,&st) == -1) return(0); - if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); + if (ib_stat(name,&st) == -1) return(0); + if (((st.st_mode) & S_IFMT) != S_IFREG) return(0); if (isavi(name)) return (ANIM_AVI); diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index abbc8356aa4..ffc1c12d00d 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -70,16 +70,16 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags) } if (IS_png(ibuf)) { return imb_savepng(ibuf,naam,flags); - } - if (IS_bmp(ibuf)) { - return imb_savebmp(ibuf,naam,flags); - } + } + if (IS_bmp(ibuf)) { + return imb_savebmp(ibuf,naam,flags); + } if (IS_tga(ibuf)) { return imb_savetarga(ibuf,naam,flags); - } + } if (IS_iris(ibuf)) { return imb_saveiris(ibuf,naam,flags); - } + } file = open(naam, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666); if (file < 0) return (FALSE); |