IntelliPhoto 0.5

IntelliImage.h
Go to the documentation of this file.
1 #ifndef INTELLIIMAGE_H
2 #define INTELLIIMAGE_H
3
4 #include <QImage>
5 #include <QPoint>
6 #include <QColor>
7 #include <QSize>
8 #include <QWidget>
9 #include <vector>
10
11 #include "IntelliHelper/IntelliTriangulation.h"
12 #include "IntelliHelper/IntelliRenderSettings.h"
13
14 class IntelliTool;
15
19 class IntelliImage {
20 friend IntelliTool;
21 public:
22
26 enum class ImageType {
27 RASTERIMAGE,
28 SHAPEDIMAGE
29 };
30
31 protected:
32 void resizeImage(QImage*image, const QSize &newSize);
33
37 QImage imageData;
38
42 ImageType TypeOfImage;
43
47 bool fastRenderer;
48
49 public:
56 IntelliImage(int width, int height, bool fastRendererOn);
57
61 virtual ~IntelliImage() = 0;
62
63
69 virtual void drawPixel(const QPoint &p1, const QColor& color);
70
78 virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth);
79
86 virtual void drawPoint(const QPoint &p1, const QColor& color, const int& penWidth);
87
92 virtual void drawPlain(const QColor& color);
93
100 virtual QImage getDisplayable(const QSize& displaySize, int alpha) = 0;
101
107 virtual QImage getDisplayable(int alpha=255) = 0;
108
113 virtual IntelliImage* getDeepCopy() = 0;
114
118 virtual void calculateVisiblity() = 0;
119
124 virtual void setPolygon(const std::vector<QPoint>& polygonData) = 0;
125
130 virtual std::vector<QPoint> getPolygonData(){
131 return std::vector<QPoint>();
132 }
133
134 virtual ImageType getTypeOfImage(){
135 return TypeOfImage;
136 }
137
143 virtual bool loadImage(const QString &filePath);
144
150 virtual QColor getPixelColor(QPoint& point);
151
156 virtual void updateRendererSetting(bool fastRendererOn);
157
161 virtual QImage getImageData();
162
163 };
164
165 #endif
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:88
IntelliImage::~IntelliImage
virtual ~IntelliImage()=0
An Abstract Destructor.
Definition: IntelliImage.cpp:18
IntelliRenderSettings.h
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:55
IntelliImage::getDisplayable
virtual QImage getDisplayable(const QSize &displaySize, int alpha)=0
A function returning the displayable ImageData in a requested transparence and size.
IntelliImage::getTypeOfImage
virtual ImageType getTypeOfImage()
Definition: IntelliImage.h:134
IntelliImage::getPolygonData
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
Definition: IntelliImage.h:130
IntelliImage::IntelliImage
IntelliImage(int width, int height, bool fastRendererOn)
The Construcor of the IntelliImage. Given the Image dimensions.
Definition: IntelliImage.cpp:5
IntelliImage::drawPoint
virtual void drawPoint(const QPoint &p1, const QColor &color, const int &penWidth)
A.
Definition: IntelliImage.cpp:72
IntelliImage::updateRendererSetting
virtual void updateRendererSetting(bool fastRendererOn)
updateRendererSetting updates the existing image format to the new format.
Definition: IntelliImage.cpp:127
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:14
IntelliImage::ImageType::SHAPEDIMAGE
IntelliImage::getImageData
virtual QImage getImageData()
getImageData returns the data of the current image.
Definition: IntelliImage.cpp:123
IntelliImage::resizeImage
void resizeImage(QImage *image, const QSize &newSize)
Definition: IntelliImage.cpp:37
IntelliImage::TypeOfImage
ImageType TypeOfImage
The Type, an Image is.
Definition: IntelliImage.h:42
IntelliImage::getPixelColor
virtual QColor getPixelColor(QPoint &point)
A function that returns the pixelcolor at a certain point.
Definition: IntelliImage.cpp:115
IntelliImage::fastRenderer
bool fastRenderer
fastRenderer is the flag that represents the usage of 8bit pictures.
Definition: IntelliImage.h:47
IntelliImage::ImageType::RASTERIMAGE
IntelliImage::imageData
QImage imageData
The underlying image data.
Definition: IntelliImage.h:37
IntelliImage::loadImage
virtual bool loadImage(const QString &filePath)
A function that loads and sclaes an image to the fitting dimensions.
Definition: IntelliImage.cpp:22
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:19
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.
IntelliTriangulation.h
IntelliImage::ImageType
ImageType
The Types, which an Image can be.
Definition: IntelliImage.h:26
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:105
IntelliImage::setPolygon
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.