From 4b449aefea62999aecd0610e6d7f25e6e927c529 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 21 Sep 2011 08:40:30 +0000 Subject: remove support for irix --- source/blender/imbuf/intern/anim_movie.c | 104 ------------------------------- 1 file changed, 104 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index c4fe1523e90..3c3cecc0e96 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -114,109 +114,6 @@ #endif #endif -/****/ - -#ifdef __sgi - -#include - -static void movie_printerror(char * str) { - const char * errstr = mvGetErrorStr(mvGetErrno()); - - if (str) { - if (errstr) printf("%s: %s\n", str, errstr); - else printf("%s: returned error\n", str); - } else printf("%s\n", errstr); -} - -static int startmovie(struct anim * anim) { - if (anim == 0) return(-1); - - if ( mvOpenFile (anim->name, O_BINARY|O_RDONLY, &anim->movie ) != DM_SUCCESS ) { - printf("Can't open movie: %s\n", anim->name); - return(-1); - } - if ( mvFindTrackByMedium (anim->movie, DM_IMAGE, &anim->track) != DM_SUCCESS ) { - printf("No image track in movie: %s\n", anim->name); - mvClose(anim->movie); - return(-1); - } - - anim->duration = mvGetTrackLength (anim->track); - anim->params = mvGetParams( anim->track ); - - anim->x = dmParamsGetInt( anim->params, DM_IMAGE_WIDTH); - anim->y = dmParamsGetInt( anim->params, DM_IMAGE_HEIGHT); - anim->interlacing = dmParamsGetEnum (anim->params, DM_IMAGE_INTERLACING); - anim->orientation = dmParamsGetEnum (anim->params, DM_IMAGE_ORIENTATION); - anim->framesize = dmImageFrameSize(anim->params); - - anim->curposition = 0; - anim->preseek = 0; - - /*printf("x:%d y:%d size:%d interl:%d dur:%d\n", anim->x, anim->y, anim->framesize, anim->interlacing, anim->duration);*/ - return (0); -} - -static ImBuf * movie_fetchibuf(struct anim * anim, int position) { - ImBuf * ibuf; -/* extern rectcpy(); */ - int size; - unsigned int *rect1, *rect2; - - if (anim == 0) return (0); - - ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect); - - if ( mvReadFrames(anim->track, position, 1, ibuf->x * ibuf->y * - 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; - - for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){ - *rect1-- = *rect2--; - } - } -*/ - - if (anim->interlacing == DM_IMAGE_INTERLACED_EVEN) - { - rect1 = ibuf->rect; - rect2 = rect1 + ibuf->x; - - for (size = ibuf->x * (ibuf->y - 1); size > 0; size--){ - *rect1++ = *rect2++; - } - } - /*if (anim->orientation == DM_TOP_TO_BOTTOM) IMB_flipy(ibuf);*/ - - - return(ibuf); -} - -static void free_anim_movie(struct anim * anim) { - if (anim == NULL) return; - - if (anim->movie) { - mvClose(anim->movie); - anim->movie = NULL; - } - anim->duration = 0; -} - -int ismovie(char *name) { - return (mvIsMovieFile(name) == DM_TRUE); -} - -#else - int ismovie(const char *UNUSED(name)) { return 0; } @@ -226,7 +123,6 @@ static int startmovie(struct anim *UNUSED(anim)) { return 1; } static ImBuf * movie_fetchibuf(struct anim *UNUSED(anim), int UNUSED(position)) { return NULL; } static void free_anim_movie(struct anim *UNUSED(anim)) { ; } -#endif #if defined(_WIN32) # define PATHSEPERATOR '\\' -- cgit v1.2.3 From 86d528afa7c54d74162f2ef873da5c62b5c77b52 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Sep 2011 03:14:50 +0000 Subject: comment some unused vars / assignments. --- source/blender/imbuf/intern/jpeg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index 0759d97e69f..b87b46ca464 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -255,12 +255,12 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t static boolean handle_app1 (j_decompress_ptr cinfo) { - INT32 length, i; + INT32 length; /* initialized by the macro */ + INT32 i; char neogeo[128]; INPUT_VARS(cinfo); - - length = 0; + INPUT_2BYTES(cinfo, length, return FALSE); length -= 2; -- cgit v1.2.3 From 274b9c8fb88ff6499ac3b13a081c1e60965e459e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Sep 2011 12:31:21 +0000 Subject: whitespace cleanup --- source/blender/imbuf/intern/indexer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 2e45c0eb07a..d79e881e5a2 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -183,9 +183,9 @@ struct anim_index * IMB_indexer_open(const char * name) BLI_strncpy(idx->name, name, sizeof(idx->name)); - fseek(fp, 0, SEEK_END); + fseek(fp, 0, SEEK_END); - idx->num_entries = (ftell(fp) - 12) + idx->num_entries = (ftell(fp) - 12) / (sizeof(int) // framepos + sizeof(unsigned long long) // seek_pos + sizeof(unsigned long long) // seek_pos_dts -- cgit v1.2.3 From 018fa1540eaef603b28c04fd5b8533d21122e36f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 28 Sep 2011 05:53:40 +0000 Subject: whitespace edits, make formatting for functions consustent at least within the file. --- source/blender/imbuf/intern/bmp.c | 8 ++++---- source/blender/imbuf/intern/imageprocess.c | 6 ++++-- source/blender/imbuf/intern/indexer_dv.c | 3 ++- source/blender/imbuf/intern/jpeg.c | 4 ++-- source/blender/imbuf/intern/targa.c | 3 ++- 5 files changed, 14 insertions(+), 10 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index d79acc88a80..bfec60245b8 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -101,8 +101,8 @@ static int checkbmp(unsigned char *mem) return(ret_val); } -int imb_is_a_bmp(unsigned char *buf) { - +int imb_is_a_bmp(unsigned char *buf) +{ return checkbmp(buf); } @@ -200,8 +200,8 @@ static int putShortLSB(unsigned short us,FILE *ofile) { } /* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */ -int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) { - +int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) +{ BMPINFOHEADER infoheader; int bytesize, extrabytes, x, y, t, ptr; uchar *data; diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index 1ac4e4e06cb..49f81edd4b2 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -111,7 +111,8 @@ static void pixel_from_buffer(struct ImBuf *ibuf, unsigned char **outI, float ** */ /* function assumes out to be zero'ed, only does RGBA */ -static float P(float k){ +static float P(float k) +{ float p1, p2, p3, p4; p1 = MAX2(k+2.0f,0); p2 = MAX2(k+1.0f,0); @@ -123,7 +124,8 @@ static float P(float k){ #if 0 /* older, slower function, works the same as above */ -static float P(float k){ +static float P(float k) +{ return (float)(1.0f/6.0f)*( pow( MAX2(k+2.0f,0) , 3.0f ) - 4.0f * pow( MAX2(k+1.0f,0) , 3.0f ) + 6.0f * pow( MAX2(k,0) , 3.0f ) - 4.0f * pow( MAX2(k-1.0f,0) , 3.0f)); } #endif diff --git a/source/blender/imbuf/intern/indexer_dv.c b/source/blender/imbuf/intern/indexer_dv.c index d1202136d56..aa258a6b9ee 100644 --- a/source/blender/imbuf/intern/indexer_dv.c +++ b/source/blender/imbuf/intern/indexer_dv.c @@ -56,7 +56,8 @@ static unsigned long bitstream_get_bits(indexer_dv_bitstream * This, int num) return rval; } -static int parse_num(indexer_dv_bitstream * b, int numbits) { +static int parse_num(indexer_dv_bitstream * b, int numbits) +{ return bitstream_get_bits(b, numbits); } diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index b87b46ca464..53d4a403190 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -84,8 +84,8 @@ type 3 is unsupported as of jul 05 2000 Frank. static int jpeg_default_quality; static int ibuf_ftype; -int imb_is_a_jpeg(unsigned char *mem) { - +int imb_is_a_jpeg(unsigned char *mem) +{ if ((mem[0]== 0xFF) && (mem[1] == 0xD8))return 1; return 0; } diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index ec00b15c079..c757b435d90 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -338,7 +338,8 @@ static int checktarga(TARGA *tga, unsigned char *mem) return(1); } -int imb_is_a_targa(unsigned char *buf) { +int imb_is_a_targa(unsigned char *buf) +{ TARGA tga; return checktarga(&tga, buf); -- cgit v1.2.3 From 35f881b44dfed78290770f929405b63f480d78cb Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 28 Sep 2011 15:22:13 +0000 Subject: Commented and tagged some unused vars, added some var init (gcc warnings...) --- source/blender/imbuf/intern/anim_movie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 3c3cecc0e96..b9500c2f798 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -900,8 +900,8 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position, long long st_time; struct anim_index * tc_index = 0; AVStream * v_st; - int new_frame_index; - int old_frame_index; + int new_frame_index = 0; /* To quite gcc barking... */ + int old_frame_index = 0; /* To quite gcc barking... */ if (anim == 0) return (0); -- cgit v1.2.3 From c27926896f4661f2764f96a1b5e2efd30820523c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Oct 2011 22:04:01 +0000 Subject: spaces -> tabs (whitespace only changes) --- source/blender/imbuf/intern/openexr/openexr_api.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 88f6508d356..e064d7f760d 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -98,7 +98,7 @@ class Mem_IStream: public IStream public: Mem_IStream (unsigned char *exrbuf, size_t exrsize): - IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } + IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } virtual bool read (char c[], int n); virtual Int64 tellg (); @@ -107,8 +107,8 @@ public: //virtual ~Mem_IStream() {}; // unused private: - - Int64 _exrpos; + + Int64 _exrpos; Int64 _exrsize; unsigned char *_exrbuf; }; @@ -116,11 +116,11 @@ private: bool Mem_IStream::read (char c[], int n) { if (n + _exrpos <= _exrsize) - { + { memcpy(c, (void *)(&_exrbuf[_exrpos]), n); _exrpos += n; return true; - } + } else return false; } @@ -308,7 +308,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags delete [] pixels; } catch (const std::exception &exc) - { + { printf("OpenEXR-save: ERROR: %s\n", exc.what()); if (ibuf) IMB_freeImBuf(ibuf); @@ -365,7 +365,7 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag delete file; } catch (const std::exception &exc) - { + { printf("OpenEXR-save: ERROR: %s\n", exc.what()); if (ibuf) IMB_freeImBuf(ibuf); -- cgit v1.2.3