1 | /****************************************************************************** |
---|
2 | * SAGE - Scalable Adaptive Graphics Environment |
---|
3 | * |
---|
4 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
5 | * University of Illinois at Chicago |
---|
6 | * |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright |
---|
13 | * notice, this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above |
---|
15 | * copyright notice, this list of conditions and the following disclaimer |
---|
16 | * in the documentation and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the University of Illinois at Chicago nor |
---|
18 | * the names of its contributors may be used to endorse or promote |
---|
19 | * products derived from this software without specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
25 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
28 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
29 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
30 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | * |
---|
33 | * Direct questions, comments etc about SAGE to http://www.evl.uic.edu/cavern/forum/ |
---|
34 | * |
---|
35 | *****************************************************************************/ |
---|
36 | |
---|
37 | #ifndef BPMOVIE_H |
---|
38 | #define BPMOVIE_H 1 |
---|
39 | |
---|
40 | #define BPMV3_MAGIC ( ('b'<<24) | ('p'<<16) | ('m'<<8) | '3' ) |
---|
41 | |
---|
42 | enum pixeltype { |
---|
43 | GRAY8 = 1, /* 8-bit grayscale */ |
---|
44 | RGB565 = 2, /* 16-bit (5-bit-R)<<11 | (6-bit-G)<<5 | (5-bit-R) */ |
---|
45 | RGB888 = 3, /* 8-bit R, G, B bytes in that order */ |
---|
46 | ABGR8888 = 4, /* 8-bit A, B, G, R bytes in that order */ |
---|
47 | COMPRESSDXT1 = 5 /* S3TC DXT1 compressed texture (16 texels in 8 bytes) */ |
---|
48 | }; |
---|
49 | |
---|
50 | typedef struct { |
---|
51 | int magic; /* 32-bit int BPMV_MAGIC in native byte order */ |
---|
52 | int xsize; /* image size */ |
---|
53 | int ysize; |
---|
54 | enum pixeltype format; |
---|
55 | int imagestride; /* bytes per image, including page-alignment padding */ |
---|
56 | |
---|
57 | |
---|
58 | int xtile; /* X-direction size of each tile */ |
---|
59 | int ytile; /* Y-direction size of each tile */ |
---|
60 | int nxtile; /* number of tiles in X-direction */ |
---|
61 | int nytile; /* number of tiles in Y-direction */ |
---|
62 | int tilerowstride; /* spacing (bytes) from one row to next within a tile */ |
---|
63 | int xtilestride; /* spacing (bytes) from one tile to next in X */ |
---|
64 | int ytilestride; /* spacing (bytes) from one tile to next in Y */ |
---|
65 | |
---|
66 | int nframes; /* number of frames in movie, if known, else MAXINT */ |
---|
67 | |
---|
68 | int flags; /* movie-type flags */ |
---|
69 | #define BPF_EXTDATA 0x01 /* Image data in separate file 'extfname' */ |
---|
70 | #define BPF_STEREO 0x02 /* Each frame is a stereo pair */ |
---|
71 | #define BPF_PREFRATE 0x04 /* Has "preferred play rate" setting */ |
---|
72 | #define BPF_PREFSHIFT 0x08 /* Has "preferred relative image shift" setting */ |
---|
73 | |
---|
74 | long long start; /* file offset of first image data */ |
---|
75 | |
---|
76 | int prefrate; /* preferred play rate, frames/sec */ |
---|
77 | int prefshift; /* preferred relative image shift, pixels */ |
---|
78 | |
---|
79 | char pad[56]; /* some room for extensions */ |
---|
80 | |
---|
81 | char extfname[1024]; /* name of file with image data, if flags&BPF_EXTDATA */ |
---|
82 | char cmd[1024]; /* command used to generate this */ |
---|
83 | |
---|
84 | |
---|
85 | } bpmvhead_t; |
---|
86 | |
---|
87 | #endif |
---|