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>
#include "IntelliHelper/IntelliTriangulation.h"
#include "IntelliHelper/IntelliRenderSettings.h"
//for unit testing
class UnitTest;
class IntelliTool;
enum class ImageType {
RASTERIMAGE,
SHAPEDIMAGE
};
class IntelliImage {
friend UnitTest;
friend IntelliTool;
public:
protected:
void resizeImage(QImage*image, const QSize &newSize);
QImage imageData;
ImageType TypeOfImage;
bool fastRenderering;
public:
IntelliImage(int width, int height, bool fastRendererOn);
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 ImageType getTypeOfImage(){
return TypeOfImage;
}
virtual bool loadImage(const QString &filePath);
virtual QColor getPixelColor(QPoint& point);
virtual void updateRendererSetting(bool fastRendererOn);
virtual QImage getImageData();
virtual void setImageData(const QImage& newData);
virtual int getWidth() const;
virtual int getHeight() const;
virtual bool isFastRendering() const;
};
#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
isFastRendering returns if the Image is in fast rendering mode.
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
getHeight returns the height of the Image.
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
getWidth returns the width of the Image.
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.