25 #include <QtGui/QImageIOPlugin>
26 #include <QtGui/QImage>
27 #include <QtCore/QIODevice>
28 #include <QtCore/QVector>
80 quint32 hierarchy_offset;
97 uchar red, green, blue;
105 quint32 preserve_transparency;
121 void (*assignBytes)(Layer& layer,
uint i,
uint j);
123 Layer(
void) : name(0) {}
124 ~Layer(
void) {
delete[] name; }
152 XCFImage(
void) : initialized(
false) {}
162 static bool random_table_initialized;
171 static int add_lut(
int,
int );
175 typedef void (*PixelCopyOperation)(Layer& layer,
uint i,
uint j,
int k,
int l,
176 QImage& image,
int m,
int n);
179 typedef void (*PixelMergeOperation)(Layer& layer,
uint i,
uint j,
int k,
int l,
180 QImage& image,
int m,
int n);
189 static const LayerModes layer_modes[];
191 bool loadImageProperties(
QDataStream& xcf_io, XCFImage& image);
193 bool loadLayer(
QDataStream& xcf_io, XCFImage& xcf_image);
194 bool loadLayerProperties(
QDataStream& xcf_io, Layer& layer);
195 bool composeTiles(XCFImage& xcf_image);
196 void setGrayPalette(
QImage& image);
197 void setPalette(XCFImage& xcf_image,
QImage& image);
198 static void assignImageBytes(Layer& layer,
uint i,
uint j);
199 bool loadHierarchy(
QDataStream& xcf_io, Layer& layer);
200 bool loadLevel(
QDataStream& xcf_io, Layer& layer, qint32 bpp);
201 static void assignMaskBytes(Layer& layer,
uint i,
uint j);
203 bool loadChannelProperties(
QDataStream& xcf_io, Layer& layer);
204 bool initializeImage(XCFImage& xcf_image);
206 int data_length, qint32 bpp);
208 static void copyLayerToImage(XCFImage& xcf_image);
209 static void copyRGBToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
210 QImage& image,
int m,
int n);
211 static void copyGrayToGray(Layer& layer,
uint i,
uint j,
int k,
int l,
212 QImage& image,
int m,
int n);
213 static void copyGrayToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
214 QImage& image,
int m,
int n);
215 static void copyGrayAToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
216 QImage& image,
int m,
int n);
217 static void copyIndexedToIndexed(Layer& layer,
uint i,
uint j,
int k,
int l,
218 QImage& image,
int m,
int n);
219 static void copyIndexedAToIndexed(Layer& layer,
uint i,
uint j,
int k,
int l,
220 QImage& image,
int m,
int n);
221 static void copyIndexedAToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
222 QImage& image,
int m,
int n);
224 static void mergeLayerIntoImage(XCFImage& xcf_image);
225 static void mergeRGBToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
226 QImage& image,
int m,
int n);
227 static void mergeGrayToGray(Layer& layer,
uint i,
uint j,
int k,
int l,
228 QImage& image,
int m,
int n);
229 static void mergeGrayAToGray(Layer& layer,
uint i,
uint j,
int k,
int l,
230 QImage& image,
int m,
int n);
231 static void mergeGrayToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
232 QImage& image,
int m,
int n);
233 static void mergeGrayAToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
234 QImage& image,
int m,
int n);
235 static void mergeIndexedToIndexed(Layer& layer,
uint i,
uint j,
int k,
int l,
236 QImage& image,
int m,
int n);
237 static void mergeIndexedAToIndexed(Layer& layer,
uint i,
uint j,
int k,
int l,
238 QImage& image,
int m,
int n);
239 static void mergeIndexedAToRGB(Layer& layer,
uint i,
uint j,
int k,
int l,
240 QImage& image,
int m,
int n);
242 static void initializeRandomTable();
243 static void dissolveRGBPixels(
QImage& image,
int x,
int y);
244 static void dissolveAlphaPixels(
QImage& image,
int x,
int y);
const float INCHESPERMETER
const int RANDOM_TABLE_SIZE
Size of dissolve random number table.
QIODevice * device() const
PropType
Properties which can be stored in an XCF file.
const uint TILE_HEIGHT
Height of a tile in the XCF file.
const uint TILE_WIDTH
Width of a tile in the XCF file.
bool write(const QImage &image)
QVector< QVector< QImage > > Tiles