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