mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 21:00:37 +02:00
added a exporter (NOT TESTET!!!)
This commit is contained in:
@@ -6,17 +6,28 @@ bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
|
|||||||
|
|
||||||
if(openFile.open(QIODevice::WriteOnly)){
|
if(openFile.open(QIODevice::WriteOnly)){
|
||||||
QTextStream out(&openFile);
|
QTextStream out(&openFile);
|
||||||
|
std::vector<LayerObject>* layerBundle = Canvas->getLayerBundle();
|
||||||
|
size_t numberOfLayers = layerBundle->size();
|
||||||
|
|
||||||
out << "Format: idf\n" << "Version: 0.7\n" << endl;
|
out << "Format: idf\n" << "Version: 0.7\n" << endl;
|
||||||
out << "Resolution: " << Canvas->getMaxWidth() << "x" << Canvas->getMaxHeight() << endl;
|
out << "Resolution: " << Canvas->getMaxWidth() << "x" << Canvas->getMaxHeight() << endl;
|
||||||
out << "Layers: " << "0" << endl;
|
out << "Layers: " << numberOfLayers << endl;
|
||||||
if(false){
|
for(size_t i = 0; i<numberOfLayers; i++){
|
||||||
out << "width: " << endl;
|
int width = layerBundle->at(i).width;
|
||||||
out << "height: " << endl;
|
int height = layerBundle->at(i).height;
|
||||||
out << "xoffset: " << endl;
|
out << "width: " << width << endl;
|
||||||
out << "yoffset: " << endl;
|
out << "height: " << height << endl;
|
||||||
out << "alpha: " << endl;
|
out << "xoffset: " << layerBundle->at(i).widthOffset << endl;
|
||||||
out << "imageData: " << 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();
|
openFile.close();
|
||||||
|
|||||||
@@ -197,6 +197,12 @@ IntelliImage* getImageOfActiveLayer();
|
|||||||
*/
|
*/
|
||||||
QImage getImageDataOfActiveLayer();
|
QImage getImageDataOfActiveLayer();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief getLayerBundle returns the real active layerbundle (care!)
|
||||||
|
* \return the reference of the currentLayerBundle
|
||||||
|
*/
|
||||||
|
std::vector<LayerObject>* getLayerBundle();
|
||||||
|
|
||||||
IntelliToolsettings Toolsettings;
|
IntelliToolsettings Toolsettings;
|
||||||
IntelliColorPicker colorPicker;
|
IntelliColorPicker colorPicker;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user