diff --git a/src/IntelliHelper/IntelliDatamanager.cpp b/src/IntelliHelper/IntelliDatamanager.cpp index fb900df..d5f7c9f 100644 --- a/src/IntelliHelper/IntelliDatamanager.cpp +++ b/src/IntelliHelper/IntelliDatamanager.cpp @@ -6,17 +6,28 @@ bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){ if(openFile.open(QIODevice::WriteOnly)){ QTextStream out(&openFile); + std::vector* 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; iat(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; jat(i).image->getImageData().pixelColor(j,k); + out << pixColor.red() << " " << pixColor.green() << " " << pixColor.blue() << " " << pixColor.alpha() << ":"; + } + out << endl; + } + } openFile.close(); diff --git a/src/Layer/PaintingArea.h b/src/Layer/PaintingArea.h index 107c6b9..74e8eb5 100644 --- a/src/Layer/PaintingArea.h +++ b/src/Layer/PaintingArea.h @@ -197,6 +197,12 @@ IntelliImage* getImageOfActiveLayer(); */ QImage getImageDataOfActiveLayer(); +/*! + * \brief getLayerBundle returns the real active layerbundle (care!) + * \return the reference of the currentLayerBundle + */ +std::vector* getLayerBundle(); + IntelliToolsettings Toolsettings; IntelliColorPicker colorPicker;