# IntelliPhoto: intelliphoto/src/Image/IntelliImage.h Source File

IntelliImage.h
Go to the documentation of this file.
#ifndef INTELLIIMAGE_H
#define INTELLIIMAGE_H
#include <QImage>
#include <QPoint>
#include <QColor>
#include <QSize>
#include <QWidget>
#include <vector>
enum class ImageType {
Raster_Image,
Shaped_Image
};
class IntelliTool;
class IntelliImage {
friend IntelliTool;
protected:
void resizeImage(QImage*image, const QSize &newSize);
QImage imageData;
public:
IntelliImage(int weight, int height);
virtual ~IntelliImage() = 0;
virtual void drawPixel(const QPoint &p1, const QColor& color);
virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth);
virtual void drawPoint(const QPoint &p1, const QColor& color, const int& penWidth);
virtual void drawPlain(const QColor& color);
virtual QImage getDisplayable(const QSize& displaySize, int alpha) = 0;
virtual QImage getDisplayable(int alpha=255) = 0;
virtual IntelliImage* getDeepCopy() = 0;
virtual void calculateVisiblity() = 0;
virtual void setPolygon(const std::vector<QPoint>& polygonData) = 0;
virtual std::vector<QPoint> getPolygonData(){
return std::vector<QPoint>();
}
virtual bool loadImage(const QString &fileName);
virtual QColor getPixelColor(QPoint& point);
};
#endif
ImageType
ImageType
The Types, which an Image can be.
Definition: IntelliImage.h:14
IntelliImage::drawLine
virtual void drawLine(const QPoint &p1, const QPoint &p2, const QColor &color, const int &penWidth)
A function that draws A Line between two given Points in a given color.
Definition: IntelliImage.cpp:65
IntelliImage::~IntelliImage
virtual ~IntelliImage()=0
An Abstract Destructor.
Definition: IntelliImage.cpp:10
IntelliImage::drawPixel
virtual void drawPixel(const QPoint &p1, const QColor &color)
A funtcion used to draw a pixel on the Image with the given Color.
Definition: IntelliImage.cpp:44
IntelliImage::loadImage
virtual bool loadImage(const QString &fileName)
A function that loads and sclaes an image to the fitting dimensions.
Definition: IntelliImage.cpp:14
IntelliImage::getDisplayable
virtual QImage getDisplayable(const QSize &displaySize, int alpha)=0
A function returning the displayable ImageData in a requested transparence and size.
ImageType::Raster_Image
IntelliImage::getPolygonData
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
Definition: IntelliImage.h:113
IntelliImage::drawPoint
virtual void drawPoint(const QPoint &p1, const QColor &color, const int &penWidth)
A.
Definition: IntelliImage.cpp:55
IntelliImage::IntelliImage
IntelliImage(int weight, int height)
The Construcor of the IntelliImage. Given the Image dimensions.
Definition: IntelliImage.cpp:5
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:13
ImageType::Shaped_Image
IntelliImage::resizeImage
void resizeImage(QImage *image, const QSize &newSize)
Definition: IntelliImage.cpp:29
IntelliImage::getPixelColor
virtual QColor getPixelColor(QPoint &point)
A function that returns the pixelcolor at a certain point.
Definition: IntelliImage.cpp:80
IntelliImage::imageData
QImage imageData
The underlying image data.
Definition: IntelliImage.h:32
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:24
IntelliImage::getDeepCopy
virtual IntelliImage * getDeepCopy()=0
A function that copys all that returns a [allocated] Image.
IntelliImage::calculateVisiblity
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:76
IntelliImage::setPolygon
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.