mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-18 06:10:29 +02:00
Now everything is Indexe 8 😲
Job done.
This commit is contained in:
@@ -4,7 +4,13 @@
|
|||||||
|
|
||||||
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
||||||
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
|
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
|
||||||
|
if(fastRendererOn){
|
||||||
|
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
|
}
|
||||||
imageData.fill(QColor(255,255,255,255));
|
imageData.fill(QColor(255,255,255,255));
|
||||||
|
if(fastRendererOn){
|
||||||
|
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
|
}
|
||||||
this->fastRenderer = fastRendererOn;
|
this->fastRenderer = fastRendererOn;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
|
|||||||
//set standart parameter
|
//set standart parameter
|
||||||
this->maxWidth = maxWidth;
|
this->maxWidth = maxWidth;
|
||||||
this->maxHeight = maxHeight;
|
this->maxHeight = maxHeight;
|
||||||
Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
|
if(renderSettings.getFastRenderer()) Canvas = new QImage(maxWidth,maxHeight, QImage::Format_Indexed8);
|
||||||
|
else Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
|
||||||
|
|
||||||
// Roots the widget to the top left even if resized
|
// Roots the widget to the top left even if resized
|
||||||
setAttribute(Qt::WA_StaticContents);
|
setAttribute(Qt::WA_StaticContents);
|
||||||
@@ -66,7 +67,10 @@ int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOff
|
|||||||
}else if(type==IntelliImage::ImageType::Shaped_Image) {
|
}else if(type==IntelliImage::ImageType::Shaped_Image) {
|
||||||
newLayer.image = new IntelliShapedImage(width, height, renderSettings.getFastRenderer());
|
newLayer.image = new IntelliShapedImage(width, height, renderSettings.getFastRenderer());
|
||||||
}
|
}
|
||||||
|
|
||||||
newLayer.alpha = 255;
|
newLayer.alpha = 255;
|
||||||
|
|
||||||
|
|
||||||
this->layerBundle.push_back(newLayer);
|
this->layerBundle.push_back(newLayer);
|
||||||
return static_cast<int>(layerBundle.size())-1;
|
return static_cast<int>(layerBundle.size())-1;
|
||||||
}
|
}
|
||||||
@@ -350,6 +354,7 @@ void PaintingArea::drawLayers(bool forSaving){
|
|||||||
QImage cpy = layer.image->getDisplayable(layer.alpha);
|
QImage cpy = layer.image->getDisplayable(layer.alpha);
|
||||||
if(renderSettings.getFastRenderer()){
|
if(renderSettings.getFastRenderer()){
|
||||||
cpy = cpy.convertToFormat(QImage::Format_ARGB32);
|
cpy = cpy.convertToFormat(QImage::Format_ARGB32);
|
||||||
|
*Canvas = Canvas->convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
QColor clr_0;
|
QColor clr_0;
|
||||||
QColor clr_1;
|
QColor clr_1;
|
||||||
@@ -375,6 +380,9 @@ void PaintingArea::drawLayers(bool forSaving){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(renderSettings.getFastRenderer()){
|
||||||
|
*Canvas = Canvas->convertToFormat(QImage::Format_Indexed8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintingArea::createTempTopLayer(int idx){
|
void PaintingArea::createTempTopLayer(int idx){
|
||||||
|
|||||||
Reference in New Issue
Block a user