diff options
Diffstat (limited to 'source/blender/blenpluginapi')
-rw-r--r-- | source/blender/blenpluginapi/SConscript | 4 | ||||
-rw-r--r-- | source/blender/blenpluginapi/externdef.h | 5 | ||||
-rw-r--r-- | source/blender/blenpluginapi/iff.h | 67 | ||||
-rw-r--r-- | source/blender/blenpluginapi/intern/pluginapi.c | 80 | ||||
-rw-r--r-- | source/blender/blenpluginapi/plugin.h | 19 |
5 files changed, 92 insertions, 83 deletions
diff --git a/source/blender/blenpluginapi/SConscript b/source/blender/blenpluginapi/SConscript index aa6e25532b8..4cf52a50e8c 100644 --- a/source/blender/blenpluginapi/SConscript +++ b/source/blender/blenpluginapi/SConscript @@ -7,8 +7,8 @@ incs = '. .. #/intern/guardedalloc ../blenlib ../imbuf ../makesdna' defs = [] -if env['WITH_BF_QUICKTIME'] == 1: +if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ' + env['BF_QUICKTIME_INC'] -env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [90, 30] ) +env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [75, 35] ) diff --git a/source/blender/blenpluginapi/externdef.h b/source/blender/blenpluginapi/externdef.h index 7322841e608..14a3115ce33 100644 --- a/source/blender/blenpluginapi/externdef.h +++ b/source/blender/blenpluginapi/externdef.h @@ -33,11 +33,14 @@ #ifdef WIN32 #ifdef PLUGIN_INTERN #define LIBEXPORT __declspec(dllexport) + #define LIBIMPORT __declspec(dllexport) #else - #define LIBEXPORT extern __declspec(dllimport) + #define LIBEXPORT __declspec(dllexport) + #define LIBIMPORT extern __declspec(dllimport) #endif #elif !defined(WIN32) #define LIBEXPORT extern + #define LIBIMPORT extern #endif #endif /* _EXTERNDEF_H */ diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h index 5eb52158a1a..92cbd7dd093 100644 --- a/source/blender/blenpluginapi/iff.h +++ b/source/blender/blenpluginapi/iff.h @@ -151,7 +151,7 @@ typedef struct ImBuf { int userflags; /**< Used to set imbuf to Dirty and other stuff */ int *zbuf; /**< z buffer data, original zbuffer */ float *zbuf_float; /**< z buffer data, camera coordinates */ - void *userdata; + void *userdata; /**< temporary storage, only used by baking at the moment */ unsigned char *encodedbuffer; /**< Compressed image only used with png currently */ unsigned int encodedsize; /**< Size of data written to encodedbuffer */ unsigned int encodedbuffersize; /**< Size of encodedbuffer */ @@ -161,55 +161,56 @@ typedef struct ImBuf { float dither; /**< random dither value, for conversion from float -> byte rect */ struct MEM_CacheLimiterHandle_s * c_handle; /**< handle for cache limiter */ + struct ImgInfo * img_info; int refcounter; /**< Refcounter for multiple users */ int index; /**< reference index for ImBuf lists */ struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /**< MipMap levels, a series of halved images */ } ImBuf; -LIBEXPORT struct ImBuf *allocImBuf(short,short,uchar,uint,uchar); -LIBEXPORT struct ImBuf *dupImBuf(struct ImBuf *); -LIBEXPORT void freeImBuf(struct ImBuf*); +LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint,uchar); +LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *); +LIBIMPORT void freeImBuf(struct ImBuf*); -LIBEXPORT short converttocmap(struct ImBuf* ibuf); +LIBIMPORT short converttocmap(struct ImBuf* ibuf); -LIBEXPORT short saveiff(struct ImBuf *,char *,int); +LIBIMPORT short saveiff(struct ImBuf *,char *,int); -LIBEXPORT struct ImBuf *loadiffmem(int *,int); -LIBEXPORT struct ImBuf *loadifffile(int,int); -LIBEXPORT struct ImBuf *loadiffname(char *,int); -LIBEXPORT struct ImBuf *testiffname(char *,int); +LIBIMPORT struct ImBuf *loadiffmem(int *,int); +LIBIMPORT struct ImBuf *loadifffile(int,int); +LIBIMPORT struct ImBuf *loadiffname(char *,int); +LIBIMPORT struct ImBuf *testiffname(char *,int); -LIBEXPORT struct ImBuf *onehalf(struct ImBuf *); -LIBEXPORT struct ImBuf *onethird(struct ImBuf *); -LIBEXPORT struct ImBuf *halflace(struct ImBuf *); -LIBEXPORT struct ImBuf *half_x(struct ImBuf *); -LIBEXPORT struct ImBuf *half_y(struct ImBuf *); -LIBEXPORT struct ImBuf *double_x(struct ImBuf *); -LIBEXPORT struct ImBuf *double_y(struct ImBuf *); -LIBEXPORT struct ImBuf *double_fast_x(struct ImBuf *); -LIBEXPORT struct ImBuf *double_fast_y(struct ImBuf *); +LIBIMPORT struct ImBuf *onehalf(struct ImBuf *); +LIBIMPORT struct ImBuf *onethird(struct ImBuf *); +LIBIMPORT struct ImBuf *halflace(struct ImBuf *); +LIBIMPORT struct ImBuf *half_x(struct ImBuf *); +LIBIMPORT struct ImBuf *half_y(struct ImBuf *); +LIBIMPORT struct ImBuf *double_x(struct ImBuf *); +LIBIMPORT struct ImBuf *double_y(struct ImBuf *); +LIBIMPORT struct ImBuf *double_fast_x(struct ImBuf *); +LIBIMPORT struct ImBuf *double_fast_y(struct ImBuf *); -LIBEXPORT int ispic(char *); +LIBIMPORT int ispic(char *); -LIBEXPORT void dit2(struct ImBuf *, short, short); -LIBEXPORT void dit0(struct ImBuf *, short, short); +LIBIMPORT void dit2(struct ImBuf *, short, short); +LIBIMPORT void dit0(struct ImBuf *, short, short); -LIBEXPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short); -LIBEXPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short); -LIBEXPORT struct ImBuf *scalefieldImBuf(struct ImBuf *, short, short); -LIBEXPORT struct ImBuf *scalefastfieldImBuf(struct ImBuf *, short, short); +LIBIMPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short); +LIBIMPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short); +LIBIMPORT struct ImBuf *scalefieldImBuf(struct ImBuf *, short, short); +LIBIMPORT struct ImBuf *scalefastfieldImBuf(struct ImBuf *, short, short); -LIBEXPORT void de_interlace(struct ImBuf *ib); -LIBEXPORT void interlace(struct ImBuf *ib); -LIBEXPORT void gamwarp(struct ImBuf *ibuf, double gamma); +LIBIMPORT void de_interlace(struct ImBuf *ib); +LIBIMPORT void interlace(struct ImBuf *ib); +LIBIMPORT void gamwarp(struct ImBuf *ibuf, double gamma); -LIBEXPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, +LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, int desty, int srcx, int srcy, int width, int height); -LIBEXPORT void IMB_rectfill(struct ImBuf *drect, float col[4]); -LIBEXPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2); -LIBEXPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2); +LIBIMPORT void IMB_rectfill(struct ImBuf *drect, float col[4]); +LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2); +LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2); #endif /* IFF_H */ diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c index ee1ac8f0ae2..9c08a0b2f9d 100644 --- a/source/blender/blenpluginapi/intern/pluginapi.c +++ b/source/blender/blenpluginapi/intern/pluginapi.c @@ -50,9 +50,12 @@ #include "plugin.h" #include "MEM_guardedalloc.h" +#include "BLO_sys_types.h" // needed for intptr_t + #include "BLI_blenlib.h" /* util and noise functions */ #include "BLI_threads.h" /* For threadsfe guardedalloc malloc/calloc/free */ #include "IMB_imbuf.h" /* image buffer stuff */ +#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* should use BKE_utildefines.h */ /* -------------------------------------------------------------------------- */ /* stuff from util.h */ @@ -321,42 +324,43 @@ int pluginapi_force_ref(void); int pluginapi_force_ref(void) { - return (int) mallocN + - (int) callocN + - (int) freeN + - (int) mallocT + - (int) callocT + - (int) freeT + - (int) allocImBuf + - (int) dupImBuf + - (int) freeImBuf + - (int) converttocmap + - (int) saveiff + - (int) loadiffmem + - (int) loadifffile + - (int) loadiffname + - (int) testiffname + - (int) onehalf + - (int) onethird + - (int) halflace + - (int) half_x + - (int) half_y + - (int) double_x + - (int) double_y + - (int) double_fast_x + - (int) double_fast_y + - (int) ispic + - (int) dit2 + - (int) dit0 + - (int) scaleImBuf + - (int) scalefastImBuf + - (int) scalefieldImBuf + - (int) scalefastfieldImBuf + - (int) hnoise + - (int) hnoisep + - (int) turbulence + - (int) turbulence1 + - (int) de_interlace + - (int) interlace + - (int) gamwarp; + return + GET_INT_FROM_POINTER( mallocN ) + + GET_INT_FROM_POINTER( callocN ) + + GET_INT_FROM_POINTER( freeN ) + + GET_INT_FROM_POINTER( mallocT ) + + GET_INT_FROM_POINTER( callocT ) + + GET_INT_FROM_POINTER( freeT ) + + GET_INT_FROM_POINTER( allocImBuf ) + + GET_INT_FROM_POINTER( dupImBuf ) + + GET_INT_FROM_POINTER( freeImBuf ) + + GET_INT_FROM_POINTER( converttocmap ) + + GET_INT_FROM_POINTER( saveiff ) + + GET_INT_FROM_POINTER( loadiffmem ) + + GET_INT_FROM_POINTER( loadifffile ) + + GET_INT_FROM_POINTER( loadiffname ) + + GET_INT_FROM_POINTER( testiffname ) + + GET_INT_FROM_POINTER( onehalf ) + + GET_INT_FROM_POINTER( onethird ) + + GET_INT_FROM_POINTER( halflace ) + + GET_INT_FROM_POINTER( half_x ) + + GET_INT_FROM_POINTER( half_y ) + + GET_INT_FROM_POINTER( double_x ) + + GET_INT_FROM_POINTER( double_y ) + + GET_INT_FROM_POINTER( double_fast_x ) + + GET_INT_FROM_POINTER( double_fast_y ) + + GET_INT_FROM_POINTER( ispic ) + + GET_INT_FROM_POINTER( dit2 ) + + GET_INT_FROM_POINTER( dit0 ) + + GET_INT_FROM_POINTER( scaleImBuf ) + + GET_INT_FROM_POINTER( scalefastImBuf ) + + GET_INT_FROM_POINTER( scalefieldImBuf ) + + GET_INT_FROM_POINTER( scalefastfieldImBuf ) + + GET_INT_FROM_POINTER( hnoise ) + + GET_INT_FROM_POINTER( hnoisep ) + + GET_INT_FROM_POINTER( turbulence ) + + GET_INT_FROM_POINTER( turbulence1 ) + + GET_INT_FROM_POINTER( de_interlace ) + + GET_INT_FROM_POINTER( interlace ) + + GET_INT_FROM_POINTER( gamwarp ); } diff --git a/source/blender/blenpluginapi/plugin.h b/source/blender/blenpluginapi/plugin.h index 1f6140130eb..da044cf7317 100644 --- a/source/blender/blenpluginapi/plugin.h +++ b/source/blender/blenpluginapi/plugin.h @@ -36,9 +36,10 @@ #include "util.h" #include "floatpatch.h" -#define B_PLUGIN_VERSION 5 +#define B_PLUGIN_VERSION 6 -typedef int (*TexDoit)(int, void*, float*, float*, float*); +typedef int (*TexDoit)(int, void*, float*, float*, float*, float*); +typedef int (*TexDoitold)(int, void*, float*, float*, float*); typedef void (*SeqDoit)(void*, float, float, int, int, ImBuf*, ImBuf*, ImBuf*, ImBuf*); typedef struct VarStruct { @@ -66,9 +67,9 @@ typedef struct _PluginInfo { void (*instance_init)(void *); } PluginInfo; -int plugin_tex_getversion(void); -int plugin_seq_getversion(void); -void plugin_getinfo(PluginInfo *); +LIBEXPORT int plugin_tex_getversion(void); +LIBEXPORT int plugin_seq_getversion(void); +LIBEXPORT void plugin_getinfo(PluginInfo *); /* *************** defines for button types ************** */ @@ -90,14 +91,14 @@ void plugin_getinfo(PluginInfo *); /* *************** API functions ******************** */ /* derived from the famous Perlin noise */ -LIBEXPORT float hnoise(float noisesize, float x, float y, float z); +LIBIMPORT float hnoise(float noisesize, float x, float y, float z); /* the original Perlin noise */ -LIBEXPORT float hnoisep(float noisesize, float x, float y, float z); +LIBIMPORT float hnoisep(float noisesize, float x, float y, float z); /* soft turbulence */ -LIBEXPORT float turbulence(float noisesize, float x, float y, float z, int depth); +LIBIMPORT float turbulence(float noisesize, float x, float y, float z, int depth); /* hard turbulence */ -LIBEXPORT float turbulence1(float noisesize, float x, float y, float z, int depth); +LIBIMPORT float turbulence1(float noisesize, float x, float y, float z, int depth); #endif /* PLUGIN_H */ |