Blender  V2.59
DNA_image_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: DNA_image_types.h 38551 2011-07-21 00:41:00Z campbellbarton $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 #ifndef DNA_IMAGE_TYPES_H
00030 #define DNA_IMAGE_TYPES_H
00031 
00036 #include "DNA_ID.h"
00037 
00038 struct PackedFile;
00039 struct Scene;
00040 struct anim;
00041 struct ImBuf;
00042 struct RenderResult;
00043 struct GPUTexture;
00044 
00045 
00046 /* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
00047 /* should be used in conjunction with an ID * to Image. */
00048 typedef struct ImageUser {
00049         struct Scene *scene;            /* to retrieve render result */
00050 
00051         int framenr;                            /* movies, sequences: current to display */
00052         int frames;                                     /* total amount of frames to use */
00053         int offset, sfra;                       /* offset within movie, start frame in global time */
00054         char fie_ima, cycl;             /* fields/image in movie, cyclic flag */
00055         char ok, pad;
00056 
00057         short multi_index, layer, pass;  /* listbase indices, for menu browsing or retrieve buffer */
00058 
00059         short flag;
00060         
00061         int pad2;
00062 
00063 } ImageUser;
00064 
00065 /* iuser->flag */
00066 #define IMA_ANIM_ALWAYS         1
00067 #define IMA_ANIM_REFRESHED      2
00068 /* #define IMA_DO_PREMUL        4 */
00069 
00070 typedef struct Image {
00071         ID id;
00072         
00073         char name[240];                 /* file path */
00074         
00075         ListBase ibufs;                                 /* not written in file */
00076         struct GPUTexture *gputexture;  /* not written in file */
00077         
00078         /* sources from: */
00079         struct anim *anim;
00080         struct RenderResult *rr;
00081 
00082         struct RenderResult *renders[8]; /* IMA_MAX_RENDER_SLOT */
00083         short render_slot, last_render_slot;
00084         
00085         short ok, flag;
00086         short source, type;
00087         int lastframe;
00088 
00089         /* texture page */
00090         short tpageflag, totbind;
00091         short xrep, yrep;
00092         short twsta, twend;
00093         unsigned int bindcode;  /* only for current image... */
00094         unsigned int *repbind;  /* for repeat of parts of images */
00095         
00096         struct PackedFile * packedfile;
00097         struct PreviewImage * preview;
00098 
00099         /* game engine tile animation */
00100         float lastupdate;
00101         int lastused;
00102         short animspeed;
00103         
00104         /* for generated images */
00105         short gen_x, gen_y;
00106         char gen_type, gen_flag;
00107         
00108         /* display aspect - for UV editing images resized for faster openGL display */
00109         float aspx, aspy;
00110 } Image;
00111 
00112 
00113 /* **************** IMAGE ********************* */
00114 
00115 /* Image.flag */
00116 #define IMA_FIELDS              1
00117 #define IMA_STD_FIELD   2
00118 #define IMA_DO_PREMUL   4
00119 
00120 #define IMA_REFLECT             16
00121 #define IMA_NOCOLLECT   32
00122 #define IMA_DEPRECATED  64
00123 #define IMA_OLD_PREMUL  128
00124 
00125 /* Image.tpageflag */
00126 #define IMA_TILES                       1
00127 #define IMA_TWINANIM            2
00128 #define IMA_COLCYCLE            4       /* Depreciated */
00129 #define IMA_MIPMAP_COMPLETE 8   /* all mipmap levels in OpenGL texture set? */
00130 #define IMA_CLAMP_U                     16 
00131 #define IMA_CLAMP_V                     32
00132 #define IMA_TPAGE_REFRESH       64
00133 
00134 /* ima->type and ima->source moved to BKE_image.h, for API */
00135 
00136 /* render */
00137 #define IMA_MAX_RENDER_TEXT             512
00138 #define IMA_MAX_RENDER_SLOT             8
00139 
00140 /* gen_flag */
00141 #define IMA_GEN_FLOAT           1
00142 
00143 #endif
00144