IntelliPhoto 0.6

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 //for unit testing
15 class UnitTest;
16
17 class IntelliTool;
18
22 enum class ImageType {
23 RASTERIMAGE,
24 SHAPEDIMAGE
25 };
26
30 class IntelliImage {
31 friend UnitTest;
32 friend IntelliTool;
33 public:
34
35 protected:
36 void resizeImage(QImage*image, const QSize &newSize);
37
41 QImage imageData;
42
46 ImageType TypeOfImage;
47
51 bool fastRenderering;
52
53 public:
60 IntelliImage(int width, int height, bool fastRendererOn);
61
62
66 virtual ~IntelliImage() = 0;
67
68
74 virtual void drawPixel(const QPoint &p1, const QColor& color);
75
83 virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth);
84
91 virtual void drawPoint(const QPoint &p1, const QColor& color, const int& penWidth);
92
97 virtual void drawPlain(const QColor& color);
98
105 virtual QImage getDisplayable(const QSize& displaySize, int alpha) = 0;
106
112 virtual QImage getDisplayable(int alpha = 255) = 0;
113
118 virtual IntelliImage* getDeepCopy() = 0;
119
123 virtual void calculateVisiblity() = 0;
124
129 virtual void setPolygon(const std::vector<QPoint>& polygonData) = 0;
130
135 virtual std::vector<QPoint> getPolygonData(){
136 return std::vector<QPoint>();
137 }
138
139 virtual ImageType getTypeOfImage(){
140 return TypeOfImage;
141 }
142
148 virtual bool loadImage(const QString &filePath);
149
155 virtual QColor getPixelColor(QPoint& point);
156
161 virtual void updateRendererSetting(bool fastRendererOn);
162
166 virtual QImage getImageData();
167
172 virtual void setImageData(const QImage& newData);
173
174 virtual int getWidth() const;
175
176 virtual int getHeight() const;
177
178 virtual bool isFastRendering() const;
179
180 };
181
182 #endif
ImageType::RASTERIMAGE
@ RASTERIMAGE
ImageType
ImageType
The Types, which an Image can be.
Definition: IntelliImage.h:22
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:97
IntelliImage::~IntelliImage
virtual ~IntelliImage()=0
An Abstract Destructor.
Definition: IntelliImage.cpp:19
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:58
IntelliImage::getDisplayable
virtual QImage getDisplayable(const QSize &displaySize, int alpha)=0
A function returning the displayable ImageData in a requested transparence and size.
IntelliImage::isFastRendering
virtual bool isFastRendering() const
Definition: IntelliImage.cpp:171
IntelliImage::getTypeOfImage
virtual ImageType getTypeOfImage()
Definition: IntelliImage.h:139
IntelliImage::getPolygonData
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
Definition: IntelliImage.h:135
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 function that draws a point between on a given point in a given color.
Definition: IntelliImage.cpp:78
IntelliImage::updateRendererSetting
virtual void updateRendererSetting(bool fastRendererOn)
updateRendererSetting updates the existing image format to the new format.
Definition: IntelliImage.cpp:153
IntelliImage::fastRenderering
bool fastRenderering
fastRendering is the flag that represents the usage of 8bit pictures.
Definition: IntelliImage.h:51
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:17
IntelliImage::getImageData
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
Definition: IntelliImage.cpp:135
IntelliImage::resizeImage
void resizeImage(QImage *image, const QSize &newSize)
Definition: IntelliImage.cpp:38
IntelliImage::setImageData
virtual void setImageData(const QImage &newData)
setImageData overwrites the old imageData the new imageData.
Definition: IntelliImage.cpp:143
ImageType::SHAPEDIMAGE
@ SHAPEDIMAGE
IntelliImage::TypeOfImage
ImageType TypeOfImage
The Type, an Image is.
Definition: IntelliImage.h:46
IntelliImage::getPixelColor
virtual QColor getPixelColor(QPoint &point)
A function that returns the pixelcolor at a certain point.
Definition: IntelliImage.cpp:127
IntelliImage::getHeight
virtual int getHeight() const
Definition: IntelliImage.cpp:167
IntelliImage::imageData
QImage imageData
The underlying image data.
Definition: IntelliImage.h:41
UnitTest
Definition: mainUnitTest.cpp:8
IntelliImage::loadImage
virtual bool loadImage(const QString &filePath)
A function that loads and sclaes an image to the fitting dimensions.
Definition: IntelliImage.cpp:23
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:30
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::getWidth
virtual int getWidth() const
Definition: IntelliImage.cpp:163
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:117
IntelliImage::setPolygon
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.