mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-13 11:50:31 +02:00
Polygon Fixes
Polygon kann jetzt im Shaped-Image nicht außerhalb des Polygons gestartet werden
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
IntelliImage::IntelliImage(int weight, int height)
|
||||
: imageData(QSize(weight, height), QImage::Format_ARGB32){
|
||||
imageData.fill(QColor(255,255,255,255));
|
||||
|
||||
}
|
||||
|
||||
IntelliImage::~IntelliImage(){
|
||||
|
||||
@@ -8,13 +8,7 @@
|
||||
#include <QWidget>
|
||||
#include <vector>
|
||||
|
||||
/*!
|
||||
* \brief The Types, which an Image can be.
|
||||
*/
|
||||
enum class ImageType {
|
||||
Raster_Image,
|
||||
Shaped_Image
|
||||
};
|
||||
#include "IntelliHelper/IntelliHelper.h"
|
||||
|
||||
class IntelliTool;
|
||||
|
||||
@@ -23,6 +17,16 @@ class IntelliTool;
|
||||
*/
|
||||
class IntelliImage {
|
||||
friend IntelliTool;
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief The Types, which an Image can be.
|
||||
*/
|
||||
enum class ImageType {
|
||||
Raster_Image,
|
||||
Shaped_Image
|
||||
};
|
||||
|
||||
protected:
|
||||
void resizeImage(QImage*image, const QSize &newSize);
|
||||
|
||||
@@ -30,6 +34,11 @@ void resizeImage(QImage*image, const QSize &newSize);
|
||||
* \brief The underlying image data.
|
||||
*/
|
||||
QImage imageData;
|
||||
|
||||
/*!
|
||||
* \brief The Type, an Image is.
|
||||
*/
|
||||
ImageType TypeOfImage;
|
||||
public:
|
||||
/*!
|
||||
* \brief The Construcor of the IntelliImage. Given the Image dimensions.
|
||||
@@ -114,6 +123,10 @@ virtual std::vector<QPoint> getPolygonData(){
|
||||
return std::vector<QPoint>();
|
||||
}
|
||||
|
||||
virtual ImageType getTypeOfImage(){
|
||||
return TypeOfImage;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief A function that loads and sclaes an image to the fitting dimensions.
|
||||
* \param filePath - The path+name of the image which to loaded.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
IntelliRasterImage::IntelliRasterImage(int weight, int height)
|
||||
: IntelliImage(weight, height){
|
||||
|
||||
TypeOfImage = IntelliImage::ImageType::Raster_Image;
|
||||
}
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
@@ -15,6 +15,7 @@ IntelliRasterImage::~IntelliRasterImage(){
|
||||
IntelliImage* IntelliRasterImage::getDeepCopy(){
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height());
|
||||
raster->imageData.fill(Qt::transparent);
|
||||
raster->TypeOfImage = IntelliImage::ImageType::Raster_Image;
|
||||
return raster;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
IntelliShapedImage::IntelliShapedImage(int weight, int height)
|
||||
: IntelliRasterImage(weight, height){
|
||||
TypeOfImage = IntelliImage::ImageType::Shaped_Image;
|
||||
}
|
||||
|
||||
IntelliShapedImage::~IntelliShapedImage(){
|
||||
@@ -20,6 +21,7 @@ IntelliImage* IntelliShapedImage::getDeepCopy(){
|
||||
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height());
|
||||
shaped->setPolygon(this->polygonData);
|
||||
shaped->imageData.fill(Qt::transparent);
|
||||
shaped->TypeOfImage = IntelliImage::ImageType::Shaped_Image;
|
||||
return shaped;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "Image/IntelliRasterImage.h"
|
||||
#include <vector>
|
||||
#include "IntelliHelper/IntelliHelper.h"
|
||||
|
||||
/*!
|
||||
* \brief The IntelliShapedImage manages a Shapedimage.
|
||||
|
||||
Reference in New Issue
Block a user