mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-21 07:40:30 +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)
|
||||
: 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));
|
||||
if(fastRendererOn){
|
||||
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
|
||||
}
|
||||
this->fastRenderer = fastRendererOn;
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
|
||||
//set standart parameter
|
||||
this->maxWidth = maxWidth;
|
||||
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
|
||||
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) {
|
||||
newLayer.image = new IntelliShapedImage(width, height, renderSettings.getFastRenderer());
|
||||
}
|
||||
|
||||
newLayer.alpha = 255;
|
||||
|
||||
|
||||
this->layerBundle.push_back(newLayer);
|
||||
return static_cast<int>(layerBundle.size())-1;
|
||||
}
|
||||
@@ -350,6 +354,7 @@ void PaintingArea::drawLayers(bool forSaving){
|
||||
QImage cpy = layer.image->getDisplayable(layer.alpha);
|
||||
if(renderSettings.getFastRenderer()){
|
||||
cpy = cpy.convertToFormat(QImage::Format_ARGB32);
|
||||
*Canvas = Canvas->convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
QColor clr_0;
|
||||
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){
|
||||
|
||||
Reference in New Issue
Block a user