[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46413] trunk/blender/source/blender/ blenkernel/intern/seqeffects.c: style cleanup: seqeffects
Campbell Barton
ideasman42 at gmail.com
Tue May 8 11:31:25 CEST 2012
Revision: 46413
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46413
Author: campbellbarton
Date: 2012-05-08 09:31:25 +0000 (Tue, 08 May 2012)
Log Message:
-----------
style cleanup: seqeffects
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/seqeffects.c
Modified: trunk/blender/source/blender/blenkernel/intern/seqeffects.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/seqeffects.c 2012-05-08 09:10:58 UTC (rev 46412)
+++ trunk/blender/source/blender/blenkernel/intern/seqeffects.c 2012-05-08 09:31:25 UTC (rev 46413)
@@ -58,27 +58,27 @@
#include "RNA_access.h"
/* **** XXX **** */
-static void error(const char *UNUSED(error), ...) {}
+static void error(const char *UNUSED(error), ...) {
+}
-#define INT 96
-#define FLO 128
+#define INT 96
+#define FLO 128
/* **** XXX **** */
/* Glow effect */
enum {
- GlowR=0,
- GlowG=1,
- GlowB=2,
- GlowA=3
+ GlowR = 0,
+ GlowG = 1,
+ GlowB = 2,
+ GlowA = 3
};
-static struct ImBuf * prepare_effect_imbufs(
- SeqRenderData context,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3)
-{
- struct ImBuf * out;
+static struct ImBuf *prepare_effect_imbufs(
+ SeqRenderData context,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3){
+ struct ImBuf *out;
int x = context.rectx;
int y = context.recty;
@@ -87,8 +87,9 @@
out = IMB_allocImBuf((short)x, (short)y, 32, IB_rect);
}
else if ((ibuf1 && ibuf1->rect_float) ||
- (ibuf2 && ibuf2->rect_float) ||
- (ibuf3 && ibuf3->rect_float)) {
+ (ibuf2 && ibuf2->rect_float) ||
+ (ibuf3 && ibuf3->rect_float))
+ {
/* if any inputs are rectfloat, output is float too */
out = IMB_allocImBuf((short)x, (short)y, 32, IB_rectfloat);
@@ -127,15 +128,15 @@
static void open_plugin_seq(PluginSeq *pis, const char *seqname)
{
int (*version)(void);
- void* (*alloc_private)(void);
+ void * (*alloc_private)(void);
char *cp;
/* to be sure: (is tested for) */
- pis->doit= NULL;
- pis->pname= NULL;
- pis->varstr= NULL;
- pis->cfra= NULL;
- pis->version= 0;
+ pis->doit = NULL;
+ pis->pname = NULL;
+ pis->varstr = NULL;
+ pis->cfra = NULL;
+ pis->version = 0;
pis->instance_private_data = NULL;
/* clear the error list */
@@ -145,55 +146,54 @@
/* pis->handle= 0; */
/* open the needed object */
- pis->handle= BLI_dynlib_open(pis->name);
+ pis->handle = BLI_dynlib_open(pis->name);
if (test_dlerr(pis->name, pis->name)) return;
if (pis->handle != NULL) {
/* find the address of the version function */
- version= (int (*)(void))BLI_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
+ version = (int (*)(void))BLI_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
if (test_dlerr(pis->name, "plugin_seq_getversion")) return;
if (version != NULL) {
- pis->version= version();
+ pis->version = version();
if (pis->version >= 2 && pis->version <= 6) {
int (*info_func)(PluginInfo *);
- PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
+ PluginInfo *info = (PluginInfo *) MEM_mallocN(sizeof(PluginInfo), "plugin_info");
- info_func= (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pis->handle, "plugin_getinfo");
+ info_func = (int (*)(PluginInfo *))BLI_dynlib_find_symbol(pis->handle, "plugin_getinfo");
if (info_func == NULL) error("No info func");
else {
info_func(info);
- pis->pname= info->name;
- pis->vars= info->nvars;
- pis->cfra= info->cfra;
+ pis->pname = info->name;
+ pis->vars = info->nvars;
+ pis->cfra = info->cfra;
- pis->varstr= info->varstr;
+ pis->varstr = info->varstr;
- pis->doit= (void(*)(void))info->seq_doit;
+ pis->doit = (void (*)(void))info->seq_doit;
if (info->init)
info->init();
}
MEM_freeN(info);
- cp= BLI_dynlib_find_symbol(pis->handle, "seqname");
+ cp = BLI_dynlib_find_symbol(pis->handle, "seqname");
if (cp) BLI_strncpy(cp, seqname, SEQ_NAME_MAXSTR);
}
else {
- printf ("Plugin returned unrecognized version number\n");
+ printf("Plugin returned unrecognized version number\n");
return;
}
}
- alloc_private = (void* (*)(void))BLI_dynlib_find_symbol(
- pis->handle, "plugin_seq_alloc_private_data");
+ alloc_private = (void * (*)(void))BLI_dynlib_find_symbol(
+ pis->handle, "plugin_seq_alloc_private_data");
if (alloc_private) {
pis->instance_private_data = alloc_private();
}
- pis->current_private_data = (void**)
- BLI_dynlib_find_symbol(
- pis->handle, "plugin_private_data");
+ pis->current_private_data = (void **)
+ BLI_dynlib_find_symbol(pis->handle, "plugin_private_data");
}
}
@@ -203,25 +203,25 @@
VarStruct *varstr;
int a;
- pis= MEM_callocN(sizeof(PluginSeq), "PluginSeq");
+ pis = MEM_callocN(sizeof(PluginSeq), "PluginSeq");
BLI_strncpy(pis->name, str, FILE_MAX);
open_plugin_seq(pis, seqname);
- if (pis->doit==NULL) {
- if (pis->handle==NULL) error("no plugin: %s", str);
+ if (pis->doit == NULL) {
+ if (pis->handle == NULL) error("no plugin: %s", str);
else error("in plugin: %s", str);
MEM_freeN(pis);
return NULL;
}
/* default values */
- varstr= pis->varstr;
- for (a=0; a<pis->vars; a++, varstr++) {
- if ( (varstr->type & FLO)==FLO)
- pis->data[a]= varstr->def;
- else if ( (varstr->type & INT)==INT)
- *((int *)(pis->data+a))= (int) varstr->def;
+ varstr = pis->varstr;
+ for (a = 0; a < pis->vars; a++, varstr++) {
+ if ( (varstr->type & FLO) == FLO)
+ pis->data[a] = varstr->def;
+ else if ( (varstr->type & INT) == INT)
+ *((int *)(pis->data + a)) = (int) varstr->def;
}
return pis;
@@ -229,7 +229,7 @@
static void free_plugin_seq(PluginSeq *pis)
{
- if (pis==NULL) return;
+ if (pis == NULL) return;
/* no BLI_dynlib_close: same plugin can be opened multiple times with 1 handle */
@@ -237,7 +237,7 @@
void (*free_private)(void *);
free_private = (void (*)(void *))BLI_dynlib_find_symbol(
- pis->handle, "plugin_seq_free_private_data");
+ pis->handle, "plugin_seq_free_private_data");
if (free_private) {
free_private(pis->instance_private_data);
}
@@ -246,9 +246,9 @@
MEM_freeN(pis);
}
-static void init_plugin(Sequence * seq, const char * fname)
+static void init_plugin(Sequence *seq, const char *fname)
{
- seq->plugin= (PluginSeq *)add_plugin_seq(fname, seq->name+2);
+ seq->plugin = (PluginSeq *)add_plugin_seq(fname, seq->name + 2);
}
/*
@@ -259,34 +259,34 @@
return 1;
}
-static void load_plugin(Sequence * seq)
+static void load_plugin(Sequence *seq)
{
if (seq) {
- open_plugin_seq(seq->plugin, seq->name+2);
+ open_plugin_seq(seq->plugin, seq->name + 2);
}
}
-static void copy_plugin(Sequence * dst, Sequence * src)
+static void copy_plugin(Sequence *dst, Sequence *src)
{
if (src->plugin) {
- dst->plugin= MEM_dupallocN(src->plugin);
- open_plugin_seq(dst->plugin, dst->name+2);
+ dst->plugin = MEM_dupallocN(src->plugin);
+ open_plugin_seq(dst->plugin, dst->name + 2);
}
}
-static ImBuf * IMB_cast_away_list(ImBuf * i)
+static ImBuf *IMB_cast_away_list(ImBuf *i)
{
if (!i) {
return NULL;
}
- return (ImBuf*) (((void**) i) + 2);
+ return (ImBuf *) (((void **) i) + 2);
}
-static struct ImBuf * do_plugin_effect(
- SeqRenderData context, Sequence *seq, float cfra,
- float facf0, float facf1,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3)
+static struct ImBuf *do_plugin_effect(
+ SeqRenderData context, Sequence *seq, float cfra,
+ float facf0, float facf1,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3)
{
char *cp;
int float_rendering;
@@ -294,31 +294,31 @@
* old plugins) do very bad stuff
* with imbuf-internals */
- struct ImBuf * out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
+ struct ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
int x = context.rectx;
int y = context.recty;
if (seq->plugin && seq->plugin->doit) {
if (seq->plugin->cfra)
- *(seq->plugin->cfra)= cfra;
+ *(seq->plugin->cfra) = cfra;
cp = BLI_dynlib_find_symbol(
- seq->plugin->handle, "seqname");
+ seq->plugin->handle, "seqname");
/* XXX: it's crappy to limit copying buffer by it's lemgth,
* but assuming plugin stuff is using correct buffer size
* it should be fine */
- if (cp) strncpy(cp, seq->name+2, sizeof(seq->name)-2);
+ if (cp) strncpy(cp, seq->name + 2, sizeof(seq->name) - 2);
if (seq->plugin->current_private_data) {
*seq->plugin->current_private_data
- = seq->plugin->instance_private_data;
+ = seq->plugin->instance_private_data;
}
float_rendering = (out->rect_float != NULL);
- if (seq->plugin->version<=3 && float_rendering) {
+ if (seq->plugin->version <= 3 && float_rendering) {
use_temp_bufs = 1;
if (ibuf1) {
@@ -344,27 +344,27 @@
out->flags &= ~IB_rectfloat;
}
- if (seq->plugin->version<=2) {
+ if (seq->plugin->version <= 2) {
if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
if (ibuf3) IMB_convert_rgba_to_abgr(ibuf3);
}
- if (seq->plugin->version<=4) {
+ if (seq->plugin->version <= 4) {
((SeqDoit)seq->plugin->doit)(
- seq->plugin->data, facf0, facf1, x, y,
- IMB_cast_away_list(ibuf1),
- IMB_cast_away_list(ibuf2),
- IMB_cast_away_list(out),
- IMB_cast_away_list(ibuf3));
+ seq->plugin->data, facf0, facf1, x, y,
+ IMB_cast_away_list(ibuf1),
+ IMB_cast_away_list(ibuf2),
+ IMB_cast_away_list(out),
+ IMB_cast_away_list(ibuf3));
}
else {
((SeqDoit)seq->plugin->doit)(
- seq->plugin->data, facf0, facf1, x, y,
- ibuf1, ibuf2, out, ibuf3);
+ seq->plugin->data, facf0, facf1, x, y,
+ ibuf1, ibuf2, out, ibuf3);
}
- if (seq->plugin->version<=2) {
+ if (seq->plugin->version <= 2) {
if (!use_temp_bufs) {
if (ibuf1) IMB_convert_rgba_to_abgr(ibuf1);
if (ibuf2) IMB_convert_rgba_to_abgr(ibuf2);
@@ -372,7 +372,7 @@
}
IMB_convert_rgba_to_abgr(out);
}
- if (seq->plugin->version<=3 && float_rendering) {
+ if (seq->plugin->version <= 3 && float_rendering) {
IMB_float_from_rect_simple(out);
}
@@ -386,12 +386,12 @@
}
static int do_plugin_early_out(struct Sequence *UNUSED(seq),
- float UNUSED(facf0), float UNUSED(facf1))
+ float UNUSED(facf0), float UNUSED(facf1))
{
return 0;
}
-static void free_plugin(struct Sequence * seq)
+static void free_plugin(struct Sequence *seq)
{
free_plugin_seq(seq->plugin);
seq->plugin = NULL;
@@ -401,129 +401,129 @@
* ALPHA OVER
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list