~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/blenpluginapi/iff.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/** \file blender/blenpluginapi/iff.h
2
 
 *  \ingroup blpluginapi
3
 
 */
4
 
/* Copyright (c) 1999, Not a Number / NeoGeo b.v. 
5
 
 * 
6
 
 * All rights reserved.
7
 
 * 
8
 
 * Contact:      info@blender.org   
9
 
 * Information:  http://www.blender.org
10
 
 *
11
 
 * Redistribution and use in source and binary forms, with or without
12
 
 * modification, are permitted provided that the following conditions
13
 
 * are met:
14
 
 * 1. Redistributions of source code must retain the above copyright
15
 
 *    notice, this list of conditions and the following disclaimer.
16
 
 * 2. Redistributions in binary form must reproduce the above copyright
17
 
 *    notice, this list of conditions and the following disclaimer in the
18
 
 *    documentation and/or other materials provided with the distribution.
19
 
 *
20
 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21
 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
 
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24
 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
 
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
 
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
 
 * SUCH DAMAGE.
31
 
 */
32
 
 
33
 
#ifndef __IFF_H__
34
 
#define __IFF_H__
35
 
 
36
 
#include <sys/types.h>
37
 
#include "util.h"
38
 
#include "externdef.h"
39
 
 
40
 
struct ImMetaData;
41
 
 
42
 
#define IB_MIPMAP_LEVELS        20
43
 
#define IB_FILENAME_SIZE        1023
44
 
 
45
 
typedef struct ImBuf {
46
 
        struct ImBuf *next, *prev;      /**< allow lists of ImBufs, for caches or flipbooks */
47
 
        short   x, y;                           /**< width and Height of our image buffer */
48
 
        unsigned char   depth;          /**< Active amount of bits/bitplanes */
49
 
        unsigned int    *rect;          /**< pixel values stored here */
50
 
        unsigned int    *crect;         /**< color corrected pixel values stored here */
51
 
        int     flags;                          /**< Controls which components should exist. */
52
 
        int     mall;                           /**< what is malloced internal, and can be freed */
53
 
        int     *zbuf;                          /**< z buffer data, original zbuffer */
54
 
        float *zbuf_float;              /**< z buffer data, camera coordinates */
55
 
        void *userdata;                 /**< temporary storage, only used by baking at the moment */
56
 
        unsigned char *encodedbuffer;     /**< Compressed image only used with png currently */
57
 
        unsigned int   encodedsize;       /**< Size of data written to encodedbuffer */
58
 
        unsigned int   encodedbuffersize; /**< Size of encodedbuffer */
59
 
 
60
 
        float *rect_float;              /** < floating point Rect equivalent
61
 
                                                         * Linear RGB color space - may need gamma correction to
62
 
                                                         * sRGB when generating 8bit representations */
63
 
        int channels;                   /**< amount of channels in rect_float (0 = 4 channel default) */
64
 
        float dither;                   /**< random dither value, for conversion from float -> byte rect */
65
 
        short profile;                  /** color space/profile preset that the byte rect buffer represents */
66
 
        char profile_filename[1024];            /** to be implemented properly, specific filename for custom profiles */
67
 
 
68
 
        /* mipmapping */
69
 
        struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /**< MipMap levels, a series of halved images */
70
 
        int miplevels;
71
 
 
72
 
        /* externally used flags */
73
 
        int index;                              /* reference index for ImBuf lists */
74
 
        int     userflags;                      /* used to set imbuf to dirty and other stuff */
75
 
        struct ImMetaData *metadata;
76
 
 
77
 
        /* file information */
78
 
        int     ftype;                                          /* file type we are going to save as */
79
 
        char name[IB_FILENAME_SIZE];    /* filename associated with this image */
80
 
 
81
 
        /* memory cache limiter */
82
 
        struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter */
83
 
        int refcounter; /* reference counter for multiple users */
84
 
} ImBuf;
85
 
 
86
 
LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint);
87
 
LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *);
88
 
LIBIMPORT void freeImBuf(struct ImBuf*);
89
 
 
90
 
LIBIMPORT short saveiff(struct ImBuf *,char *,int);
91
 
 
92
 
LIBIMPORT struct ImBuf *loadifffile(int,int);
93
 
LIBIMPORT struct ImBuf *loadiffname(char *,int);
94
 
LIBIMPORT struct ImBuf *testiffname(char *,int);
95
 
 
96
 
LIBIMPORT struct ImBuf *onehalf(struct ImBuf *);
97
 
LIBIMPORT struct ImBuf *half_x(struct ImBuf *);
98
 
LIBIMPORT struct ImBuf *half_y(struct ImBuf *);
99
 
LIBIMPORT struct ImBuf *double_x(struct ImBuf *);
100
 
LIBIMPORT struct ImBuf *double_y(struct ImBuf *);
101
 
LIBIMPORT struct ImBuf *double_fast_x(struct ImBuf *);
102
 
LIBIMPORT struct ImBuf *double_fast_y(struct ImBuf *);
103
 
 
104
 
LIBIMPORT int ispic(char *);
105
 
 
106
 
LIBIMPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short);
107
 
LIBIMPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short);
108
 
 
109
 
LIBIMPORT void de_interlace(struct ImBuf *ib);
110
 
LIBIMPORT void interlace(struct ImBuf *ib);
111
 
 
112
 
LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, 
113
 
        int destx, int desty, int srcx, int srcy, int width, int height);
114
 
 
115
 
LIBIMPORT void IMB_rectfill(struct ImBuf *drect, const float col[4]);
116
 
LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2);
117
 
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);
118
 
LIBIMPORT void IMB_rectfill_alpha(struct ImBuf *drect, const float value);
119
 
 
120
 
#endif /* __IFF_H__ */
121