Go to the documentation of this file.
36 void IntelliShapedImage::calculateVisiblity(){
46 for(
int y = 0; y<
imageData.height(); y++) {
47 for(
int x = 0; x<
imageData.width(); x++) {
59 for(
int y = 0; y<
imageData.height(); y++) {
60 for(
int x = 0; x<
imageData.width(); x++) {
65 clr.setAlpha(std::min(255, clr.alpha()));
80 copy =
copy.convertToFormat(QImage::Format_ARGB32);
82 for(
int y = 0; y<
copy.height(); y++) {
83 for(
int x = 0; x<
copy.width(); x++) {
84 QColor clr =
copy.pixelColor(x,y);
85 clr.setAlpha(std::min(alpha,clr.alpha()));
86 copy.setPixelColor(x,y, clr);
90 copy =
copy.convertToFormat(QImage::Format_Indexed8);
92 return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
97 this->polygonData.clear();
99 this->polygonData.clear();
101 this->polygonData.push_back(QPoint(element.x(), element.y()));
107 for(
int y = 0; y<
imageData.height(); y++) {
108 for(
int x = 0; x<
imageData.width(); x++) {
118 calculateVisiblity();
virtual QImage getDisplayable(const QSize &displaySize, int alpha=255) override
A function returning the displayable ImageData in a requested transparence and size.
IntelliShapedImage * copy(const IntelliShapedImage &image)
std::vector< Triangle > calculateTriangles(std::vector< QPoint > polyPoints)
A function to split a polygon in its spanning traingles by using Meisters Theorem of graph theory by ...
virtual std::vector< QPoint > getPolygon() override
getPolygon
The IntelliShapedImage manages a Shapedimage.
virtual IntelliImage * getDeepCopy() override
A function that copys all that returns a [allocated] Image.
bool fastRenderering
fastRendering is the flag that represents the usage of 8bit pictures.
ImageType TypeOfImage
The Type, an Image is.
QImage imageData
The underlying image data.
An abstract class which manages the basic IntelliImage operations.
std::vector< QPoint > polygonData
The Vertices of The Polygon. Needs to be a planar Polygon.
IntelliShapedImage(int width, int height, bool fastRendererOn)
The Construcor of the IntelliShapedImage. Given the Image dimensions.
bool isInPolygon(const std::vector< Triangle > &triangles, QPoint &point)
A function to check if a point lies in a polygon by checking its spanning triangles.
virtual ~IntelliShapedImage() override
An Destructor.
The IntelliRasterImage manages a RASTERIMAGE.
virtual int getWidth() const
getWidth returns the width of the Image.
virtual void setPolygon(const std::vector< QPoint > &polygonData) override
A function that sets the data of the visible Polygon.