Go to the documentation of this file.
18 this->deleteToolLayer();
27 this->
isDrawing = this->createToolLayer();
36 this->mergeToolLayer();
37 this->deleteToolLayer();
53 bool IntelliTool::createToolLayer(){
54 if(
Area->createTempTopLayer(
Area->activeLayer)) {
56 this->
Canvas = &
Area->layerBundle[
static_cast<unsigned long long>(
Area->activeLayer + 1)];
62 void IntelliTool::mergeToolLayer(){
69 clr_0 = updatedImage.pixelColor(x,y);
71 float t =
static_cast<float>(clr_1.alpha()) / 255.f;
72 int r =
static_cast<int>(
static_cast<float>(clr_1.red()) * (t) +
static_cast<float>(clr_0.red()) * (1.f - t) + 0.5f);
73 int g =
static_cast<int>(
static_cast<float>(clr_1.green()) * (t) +
static_cast<float>(clr_0.green()) * (1.f - t) + 0.5f);
74 int b =
static_cast<int>(
static_cast<float>(clr_1.blue()) * (t) +
static_cast<float>(clr_0.blue() * (1.f - t)) + 0.5f);
75 int a = std::min(clr_0.alpha() + clr_1.alpha(), 255);
81 updatedImage.setPixelColor(x, y, clr_0);
91 void IntelliTool::deleteToolLayer(){
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
The PaintingArea class manages the methods and stores information about the current painting area,...
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
virtual void setImageData(const QImage &newData)
setImageData overwrites the old imageData the new imageData.
void setToolWidth(int value)
The IntelliColorPicker manages the selected colors for one whole project.
QImage imageData
The underlying image data.
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.