Blender V2.61 - r43446

iff.h

Go to the documentation of this file.
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 IFF_H
00034 #define IFF_H
00035 
00036 #include <sys/types.h>
00037 #include "util.h"
00038 #include "externdef.h"
00039 
00040 struct ImMetaData;
00041 
00042 #define IB_MIPMAP_LEVELS    20
00043 #define IB_FILENAME_SIZE    1023
00044 
00045 typedef struct ImBuf {
00046     struct ImBuf *next, *prev;  
00047     short   x, y;               
00048     unsigned char   depth;      
00049     unsigned int    *rect;      
00050     unsigned int    *crect;     
00051     int flags;              
00052     int mall;               
00053     int *zbuf;              
00054     float *zbuf_float;      
00055     void *userdata;         
00056     unsigned char *encodedbuffer;     
00057     unsigned int   encodedsize;       
00058     unsigned int   encodedbuffersize; 
00060     float *rect_float;      
00063     int channels;           
00064     float dither;           
00065     short profile;          
00066     char profile_filename[256];     
00068     /* mipmapping */
00069     struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; 
00070     int miplevels;
00071 
00072     /* externally used flags */
00073     int index;              /* reference index for ImBuf lists */
00074     int userflags;          /* used to set imbuf to dirty and other stuff */
00075     struct ImMetaData *metadata;
00076 
00077     /* file information */
00078     int ftype;                      /* file type we are going to save as */
00079     char name[IB_FILENAME_SIZE];    /* filename associated with this image */
00080 
00081     /* memory cache limiter */
00082     struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter */
00083     int refcounter; /* reference counter for multiple users */
00084 } ImBuf;
00085 
00086 LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint);
00087 LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *);
00088 LIBIMPORT void freeImBuf(struct ImBuf*);
00089 
00090 LIBIMPORT short saveiff(struct ImBuf *,char *,int);
00091 
00092 LIBIMPORT struct ImBuf *loadifffile(int,int);
00093 LIBIMPORT struct ImBuf *loadiffname(char *,int);
00094 LIBIMPORT struct ImBuf *testiffname(char *,int);
00095 
00096 LIBIMPORT struct ImBuf *onehalf(struct ImBuf *);
00097 LIBIMPORT struct ImBuf *half_x(struct ImBuf *);
00098 LIBIMPORT struct ImBuf *half_y(struct ImBuf *);
00099 LIBIMPORT struct ImBuf *double_x(struct ImBuf *);
00100 LIBIMPORT struct ImBuf *double_y(struct ImBuf *);
00101 LIBIMPORT struct ImBuf *double_fast_x(struct ImBuf *);
00102 LIBIMPORT struct ImBuf *double_fast_y(struct ImBuf *);
00103 
00104 LIBIMPORT int ispic(char *);
00105 
00106 LIBIMPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short);
00107 LIBIMPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short);
00108 
00109 LIBIMPORT void de_interlace(struct ImBuf *ib);
00110 LIBIMPORT void interlace(struct ImBuf *ib);
00111 
00112 LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, 
00113     int destx, int desty, int srcx, int srcy, int width, int height);
00114 
00115 LIBIMPORT void IMB_rectfill(struct ImBuf *drect, const float col[4]);
00116 LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2);
00117 LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2);
00118 LIBIMPORT void IMB_rectfill_alpha(struct ImBuf *drect, const float value);
00119 
00120 #endif /* IFF_H */
00121