Go to the documentation of this file.
22 this->deleteToolLayer();
31 this->
isDrawing = this->createToolLayer();
40 this->mergeToolLayer();
41 this->deleteToolLayer();
57 bool IntelliTool::createToolLayer(){
58 if(
Area->createTempTopLayer(
Area->activeLayer)) {
60 this->
Canvas = &
Area->layerBundle[
static_cast<unsigned long long>(
Area->activeLayer + 1)];
66 void IntelliTool::mergeToolLayer(){
73 clr_0 = updatedImage.pixelColor(x,y);
75 float t =
static_cast<float>(clr_1.alpha()) / 255.f;
76 int r =
static_cast<int>(
static_cast<float>(clr_1.red()) * (t) +
static_cast<float>(clr_0.red()) * (1.f - t) + 0.5f);
77 int g =
static_cast<int>(
static_cast<float>(clr_1.green()) * (t) +
static_cast<float>(clr_0.green()) * (1.f - t) + 0.5f);
78 int b =
static_cast<int>(
static_cast<float>(clr_1.blue()) * (t) +
static_cast<float>(clr_0.blue() * (1.f - t)) + 0.5f);
79 int a = std::min(clr_0.alpha() + clr_1.alpha(), 255);
85 updatedImage.setPixelColor(x, y, clr_0);
96 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.
int width
width - Stores the width of a layer in pixels.
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)
int height
height - Stores the height of a layer in pixels.
The IntelliColorPicker manages the selected colors for one whole project.
QImage imageData
The underlying image data.
IntelliImage * image
image - Stores the imageData of the current LayerObject.
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.