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 
13 
14 //for unit testing
15 class UnitTest;
16 
17 class IntelliTool;
18 
22 class IntelliImage {
23 friend UnitTest;
24 friend IntelliTool;
25 public:
26 
30 enum class ImageType {
33 };
34 
35 protected:
36 void resizeImage(QImage*image, const QSize &newSize);
37 
41 QImage imageData;
42 
47 
52 
53 public:
60 IntelliImage(int width, int height, bool fastRendererOn);
61 
65 virtual ~IntelliImage() = 0;
66 
67 
73 virtual void drawPixel(const QPoint &p1, const QColor& color);
74 
82 virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth);
83 
90 virtual void drawPoint(const QPoint &p1, const QColor& color, const int& penWidth);
91 
96 virtual void drawPlain(const QColor& color);
97 
104 virtual QImage getDisplayable(const QSize& displaySize, int alpha) = 0;
105 
111 virtual QImage getDisplayable(int alpha = 255) = 0;
112 
117 virtual IntelliImage* getDeepCopy() = 0;
118 
122 virtual void calculateVisiblity() = 0;
123 
128 virtual void setPolygon(const std::vector<QPoint>& polygonData) = 0;
129 
134 virtual std::vector<QPoint> getPolygonData(){
135  return std::vector<QPoint>();
136 }
137 
139  return TypeOfImage;
140 }
141 
147 virtual bool loadImage(const QString &filePath);
148 
154 virtual QColor getPixelColor(QPoint& point);
155 
160 virtual void updateRendererSetting(bool fastRendererOn);
161 
165 virtual QImage getImageData();
166 
171 virtual void setImageData(const QImage& newData);
172 
173 };
174 
175 #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:96
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:57
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:138
IntelliImage::getPolygonData
virtual std::vector< QPoint > getPolygonData()
A function that returns the Polygondata if existent.
Definition: IntelliImage.h:134
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:77
IntelliImage::updateRendererSetting
virtual void updateRendererSetting(bool fastRendererOn)
updateRendererSetting updates the existing image format to the new format.
Definition: IntelliImage.cpp:152
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::ImageType::SHAPEDIMAGE
@ SHAPEDIMAGE
IntelliImage::getImageData
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
Definition: IntelliImage.cpp:134
IntelliImage::resizeImage
void resizeImage(QImage *image, const QSize &newSize)
Definition: IntelliImage.cpp:37
IntelliImage::setImageData
virtual void setImageData(const QImage &newData)
setImageData overwrites the old imageData the new imageData.
Definition: IntelliImage.cpp:142
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:126
IntelliImage::ImageType::RASTERIMAGE
@ RASTERIMAGE
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:22
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:22
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:30
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:116
IntelliImage::setPolygon
virtual void setPolygon(const std::vector< QPoint > &polygonData)=0
An abstract function that sets the data of the visible Polygon, if needed.