mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
Unified ENUM Names
This commit is contained in:
@@ -24,8 +24,8 @@ public:
|
||||
* \brief The Types, which an Image can be.
|
||||
*/
|
||||
enum class ImageType {
|
||||
Raster_Image,
|
||||
Shaped_Image
|
||||
RASTERIMAGE,
|
||||
SHAPEDIMAGE
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
IntelliRasterImage::IntelliRasterImage(int weight, int height)
|
||||
: IntelliImage(weight, height){
|
||||
TypeOfImage = IntelliImage::ImageType::Raster_Image;
|
||||
TypeOfImage = IntelliImage::ImageType::RASTERIMAGE;
|
||||
}
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
@@ -15,7 +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;
|
||||
raster->TypeOfImage = IntelliImage::ImageType::RASTERIMAGE;
|
||||
return raster;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
IntelliShapedImage::IntelliShapedImage(int weight, int height)
|
||||
: IntelliRasterImage(weight, height){
|
||||
TypeOfImage = IntelliImage::ImageType::Shaped_Image;
|
||||
TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
|
||||
}
|
||||
|
||||
IntelliShapedImage::~IntelliShapedImage(){
|
||||
@@ -21,7 +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;
|
||||
shaped->TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
|
||||
return shaped;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
|
||||
: QWidget(parent){
|
||||
this->Tool = nullptr;
|
||||
this->setLayerDimensions(maxWidth, maxHeight);
|
||||
this->addLayer(200,200,0,0,IntelliImage::ImageType::Shaped_Image);
|
||||
this->addLayer(200,200,0,0,IntelliImage::ImageType::SHAPEDIMAGE);
|
||||
layerBundle[0].image->drawPlain(QColor(0,0,255,255));
|
||||
std::vector<QPoint> polygon;
|
||||
polygon.push_back(QPoint(100,000));
|
||||
@@ -31,7 +31,7 @@ PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
|
||||
polygon.push_back(QPoint(000,100));
|
||||
layerBundle[0].image->setPolygon(polygon);
|
||||
|
||||
this->addLayer(200,200,150,150,IntelliImage::ImageType::Raster_Image);
|
||||
this->addLayer(200,200,150,150,IntelliImage::ImageType::RASTERIMAGE);
|
||||
layerBundle[1].image->drawPlain(QColor(0,255,0,255));
|
||||
layerBundle[1].alpha=200;
|
||||
|
||||
@@ -59,9 +59,9 @@ int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOff
|
||||
newLayer.height = height;
|
||||
newLayer.widthOffset = widthOffset;
|
||||
newLayer.heightOffset = heightOffset;
|
||||
if(type==IntelliImage::ImageType::Raster_Image) {
|
||||
if(type==IntelliImage::ImageType::RASTERIMAGE) {
|
||||
newLayer.image = new IntelliRasterImage(width,height);
|
||||
}else if(type==IntelliImage::ImageType::Shaped_Image) {
|
||||
}else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
|
||||
newLayer.image = new IntelliShapedImage(width, height);
|
||||
}
|
||||
newLayer.alpha = 255;
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
* \param type - Defining the ImageType of the new layer
|
||||
* \return Returns the number of layers in the project
|
||||
*/
|
||||
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::Raster_Image);
|
||||
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
|
||||
/*!
|
||||
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
|
||||
* \param idx - Index of the position the new layer should be added
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
* \param type - Defining the ImageType of the new layer
|
||||
* \return Returns the id of the layer position
|
||||
*/
|
||||
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::Raster_Image);
|
||||
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
|
||||
/*!
|
||||
* \brief The deleteLayer method removes a layer at a given idx
|
||||
* \param idx - The index of the layer to be removed
|
||||
|
||||
@@ -19,12 +19,12 @@ IntelliToolPolygon::~IntelliToolPolygon(){
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||
if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::Shaped_Image && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
|
||||
if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
|
||||
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
|
||||
QPoint Point(x,y);
|
||||
isInside = IntelliTriangulation::isInPolygon(Triangles,Point);
|
||||
}
|
||||
else if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::Raster_Image && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
|
||||
else if(!isDrawing && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()){
|
||||
isInside = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user