mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
Moved up src/ one level
This commit is contained in:
44
src/Image/IntelliRasterImage.cpp
Normal file
44
src/Image/IntelliRasterImage.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include"Image/IntelliRasterImage.h"
|
||||
#include<QPainter>
|
||||
#include<QRect>
|
||||
#include<QDebug>
|
||||
|
||||
IntelliRasterImage::IntelliRasterImage(int weight, int height)
|
||||
:IntelliImage(weight, height){
|
||||
|
||||
}
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
|
||||
}
|
||||
|
||||
IntelliImage* IntelliRasterImage::getDeepCopy(){
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height());
|
||||
raster->imageData.fill(Qt::transparent);
|
||||
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;
|
||||
for(int y = 0; y<copy.height(); y++){
|
||||
for(int x = 0; x<copy.width(); x++){
|
||||
QColor clr = copy.pixelColor(x,y);
|
||||
clr.setAlpha(std::min(alpha, clr.alpha()));
|
||||
copy.setPixelColor(x,y, clr);
|
||||
}
|
||||
}
|
||||
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
||||
}
|
||||
|
||||
void IntelliRasterImage::setPolygon(const std::vector<QPoint>& polygonData){
|
||||
qDebug() << "Raster Image has no polygon data " << polygonData.size() <<"\n";
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user