mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +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)){
|
||||
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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user