1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/***************************************************************************
sq_glparts.h - description
-------------------
begin : ??? Mar 13 2007
copyright : (C) 2007 by Baryshev Dmitry
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef SQ_GLPARTS_H
#define SQ_GLPARTS_H
#include <tqgl.h>
#include <tqwmatrix.h>
#include <tqrect.h>
#include <kurl.h>
#include <vector>
#include <ksquirrel-libs/fmt_defs.h>
struct SQ_LIBRARY;
class fmt_codec_base;
class memoryPart
{
public:
memoryPart(const int sz);
~memoryPart();
// create/delete memory buffer
void create();
void del();
bool valid() const;
RGBA *data();
private:
int m_size;
RGBA *m_data;
};
inline
RGBA* memoryPart::data()
{
return m_data;
}
inline
void memoryPart::del()
{
delete [] m_data;
m_data = 0;
}
inline
bool memoryPart::valid() const
{
return m_data != 0;
}
/* *************************************************************** */
struct Part
{
Part();
float x1, y1, x2, y2, tx1, tx2, ty1, ty2;
unsigned int tex;
GLuint list;
};
/* *************************************************************** */
// one image page. All pages are stored in SQ_GLWidget::parts
struct Parts
{
Parts();
int w, h, realw, realh;
std::vector<Part> m_parts;
std::vector<int> tilesx, tilesy;
memoryPart *buffer;
bool makeParts();
void removeParts();
void computeCoords();
void deleteBuffer();
};
inline
void Parts::deleteBuffer()
{
delete buffer;
buffer = 0;
}
/* *************************************************************** */
struct Tab
{
Tab();
~Tab();
void nullMatrix();
void empty();
void clearParts();
void removeParts();
void remakeParts();
GLfloat matrix[12];
GLfloat curangle;
KURL m_original;
TQString File, m_File, quickImageInfo;
TQString fmt_ext;
TQWMatrix wm;
TQRect srect;
int orient;
int current;
int fmt_size;
int total;
int glselection;
int sx, sy, sw, sh;
int elapsed;
bool rotate;
bool manualBlocked;
bool isflippedV, isflippedH;
bool broken;
std::vector<Parts> parts;
fmt_info finfo;
SQ_LIBRARY *lib;
fmt_codec_base *codeK;
};
#endif
|