Blender V2.61 - r43446
|
00001 00004 /* Copyright (c) 1999, Not a Number / NeoGeo b.v. 00005 * 00006 * All rights reserved. 00007 * 00008 * Contact: info@blender.org 00009 * Information: http://www.blender.org 00010 * 00011 * Redistribution and use in source and binary forms, with or without 00012 * modification, are permitted provided that the following conditions 00013 * are met: 00014 * 1. Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright 00017 * notice, this list of conditions and the following disclaimer in the 00018 * documentation and/or other materials provided with the distribution. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 00021 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00022 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00023 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00024 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00025 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00026 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00027 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00028 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00029 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00030 * SUCH DAMAGE. 00031 */ 00032 00033 #ifndef PLUGIN_H 00034 #define PLUGIN_H 00035 00036 #include "externdef.h" 00037 #include "iff.h" 00038 #include "util.h" 00039 #include "floatpatch.h" 00040 00041 #define B_PLUGIN_VERSION 6 00042 00043 typedef int (*TexDoit)(int, void*, float*, float*, float*, float*); 00044 typedef int (*TexDoitold)(int, void*, float*, float*, float*); 00045 typedef void (*SeqDoit)(void*, float, float, int, int, ImBuf*, ImBuf*, ImBuf*, ImBuf*); 00046 00047 typedef struct VarStruct { 00048 int type; 00049 char name[16]; 00050 float def, min, max; 00051 char tip[80]; 00052 } VarStruct; 00053 00054 typedef struct _PluginInfo { 00055 char *name; 00056 char *snames; 00057 00058 int stypes; 00059 int nvars; 00060 VarStruct *varstr; 00061 float *result; 00062 float *cfra; 00063 00064 void (*init)(void); 00065 void (*callback)(int); 00066 TexDoit tex_doit; 00067 SeqDoit seq_doit; 00068 00069 void (*instance_init)(void *); 00070 } PluginInfo; 00071 00072 LIBEXPORT int plugin_tex_getversion(void); 00073 LIBEXPORT int plugin_seq_getversion(void); 00074 LIBEXPORT void plugin_getinfo(PluginInfo *); 00075 00076 /* *************** defines for button types ************** */ 00077 00078 #define CHA 32 00079 #define INT 96 00080 #define FLO 128 00081 00082 #define TOG (3<<9) 00083 #define NUM (5<<9) 00084 #define LABEL (10<<9) 00085 #define NUMSLI (14<<9) 00086 #define COL (15<<9) 00087 00088 /* return values (bitfield like) for textures (DNA_texture_types.h) */ 00089 #define TEX_INT 0 00090 #define TEX_RGB 1 00091 #define TEX_NOR 2 00092 00093 /* *************** API functions ******************** */ 00094 00095 /* derived from the famous Perlin noise */ 00096 LIBIMPORT float hnoise(float noisesize, float x, float y, float z); 00097 /* the original Perlin noise */ 00098 LIBIMPORT float hnoisep(float noisesize, float x, float y, float z); 00099 00100 /* soft turbulence */ 00101 LIBIMPORT float turbulence(float noisesize, float x, float y, float z, int depth); 00102 /* hard turbulence */ 00103 LIBIMPORT float turbulence1(float noisesize, float x, float y, float z, int depth); 00104 00105 #endif /* PLUGIN_H */ 00106