Image doc

This commit is contained in:
Sonaion
2019-12-18 17:17:23 +01:00
parent 197ac59998
commit 1d65078df0

View File

@@ -8,6 +8,9 @@
#include<QWidget> #include<QWidget>
#include<vector> #include<vector>
/*!
* \brief The Types, which an Image can be.
*/
enum class ImageType{ enum class ImageType{
Raster_Image, Raster_Image,
Shaped_Image Shaped_Image
@@ -15,39 +18,97 @@ enum class ImageType{
class IntelliTool; class IntelliTool;
/*!
* \brief An abstract class which manages the basic IntelliImage operations.
*/
class IntelliImage{ class IntelliImage{
friend IntelliTool; friend IntelliTool;
protected: protected:
void resizeImage(QImage *image, const QSize &newSize); void resizeImage(QImage *image, const QSize &newSize);
/*!
* \brief The underlying image data.
*/
QImage imageData; QImage imageData;
//calculate with polygon
public: public:
/*!
* \brief The Construcor of the Shaped Image. Given the Image dimensions.
* \param weight The weight of the Image.
* \param height The height of the Image.
*/
IntelliImage(int weight, int height); IntelliImage(int weight, int height);
/*!
* \brief An Abstract Destructor.
*/
virtual ~IntelliImage() = 0; virtual ~IntelliImage() = 0;
//start on top left /*!
* \brief A funtcion used to draw a pixel on the Image with the given Color.
* \param p1 The coordinates of the pixel, which should be drawn. [Top-Left-System]
* \param color The color of the pixel.
*/
virtual void drawPixel(const QPoint &p1, const QColor& color); virtual void drawPixel(const QPoint &p1, const QColor& color);
/*!
* \brief A function that draws A Line between two given Points in a given color.
* \param p1 The coordinates of the first Point.
* \param p2 The coordinates of the second Point.
* \param color The color of the line.
* \param penWidth The width of the line.
*/
virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth); virtual void drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth);
/*!
* \brief A function that clears the whole image in a given Color.
* \param color The color, in which the image will be filled.
*/
virtual void drawPlain(const QColor& color); virtual void drawPlain(const QColor& color);
//returns the filtered output /*!
* \brief A function returning the displayable ImageData in a requested transparence and size.
* \param displaySize The size, in whcih the Image should be displayed.
* \param alpha The maximum alpha value, a pixel can have.
* \return A QImage which is ready to be displayed.
*/
virtual QImage getDisplayable(const QSize& displaySize, int alpha)=0; virtual QImage getDisplayable(const QSize& displaySize, int alpha)=0;
/**
* @brief A function returning the displayable ImageData in a requested transparence and it's standart size.
* @param alpha The maximum alpha value, a pixel can have.
* @return A QImage which is ready to be displayed.
*/
virtual QImage getDisplayable(int alpha=255)=0; virtual QImage getDisplayable(int alpha=255)=0;
//gets a copy of the image !allocated /*!
* \brief A function that copys all that returns a [allocated] Image
* \return A [allocated] Image with all the properties of the instance.
*/
virtual IntelliImage* getDeepCopy()=0; virtual IntelliImage* getDeepCopy()=0;
/*!
* \brief An abstract function that calculates the visiblity of the Image data if needed.
*/
virtual void calculateVisiblity()=0; virtual void calculateVisiblity()=0;
//returns the filtered output /*!
* \brief An abstract function that sets the data of the visible Polygon, if needed.
//sets the data for the visible image * \param polygonData The Vertices of the Polygon. Just Planar Polygons are allowed.
*/
virtual void setPolygon(const std::vector<QPoint>& polygonData)=0; virtual void setPolygon(const std::vector<QPoint>& polygonData)=0;
/*!
* \brief An function that returns the Polygondata if existent.
* \return The Polygondata if existent.
*/
virtual std::vector<QPoint> getPolygonData(){ return std::vector<QPoint>();} virtual std::vector<QPoint> getPolygonData(){ return std::vector<QPoint>();}
//loads an image to the ColorBuffer /*!
* \brief Loads and Sclaes an Image to the fitting dimensions.
* \param fileName The path+name of the image which to loaded.
* \return True if the image could be loaded, false otherwise.
*/
virtual bool loadImage(const QString &fileName); virtual bool loadImage(const QString &fileName);
}; };