mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
bring the fastrenderer back again...
hihihi
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
#include <QRect>
|
||||
#include <QDebug>
|
||||
|
||||
IntelliRasterImage::IntelliRasterImage(int weight, int height)
|
||||
: IntelliImage(weight, height){
|
||||
IntelliRasterImage::IntelliRasterImage(int width, int height, bool fastRendererOn)
|
||||
: IntelliImage(width, height, fastRendererOn){
|
||||
TypeOfImage = IntelliImage::ImageType::Raster_Image;
|
||||
this->fastRenderer = fastRendererOn;
|
||||
}
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
@@ -13,7 +14,7 @@ IntelliRasterImage::~IntelliRasterImage(){
|
||||
}
|
||||
|
||||
IntelliImage* IntelliRasterImage::getDeepCopy(){
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height());
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), false);
|
||||
raster->imageData.fill(Qt::transparent);
|
||||
raster->TypeOfImage = IntelliImage::ImageType::Raster_Image;
|
||||
return raster;
|
||||
@@ -29,6 +30,9 @@ QImage IntelliRasterImage::getDisplayable(int alpha){
|
||||
|
||||
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||
QImage copy = imageData;
|
||||
if(fastRenderer){
|
||||
copy = copy.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
for(int y = 0; y<copy.height(); y++) {
|
||||
for(int x = 0; x<copy.width(); x++) {
|
||||
QColor clr = copy.pixelColor(x,y);
|
||||
@@ -36,6 +40,9 @@ QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||
copy.setPixelColor(x,y, clr);
|
||||
}
|
||||
}
|
||||
if(fastRenderer){
|
||||
copy = copy.convertToFormat(QImage::Format_Indexed8);
|
||||
}
|
||||
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user