Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-11 18:30:53 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-11 18:30:53 +0400
commit4f33d65ba1f02f2cd3f340d0123900ea1beffd2c (patch)
tree05ef40081ce6be190a171e0fee09b12344e16eb6 /source/blender/imbuf
parent1ab9fc59b750b1dc5ebaacd30c6891949895a10d (diff)
parent79f21f88c2be305962f6432bf8b1af94056fd92b (diff)
Cycles: svn merge -r40411:40934 ^/trunk/blender
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/anim_movie.c108
-rw-r--r--source/blender/imbuf/intern/bmp.c8
-rw-r--r--source/blender/imbuf/intern/imageprocess.c6
-rw-r--r--source/blender/imbuf/intern/indexer.c4
-rw-r--r--source/blender/imbuf/intern/indexer_dv.c3
-rw-r--r--source/blender/imbuf/intern/jpeg.c10
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp14
-rw-r--r--source/blender/imbuf/intern/targa.c3
8 files changed, 28 insertions, 128 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index c4fe1523e90..b9500c2f798 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 <dmedia/moviefile.h>
-
-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 '\\'
@@ -1004,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);
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.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
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 0759d97e69f..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;
}
@@ -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;
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);
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);