[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46687] trunk/blender/source/blender/imbuf /intern: style cleanup: imbuf
Campbell Barton
ideasman42 at gmail.com
Wed May 16 11:26:37 CEST 2012
Revision: 46687
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46687
Author: campbellbarton
Date: 2012-05-16 09:26:37 +0000 (Wed, 16 May 2012)
Log Message:
-----------
style cleanup: imbuf
Modified Paths:
--------------
trunk/blender/source/blender/imbuf/intern/IMB_anim.h
trunk/blender/source/blender/imbuf/intern/IMB_metadata.h
trunk/blender/source/blender/imbuf/intern/anim_movie.c
trunk/blender/source/blender/imbuf/intern/bmp.c
trunk/blender/source/blender/imbuf/intern/cache.c
trunk/blender/source/blender/imbuf/intern/indexer.c
trunk/blender/source/blender/imbuf/intern/indexer_dv.c
trunk/blender/source/blender/imbuf/intern/iris.c
trunk/blender/source/blender/imbuf/intern/jp2.c
trunk/blender/source/blender/imbuf/intern/moviecache.c
trunk/blender/source/blender/imbuf/intern/openexr/openexr_multi.h
trunk/blender/source/blender/imbuf/intern/radiance_hdr.c
trunk/blender/source/blender/imbuf/intern/scaling.c
trunk/blender/source/blender/imbuf/intern/thumbs.c
trunk/blender/source/blender/imbuf/intern/thumbs_blend.c
trunk/blender/source/blender/imbuf/intern/tiff.c
Modified: trunk/blender/source/blender/imbuf/intern/IMB_anim.h
===================================================================
--- trunk/blender/source/blender/imbuf/intern/IMB_anim.h 2012-05-16 09:22:59 UTC (rev 46686)
+++ trunk/blender/source/blender/imbuf/intern/IMB_anim.h 2012-05-16 09:26:37 UTC (rev 46687)
@@ -107,15 +107,15 @@
#endif
/* anim.curtype, runtime only */
-#define ANIM_NONE 0
-#define ANIM_SEQUENCE (1 << 0)
-#define ANIM_MOVIE (1 << 4)
-#define ANIM_AVI (1 << 6)
-#define ANIM_QTIME (1 << 7)
+#define ANIM_NONE 0
+#define ANIM_SEQUENCE (1 << 0)
+#define ANIM_MOVIE (1 << 4)
+#define ANIM_AVI (1 << 6)
+#define ANIM_QTIME (1 << 7)
#define ANIM_FFMPEG (1 << 8)
#define ANIM_REDCODE (1 << 9)
-#define MAXNUMSTREAMS 50
+#define MAXNUMSTREAMS 50
struct _AviMovie;
struct anim_index;
@@ -123,18 +123,18 @@
struct anim {
int ib_flags;
int curtype;
- int curposition; /* index 0 = 1e, 1 = 2e, enz. */
+ int curposition; /* index 0 = 1e, 1 = 2e, enz. */
int duration;
short frs_sec;
float frs_sec_base;
int x, y;
- /* voor op nummer */
+ /* voor op nummer */
char name[1024];
- /* voor sequence */
+ /* voor sequence */
char first[1024];
- /* movie */
+ /* movie */
void *movie;
void *track;
void *params;
@@ -144,21 +144,21 @@
int preseek;
int streamindex;
- /* avi */
+ /* avi */
struct _AviMovie *avi;
#if defined(_WIN32) && !defined(FREE_WINDOWS)
- /* windows avi */
+ /* windows avi */
int avistreams;
int firstvideo;
int pfileopen;
- PAVIFILE pfile;
- PAVISTREAM pavi[MAXNUMSTREAMS]; // the current streams
- PGETFRAME pgf;
+ PAVIFILE pfile;
+ PAVISTREAM pavi[MAXNUMSTREAMS]; // the current streams
+ PGETFRAME pgf;
#endif
#ifdef WITH_QUICKTIME
- /* quicktime */
+ /* quicktime */
struct _QuicktimeMovie *qtime;
#endif /* WITH_QUICKTIME */
@@ -173,14 +173,14 @@
struct SwsContext *img_convert_ctx;
int videoStream;
- struct ImBuf * last_frame;
+ struct ImBuf *last_frame;
int64_t last_pts;
int64_t next_pts;
AVPacket next_packet;
#endif
#ifdef WITH_REDCODE
- struct redcode_handle * redcodeCtx;
+ struct redcode_handle *redcodeCtx;
#endif
char index_dir[768];
@@ -188,10 +188,9 @@
int proxies_tried;
int indices_tried;
- struct anim * proxy_anim[IMB_PROXY_MAX_SLOT];
- struct anim_index * curr_idx[IMB_TC_MAX_SLOT];
+ struct anim *proxy_anim[IMB_PROXY_MAX_SLOT];
+ struct anim_index *curr_idx[IMB_TC_MAX_SLOT];
};
#endif
-
Modified: trunk/blender/source/blender/imbuf/intern/IMB_metadata.h
===================================================================
--- trunk/blender/source/blender/imbuf/intern/IMB_metadata.h 2012-05-16 09:22:59 UTC (rev 46686)
+++ trunk/blender/source/blender/imbuf/intern/IMB_metadata.h 2012-05-16 09:26:37 UTC (rev 46687)
@@ -37,8 +37,8 @@
typedef struct ImMetaData {
struct ImMetaData *next, *prev;
- char* key;
- char* value;
+ char *key;
+ char *value;
int len;
} ImMetaData;
@@ -52,7 +52,7 @@
/* free blender ImMetaData struct */
-void IMB_metadata_free(struct ImBuf* img);
+void IMB_metadata_free(struct ImBuf *img);
/** read the field from the image info into the field
* \param img - the ImBuf that contains the image data
@@ -62,7 +62,7 @@
* \param len - length of value buffer allocated by user.
* \return - 1 (true) if ImageInfo present and value for the key found, 0 (false) otherwise
*/
-int IMB_metadata_get_field(struct ImBuf* img, const char* key, char* value, int len);
+int IMB_metadata_get_field(struct ImBuf *img, const char *key, char *value, int len);
/** set user data in the ImMetaData struct, which has to be allocated with IMB_metadata_create
* before calling this function.
@@ -71,7 +71,7 @@
* \param value - the data to be written to the field. zero terminated string
* \return - 1 (true) if ImageInfo present, 0 (false) otherwise
*/
-int IMB_metadata_add_field(struct ImBuf* img, const char* key, const char* value);
+int IMB_metadata_add_field(struct ImBuf *img, const char *key, const char *value);
/** delete the key/field par in the ImMetaData struct.
* \param img - the ImBuf that contains the image data
Modified: trunk/blender/source/blender/imbuf/intern/anim_movie.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/anim_movie.c 2012-05-16 09:22:59 UTC (rev 46686)
+++ trunk/blender/source/blender/imbuf/intern/anim_movie.c 2012-05-16 09:26:37 UTC (rev 46687)
@@ -119,10 +119,16 @@
return 0;
}
- /* never called, just keep the linker happy */
-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)) { ; }
+/* never called, just keep the linker happy */
+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)) {
+ ;
+}
#if defined(_WIN32)
@@ -131,24 +137,24 @@
# define PATHSEPERATOR '/'
#endif
-static int an_stringdec(const char *string, char* head, char *tail, unsigned short *numlen)
+static int an_stringdec(const char *string, char *head, char *tail, unsigned short *numlen)
{
- unsigned short len, nume, nums=0;
- short i, found=FALSE;
+ unsigned short len, nume, nums = 0;
+ short i, found = FALSE;
- len=strlen(string);
+ len = strlen(string);
nume = len;
- for (i=len-1;i>=0;i--) {
- if (string[i]==PATHSEPERATOR) break;
+ for (i = len - 1; i >= 0; i--) {
+ if (string[i] == PATHSEPERATOR) break;
if (isdigit(string[i])) {
if (found) {
- nums=i;
+ nums = i;
}
else {
- nume=i;
- nums=i;
- found=TRUE;
+ nume = i;
+ nums = i;
+ found = TRUE;
}
}
else {
@@ -156,15 +162,15 @@
}
}
if (found) {
- strcpy(tail, &string[nume+1]);
+ strcpy(tail, &string[nume + 1]);
strcpy(head, string);
- head[nums]= '\0';
- *numlen=nume-nums+1;
+ head[nums] = '\0';
+ *numlen = nume - nums + 1;
return ((int)atoi(&(string[nums])));
}
- tail[0]= '\0';
+ tail[0] = '\0';
strcpy(head, string);
- *numlen=0;
+ *numlen = 0;
return TRUE;
}
@@ -174,7 +180,7 @@
BLI_stringenc(string, head, tail, numlen, pic);
}
-static void free_anim_avi (struct anim *anim)
+static void free_anim_avi(struct anim *anim)
{
#if defined(_WIN32) && !defined(FREE_WINDOWS)
int i;
@@ -183,8 +189,8 @@
if (anim == NULL) return;
if (anim->avi == NULL) return;
- AVI_close (anim->avi);
- MEM_freeN (anim->avi);
+ AVI_close(anim->avi);
+ MEM_freeN(anim->avi);
anim->avi = NULL;
#if defined(_WIN32) && !defined(FREE_WINDOWS)
@@ -210,13 +216,13 @@
}
#ifdef WITH_FFMPEG
-static void free_anim_ffmpeg(struct anim * anim);
+static void free_anim_ffmpeg(struct anim *anim);
#endif
#ifdef WITH_REDCODE
-static void free_anim_redcode(struct anim * anim);
+static void free_anim_redcode(struct anim *anim);
#endif
-void IMB_free_anim(struct anim * anim)
+void IMB_free_anim(struct anim *anim)
{
if (anim == NULL) {
printf("free anim, anim == NULL\n");
@@ -240,7 +246,7 @@
MEM_freeN(anim);
}
-void IMB_close_anim(struct anim * anim)
+void IMB_close_anim(struct anim *anim)
{
if (anim == NULL) return;
@@ -255,11 +261,10 @@
IMB_free_indices(anim);
}
-struct anim * IMB_open_anim(const char * name, int ib_flags, int streamindex)
-{
- struct anim * anim;
+struct anim *IMB_open_anim(const char *name, int ib_flags, int streamindex){
+ struct anim *anim;
- anim = (struct anim*)MEM_callocN(sizeof(struct anim), "anim struct");
+ anim = (struct anim *)MEM_callocN(sizeof(struct anim), "anim struct");
if (anim != NULL) {
BLI_strncpy(anim->name, name, sizeof(anim->name));
anim->ib_flags = ib_flags;
@@ -269,12 +274,12 @@
}
-static int startavi (struct anim *anim)
+static int startavi(struct anim *anim)
{
AviError avierror;
#if defined(_WIN32) && !defined(FREE_WINDOWS)
- HRESULT hr;
+ HRESULT hr;
int i, firstvideo = -1;
int streamcount;
BYTE abFormat[1024];
@@ -285,14 +290,14 @@
streamcount = anim->streamindex;
#endif
- anim->avi = MEM_callocN (sizeof(AviMovie), "animavi");
+ anim->avi = MEM_callocN(sizeof(AviMovie), "animavi");
if (anim->avi == NULL) {
printf("Can't open avi: %s\n", anim->name);
return -1;
}
- avierror = AVI_open_movie (anim->name, anim->avi);
+ avierror = AVI_open_movie(anim->name, anim->avi);
#if defined(_WIN32) && !defined(FREE_WINDOWS)
if (avierror == AVI_ERROR_COMPRESSION) {
@@ -329,8 +334,8 @@
FIXCC(avis.fccHandler);
FIXCC(avis.fccType);
printf("Can't find AVI decoder for type : %4.4hs/%4.4hs\n",
- (LPSTR)&avis.fccType,
- (LPSTR)&avis.fccHandler);
+ (LPSTR)&avis.fccType,
+ (LPSTR)&avis.fccHandler);
}
}
}
@@ -357,7 +362,7 @@
if (avierror != AVI_ERROR_NONE) {
AVI_print_error(avierror);
- printf ("Error loading avi: %s\n", anim->name);
+ printf("Error loading avi: %s\n", anim->name);
free_anim_avi(anim);
return -1;
}
@@ -379,7 +384,7 @@
return 0;
}
-static ImBuf * avi_fetchibuf (struct anim *anim, int position)
+static ImBuf *avi_fetchibuf(struct anim *anim, int position)
{
ImBuf *ibuf = NULL;
int *tmp;
@@ -403,23 +408,23 @@
#else
if (1) {
#endif
- ibuf = IMB_allocImBuf (anim->x, anim->y, 24, IB_rect);
+ ibuf = IMB_allocImBuf(anim->x, anim->y, 24, IB_rect);
- tmp = AVI_read_frame (anim->avi, AVI_FORMAT_RGB32, position,
- AVI_get_stream(anim->avi, AVIST_VIDEO, 0));
+ tmp = AVI_read_frame(anim->avi, AVI_FORMAT_RGB32, position,
+ AVI_get_stream(anim->avi, AVIST_VIDEO, 0));
if (tmp == NULL) {
- printf ("Error reading frame from AVI");
- IMB_freeImBuf (ibuf);
+ printf("Error reading frame from AVI");
+ IMB_freeImBuf(ibuf);
return NULL;
}
- for (y=0; y < anim->y; y++) {
- memcpy (&(ibuf->rect)[((anim->y-y)-1)*anim->x], &tmp[y*anim->x],
- anim->x * 4);
+ for (y = 0; y < anim->y; y++) {
+ memcpy(&(ibuf->rect)[((anim->y - y) - 1) * anim->x], &tmp[y * anim->x],
+ anim->x * 4);
}
- MEM_freeN (tmp);
+ MEM_freeN(tmp);
}
ibuf->profile = IB_PROFILE_SRGB;
@@ -431,9 +436,9 @@
extern void do_init_ffmpeg(void);
-static int startffmpeg(struct anim * anim)
+static int startffmpeg(struct anim *anim)
{
- int i, videoStream;
+ int i, videoStream;
AVCodec *pCodec;
AVFormatContext *pFormatCtx;
@@ -455,11 +460,11 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list