Engauge Digitizer  2
mmsubs.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef MM_SUBS_H
8 #define MM_SUBS_H
9 
10 #include <QRgb>
11 
12 class QImage;
13 class QPointF;
14 
16 extern double angleBetweenVectors (const QPointF &v1,
17  const QPointF &v2);
18 
20 extern double angleFromVectorToVector (const QPointF &vFrom,
21  const QPointF &vTo);
22 
24 extern QRgb pixelRGB (const QImage &image, int x, int y);
25 
27 extern QRgb pixelRGB1 (const QImage &image1Bit, int x, int y);
28 
30 extern QRgb pixelRGB8 (const QImage &image8Bit, int x, int y);
31 
33 extern QRgb pixelRGB32 (const QImage &image32Bit, int x, int y);
34 
49 extern void projectPointOntoLine(double xToProject,
50  double yToProject,
51  double xStart,
52  double yStart,
53  double xStop,
54  double yStop,
55  double *xProjection,
56  double *yProjection,
57  double *projectedDistanceOutsideLine,
58  double *distanceToLine);
59 
61 extern void setPixelRGB (QImage &image, int x, int y, QRgb q);
62 
64 extern void setPixelRGB1 (QImage &image1Bit, int x, int y, QRgb q);
65 
67 extern void setPixelRGB8 (QImage &image8Bit, int x, int y, QRgb q);
68 
70 extern void setPixelRGB32 (QImage &image32Bit, int x, int y, QRgb q);
71 
72 #endif // MM_SUBS_H