source: OGRE/trunk/ogrenew/Tools/LightwaveConverter/include/lwClip.h @ 657

Revision 657, 2.7 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1
2#ifndef _LWCLIP_H_
3#define _LWCLIP_H_
4
5class lwClipStill
6{
7public:
8        lwClipStill()
9        {
10                name = 0;
11        }
12        ~lwClipStill()
13        {
14                if (name) free(name);
15        }
16        char *name;
17};
18
19class lwClipSeq
20{
21public:
22        lwClipSeq()
23        {
24                prefix = 0;
25                suffix = 0;
26        }
27        ~lwClipSeq()
28        {
29                        if (prefix) free(prefix);
30                        if (suffix) free(suffix);
31        }
32        char          *prefix;              /* filename before sequence digits */
33        char          *suffix;              /* after digits, e.g. extensions */
34        int            digits;
35        int            flags;
36        int            offset;
37        int            start;
38        int            end;
39};
40
41class lwClipAnim
42{
43public:
44        lwClipAnim()
45        {
46                name = 0;
47                server = 0;
48                data = 0;
49        }
50        ~lwClipAnim()
51        {
52                if (name) free(name);
53                if (server) free(server);
54                if (data) free(data);
55        }
56        char          *name;
57        char          *server;              /* anim loader plug-in */
58        void          *data;
59};
60
61class lwClipXRef
62{
63public:
64        lwClipXRef()
65        {
66                string = 0;
67                clip = 0;
68        }
69        ~lwClipXRef()
70        {
71                if (string) free(string);
72        }
73
74        char          *string;
75        int            index;
76        class lwClip  *clip;
77};
78
79class lwClipCycle {
80public:
81        lwClipCycle()
82        {
83                name = 0;
84        }
85        ~lwClipCycle()
86        {
87                if (name) free(name);
88        }
89        char          *name;
90        int            lo;
91        int            hi;
92};
93
94class lwClip {
95public:
96        lwClip()
97        {
98                source.still = 0;
99                contrast.val = 1.0f;
100                brightness.val = 1.0f;
101                saturation.val = 1.0f;
102                gamma.val = 1.0f;
103        }
104       
105        ~lwClip()
106        {
107                unsigned int i;
108                for (i=0; i < ifilters.size(); delete ifilters[i++]);
109                for (i=0; i < pfilters.size(); delete pfilters[i++]);
110               
111                if (source.still)
112                {
113                        switch (type)
114                        {
115                        case ID_STIL:
116                                delete source.still;
117                                break;
118                        case ID_ISEQ:
119                                delete source.seq;
120                                break;
121                        case ID_ANIM:
122                                delete source.anim;
123                                break;
124                        case ID_XREF:
125                                delete source.xref;
126                                break;
127                        case ID_STCC:
128                                delete source.cycle;
129                                break;
130                        default:
131                                ;
132                        }
133                }
134        }
135        int               index;
136        unsigned int      type;                /* ID_STIL, ID_ISEQ, etc. */
137        union {
138                lwClipStill  *still;
139                lwClipSeq    *seq;
140                lwClipAnim   *anim;
141                lwClipXRef   *xref;
142                lwClipCycle  *cycle;
143        }                 source;
144        float             start_time;
145        float             duration;
146        float             frame_rate;
147        lwEParam          contrast;
148        lwEParam          brightness;
149        lwEParam          saturation;
150        lwEParam          hue;
151        lwEParam          gamma;
152        int               negative;
153        vplugins ifilters;             /* linked list of image filters */
154        vplugins pfilters;             /* linked list of pixel filters */
155};
156
157typedef vector<lwClip*> vclips;
158
159#endif // _LWCLIP_H_
160
Note: See TracBrowser for help on using the repository browser.