mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-17 22:00:29 +02:00
Documentation of image
This commit is contained in:
@@ -32,7 +32,7 @@ protected:
|
|||||||
QImage imageData;
|
QImage imageData;
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
* \brief The Construcor of the Shaped Image. Given the Image dimensions.
|
* \brief The Construcor of the IntelliImage. Given the Image dimensions.
|
||||||
* \param weight - The weight of the Image.
|
* \param weight - The weight of the Image.
|
||||||
* \param height - The height of the Image.
|
* \param height - The height of the Image.
|
||||||
*/
|
*/
|
||||||
@@ -60,6 +60,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
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
|
||||||
|
* \param p1
|
||||||
|
* \param color
|
||||||
|
* \param penWidth
|
||||||
|
*/
|
||||||
|
virtual void drawPoint(const QPoint &p1, const QColor& color, const int& penWidth);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief A function that clears the whole image in a given Color.
|
* \brief A function that clears the whole image in a given Color.
|
||||||
* \param color - The color, in which the image will be filled.
|
* \param color - The color, in which the image will be filled.
|
||||||
|
|||||||
@@ -4,24 +4,53 @@
|
|||||||
#include"Image/IntelliImage.h"
|
#include"Image/IntelliImage.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The IntelliRasterImage manages a simple Rasterimage
|
* \brief The IntelliRasterImage manages a Rasterimage.
|
||||||
*/
|
*/
|
||||||
class IntelliRasterImage : public IntelliImage{
|
class IntelliRasterImage : public IntelliImage{
|
||||||
friend IntelliTool;
|
friend IntelliTool;
|
||||||
protected:
|
protected:
|
||||||
|
/*!
|
||||||
|
* \brief A function that calculates the visibility of the image if a polygon is given. [does nothing in Rasterimage]
|
||||||
|
*/
|
||||||
virtual void calculateVisiblity() override;
|
virtual void calculateVisiblity() override;
|
||||||
public:
|
public:
|
||||||
|
/*!
|
||||||
|
* \brief The Construcor of the IntelliRasterImage. Given the Image dimensions.
|
||||||
|
* \param weight - The weight of the Image.
|
||||||
|
* \param height - The height of the Image.
|
||||||
|
*/
|
||||||
IntelliRasterImage(int weight, int height);
|
IntelliRasterImage(int weight, int height);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief An Destructor.
|
||||||
|
*/
|
||||||
virtual ~IntelliRasterImage() override;
|
virtual ~IntelliRasterImage() override;
|
||||||
|
|
||||||
//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) override;
|
virtual QImage getDisplayable(const QSize& displaySize,int alpha) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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) override;
|
virtual QImage getDisplayable(int alpha=255) override;
|
||||||
|
|
||||||
//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() override;
|
virtual IntelliImage* getDeepCopy() override;
|
||||||
|
|
||||||
//sets the data for the visible image
|
/*!
|
||||||
|
* \brief An abstract function that sets the data of the visible Polygon, if needed.
|
||||||
|
* \param polygonData - The Vertices of the Polygon. Nothing happens.
|
||||||
|
*/
|
||||||
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,28 +5,71 @@
|
|||||||
#include<vector>
|
#include<vector>
|
||||||
#include"IntelliHelper/IntelliHelper.h"
|
#include"IntelliHelper/IntelliHelper.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief The IntelliShapedImage manages a Shapedimage.
|
||||||
|
*/
|
||||||
class IntelliShapedImage : public IntelliRasterImage{
|
class IntelliShapedImage : public IntelliRasterImage{
|
||||||
friend IntelliTool;
|
friend IntelliTool;
|
||||||
private:
|
private:
|
||||||
|
/*!
|
||||||
|
* \brief The Triangulation of the Polygon. Saved here for performance reasons.
|
||||||
|
*/
|
||||||
std::vector<Triangle> triangles;
|
std::vector<Triangle> triangles;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Calculates the visibility based on the underlying polygon.
|
||||||
|
*/
|
||||||
|
virtual void calculateVisiblity() override;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief The Vertices of The Polygon. Needs to be a planar Polygon.
|
||||||
|
*/
|
||||||
std::vector<QPoint> polygonData;
|
std::vector<QPoint> polygonData;
|
||||||
public:
|
public:
|
||||||
|
/*!
|
||||||
|
* \brief The Construcor of the IntelliShapedImage. Given the Image dimensions.
|
||||||
|
* \param weight - The weight of the Image.
|
||||||
|
* \param height - The height of the Image.
|
||||||
|
*/
|
||||||
IntelliShapedImage(int weight, int height);
|
IntelliShapedImage(int weight, int height);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief An Destructor.
|
||||||
|
*/
|
||||||
virtual ~IntelliShapedImage() override;
|
virtual ~IntelliShapedImage() override;
|
||||||
|
|
||||||
virtual void calculateVisiblity() override;
|
/*!
|
||||||
|
* \brief A function returning the displayable ImageData in a requested transparence and size.
|
||||||
//returns the filtered output
|
* \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=255) override;
|
virtual QImage getDisplayable(const QSize& displaySize, int alpha=255) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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) override;
|
virtual QImage getDisplayable(int alpha=255) override;
|
||||||
|
|
||||||
//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() override;
|
virtual IntelliImage* getDeepCopy() override;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief A function that returns the Polygondata if existent.
|
||||||
|
* \return The Polygondata if existent.
|
||||||
|
*/
|
||||||
virtual std::vector<QPoint> getPolygonData() override{return polygonData;}
|
virtual std::vector<QPoint> getPolygonData() override{return polygonData;}
|
||||||
|
|
||||||
//sets the data for the visible image
|
/*!
|
||||||
|
* \brief A function that sets the data of the visible Polygon.
|
||||||
|
* \param polygonData - The Vertices of the Polygon. Just Planar Polygons are allowed.
|
||||||
|
*/
|
||||||
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ void IntelliToolCircle::onWheelScrolled(int value){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolCircle::onMouseMoved(int x, int y){
|
void IntelliToolCircle::onMouseMoved(int x, int y){
|
||||||
IntelliTool::onMouseMoved(x,y);
|
|
||||||
if(this->drawing){
|
if(this->drawing){
|
||||||
this->Canvas->image->drawPlain(Qt::transparent);
|
this->Canvas->image->drawPlain(Qt::transparent);
|
||||||
QPoint next(x,y);
|
QPoint next(x,y);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ void IntelliToolLine::onWheelScrolled(int value){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolLine::onMouseMoved(int x, int y){
|
void IntelliToolLine::onMouseMoved(int x, int y){
|
||||||
IntelliTool::onMouseMoved(x,y);
|
|
||||||
if(this->drawing){
|
if(this->drawing){
|
||||||
this->Canvas->image->drawPlain(Qt::transparent);
|
this->Canvas->image->drawPlain(Qt::transparent);
|
||||||
QPoint next(x,y);
|
QPoint next(x,y);
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ void IntelliToolRectangle::onMouseLeftReleased(int x, int y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliToolRectangle::onMouseMoved(int x, int y){
|
void IntelliToolRectangle::onMouseMoved(int x, int y){
|
||||||
IntelliTool::onMouseMoved(x,y);
|
|
||||||
if(this->drawing){
|
if(this->drawing){
|
||||||
this->Canvas->image->drawPlain(Qt::transparent);
|
this->Canvas->image->drawPlain(Qt::transparent);
|
||||||
QPoint next(x,y);
|
QPoint next(x,y);
|
||||||
|
|||||||
Reference in New Issue
Block a user