added a exporter (NOT TESTET!!!)

This commit is contained in:
Jan Schuffenhauer
2020-01-23 15:15:57 +01:00
parent 189f070016
commit 244a9b769f
2 changed files with 25 additions and 8 deletions

View File

@@ -6,17 +6,28 @@ bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
if(openFile.open(QIODevice::WriteOnly)){
QTextStream out(&openFile);
std::vector<LayerObject>* layerBundle = Canvas->getLayerBundle();
size_t numberOfLayers = layerBundle->size();
out << "Format: idf\n" << "Version: 0.7\n" << endl;
out << "Resolution: " << Canvas->getMaxWidth() << "x" << Canvas->getMaxHeight() << endl;
out << "Layers: " << "0" << endl;
if(false){
out << "width: " << endl;
out << "height: " << endl;
out << "xoffset: " << endl;
out << "yoffset: " << endl;
out << "alpha: " << endl;
out << "imageData: " << endl;
out << "Layers: " << numberOfLayers << endl;
for(size_t i = 0; i<numberOfLayers; i++){
int width = layerBundle->at(i).width;
int height = layerBundle->at(i).height;
out << "width: " << width << endl;
out << "height: " << height << endl;
out << "xoffset: " << layerBundle->at(i).widthOffset << endl;
out << "yoffset: " << layerBundle->at(i).heightOffset << endl;
out << "alpha: " << layerBundle->at(i).alpha << endl;
for(int j=0; j<height; j++){
for(int k = 0; k<width; k++){
QColor pixColor = layerBundle->at(i).image->getImageData().pixelColor(j,k);
out << pixColor.red() << " " << pixColor.green() << " " << pixColor.blue() << " " << pixColor.alpha() << ":";
}
out << endl;
}
}
openFile.close();

View File

@@ -197,6 +197,12 @@ IntelliImage* getImageOfActiveLayer();
*/
QImage getImageDataOfActiveLayer();
/*!
* \brief getLayerBundle returns the real active layerbundle (care!)
* \return the reference of the currentLayerBundle
*/
std::vector<LayerObject>* getLayerBundle();
IntelliToolsettings Toolsettings;
IntelliColorPicker colorPicker;