diff --git a/src/Image/IntelliRasterImage.cpp b/src/Image/IntelliRasterImage.cpp index c70583c..9626f59 100644 --- a/src/Image/IntelliRasterImage.cpp +++ b/src/Image/IntelliRasterImage.cpp @@ -9,14 +9,14 @@ IntelliRasterImage::IntelliRasterImage(int width, int height, bool fastRendererO this->fastRenderering = fastRendererOn; } -/* -IntelliRasterImage::IntelliRasterImage(const IntelliRasterImage& image) + +IntelliRasterImage::Copy(const IntelliRasterImage& image) : IntelliImage(image.getWidth(), image.getHeight(), image.isFastRendering()){ this->TypeOfImage = ImageType::RASTERIMAGE; IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), this->fastRenderering); raster->imageData.copy(0,0,image.getWidth(),image.getWidth()); } -*/ + IntelliRasterImage::~IntelliRasterImage(){ diff --git a/src/Image/IntelliRasterImage.cpp.autosave b/src/Image/IntelliRasterImage.cpp.autosave deleted file mode 100644 index 9626f59..0000000 --- a/src/Image/IntelliRasterImage.cpp.autosave +++ /dev/null @@ -1,61 +0,0 @@ -#include "Image/IntelliRasterImage.h" -#include -#include -#include - -IntelliRasterImage::IntelliRasterImage(int width, int height, bool fastRendererOn) - : IntelliImage(width, height, fastRendererOn){ - TypeOfImage = ImageType::RASTERIMAGE; - this->fastRenderering = fastRendererOn; -} - - -IntelliRasterImage::Copy(const IntelliRasterImage& image) - : IntelliImage(image.getWidth(), image.getHeight(), image.isFastRendering()){ - this->TypeOfImage = ImageType::RASTERIMAGE; - IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), this->fastRenderering); - raster->imageData.copy(0,0,image.getWidth(),image.getWidth()); -} - - - -IntelliRasterImage::~IntelliRasterImage(){ - -} - -IntelliImage* IntelliRasterImage::getDeepCopy(){ - IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), this->fastRenderering); - raster->imageData.fill(Qt::transparent); - raster->TypeOfImage = ImageType::RASTERIMAGE; - return raster; -} - -void IntelliRasterImage::calculateVisiblity(){ - // not used in raster image -} - -QImage IntelliRasterImage::getDisplayable(int alpha){ - return getDisplayable(imageData.size(), alpha); -} - -QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){ - QImage copy = imageData; - if(fastRenderering) { - copy = copy.convertToFormat(QImage::Format_ARGB32); - } - for(int y = 0; y& polygonData){ - return; -} diff --git a/src/Image/IntelliRasterImage.h b/src/Image/IntelliRasterImage.h index 8f3eb71..b6fdc07 100644 --- a/src/Image/IntelliRasterImage.h +++ b/src/Image/IntelliRasterImage.h @@ -26,7 +26,7 @@ public: */ IntelliRasterImage(int width, int height, bool fastRendererOn); -//IntelliRasterImage(const IntelliRasterImage& image); +void copy(const IntelliRasterImage& image); /*! * \brief An Destructor. diff --git a/src/Image/IntelliShapedImage.cpp b/src/Image/IntelliShapedImage.cpp index 9e73d2c..bfaa053 100644 --- a/src/Image/IntelliShapedImage.cpp +++ b/src/Image/IntelliShapedImage.cpp @@ -10,14 +10,12 @@ IntelliShapedImage::IntelliShapedImage(int width, int height, bool fastRendererO this->fastRenderering = fastRendererOn; } -/* -IntelliShapedImage::IntelliShapedImage(const IntelliShapedImage& image) +IntelliShapedImage::Copy(const IntelliShapedImage& image) : IntelliRasterImage(image.getWidth(), image.getHeight(), image.isFastRendering()){ this->TypeOfImage = ImageType::SHAPEDIMAGE; IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), this->fastRenderering); shaped->imageData.copy(0,0,image.getWidth(),image.getWidth()); } -*/ IntelliShapedImage::~IntelliShapedImage(){ diff --git a/src/Image/IntelliShapedImage.cpp.autosave b/src/Image/IntelliShapedImage.cpp.autosave deleted file mode 100644 index bfaa053..0000000 --- a/src/Image/IntelliShapedImage.cpp.autosave +++ /dev/null @@ -1,120 +0,0 @@ -#include "Image/IntelliShapedImage.h" -#include "IntelliHelper/IntelliTriangulation.h" -#include -#include -#include - -IntelliShapedImage::IntelliShapedImage(int width, int height, bool fastRendererOn) - : IntelliRasterImage(width, height, fastRendererOn){ - TypeOfImage = ImageType::SHAPEDIMAGE; - this->fastRenderering = fastRendererOn; -} - -IntelliShapedImage::Copy(const IntelliShapedImage& image) - : IntelliRasterImage(image.getWidth(), image.getHeight(), image.isFastRendering()){ - this->TypeOfImage = ImageType::SHAPEDIMAGE; - IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), this->fastRenderering); - shaped->imageData.copy(0,0,image.getWidth(),image.getWidth()); -} - -IntelliShapedImage::~IntelliShapedImage(){ - -} - -QImage IntelliShapedImage::getDisplayable(int alpha){ - return getDisplayable(imageData.size(),alpha); -} - -IntelliImage* IntelliShapedImage::getDeepCopy(){ - IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), this->fastRenderering); - shaped->setPolygon(this->polygonData); - shaped->imageData.fill(Qt::transparent); - shaped->TypeOfImage = ImageType::SHAPEDIMAGE; - return shaped; -} - -void IntelliShapedImage::calculateVisiblity(){ - if(polygonData.size()<2) { - return; - } - if(fastRenderering) { - this->imageData = imageData.convertToFormat(QImage::Format_ARGB32); - } - - if(polygonData.size()<=2) { - QColor clr; - for(int y = 0; yimageData = this->imageData.convertToFormat(QImage::Format_Indexed8); - } - return; - } - QColor clr; - for(int y = 0; yimageData = this->imageData.convertToFormat(QImage::Format_Indexed8); - } -} - -QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){ - QImage copy = imageData; - if(fastRenderering) { - copy = copy.convertToFormat(QImage::Format_ARGB32); - } - for(int y = 0; y& polygonData){ - if(polygonData.size()<3) { - this->polygonData.clear(); - }else{ - this->polygonData.clear(); - for(auto element:polygonData) { - this->polygonData.push_back(QPoint(element.x(), element.y())); - } - triangles = IntelliTriangulation::calculateTriangles(polygonData); - if(fastRenderering) { - imageData = imageData.convertToFormat(QImage::Format_ARGB32); - } - for(int y = 0; y #include #include +#include int main(int argc, char*argv[]){ // The main application QApplication app(argc, argv); + std::fstream file("test.txt"); + file << "Hallo welt"; + file.close(); + // Create and open the main window IntelliPhotoGui window; window.show(); diff --git a/src/main.cpp.autosave b/src/main.cpp.autosave new file mode 100644 index 0000000..30adab2 --- /dev/null +++ b/src/main.cpp.autosave @@ -0,0 +1,15 @@ +#include "GUI/IntelliPhotoGui.h" +#include +#include +#include + +int main(int argc, char*argv[]){ + // The main application + QApplication app(argc, argv); + + // Create and open the main window + IntelliPhotoGui window; + window.show(); + + return app.exec(); +}