Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mmsubs.h
Go to the documentation of this file.
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 
26 extern void ellipseFromParallelogram (double xTL,
27  double yTL,
28  double xTR,
29  double yTR,
30  double xBR,
31  double yBR,
32  double &angleRadians,
33  double &aAligned,
34  double &bAligned);
35 
37 extern QRgb pixelRGB (const QImage &image, int x, int y);
38 
40 extern QRgb pixelRGB1 (const QImage &image1Bit, int x, int y);
41 
43 extern QRgb pixelRGB8 (const QImage &image8Bit, int x, int y);
44 
46 extern QRgb pixelRGB32 (const QImage &image32Bit, int x, int y);
47 
62 extern void projectPointOntoLine(double xToProject,
63  double yToProject,
64  double xStart,
65  double yStart,
66  double xStop,
67  double yStop,
68  double *xProjection,
69  double *yProjection,
70  double *projectedDistanceOutsideLine,
71  double *distanceToLine);
72 
74 extern void setPixelRGB (QImage &image, int x, int y, QRgb q);
75 
77 extern void setPixelRGB1 (QImage &image1Bit, int x, int y, QRgb q);
78 
80 extern void setPixelRGB8 (QImage &image8Bit, int x, int y, QRgb q);
81 
83 extern void setPixelRGB32 (QImage &image32Bit, int x, int y, QRgb q);
84 
85 #endif // MM_SUBS_H
QRgb pixelRGB8(const QImage &image8Bit, int x, int y)
Get pixel method for 8 bit depth.
Definition: mmsubs.cpp:195
void setPixelRGB32(QImage &image32Bit, int x, int y, QRgb q)
Set pixel method for 32 bit depth.
Definition: mmsubs.cpp:330
void projectPointOntoLine(double xToProject, double yToProject, double xStart, double yStart, double xStop, double yStop, double *xProjection, double *yProjection, double *projectedDistanceOutsideLine, double *distanceToLine)
Find the projection of a point onto a line segment such that the line through the point and its proje...
Definition: mmsubs.cpp:211
void setPixelRGB(QImage &image, int x, int y, QRgb q)
Set pixel method for any bit depth.
Definition: mmsubs.cpp:281
QRgb pixelRGB(const QImage &image, int x, int y)
Get pixel method for any bit depth.
Definition: mmsubs.cpp:169
void ellipseFromParallelogram(double xTL, double yTL, double xTR, double yTR, double xBR, double yBR, double &angleRadians, double &aAligned, double &bAligned)
Calculate ellipse parameters that is incribed in a parallelogram centered at the origin, given three successive corners of that parallelogram.
Definition: mmsubs.cpp:52
QRgb pixelRGB32(const QImage &image32Bit, int x, int y)
Get pixel method for 32 bit depth.
Definition: mmsubs.cpp:201
void setPixelRGB8(QImage &image8Bit, int x, int y, QRgb q)
Set pixel method for 8 bit depth.
Definition: mmsubs.cpp:319
double angleBetweenVectors(const QPointF &v1, const QPointF &v2)
Angle between two vectors. Direction is unimportant, so result is between 0 to pi radians...
Definition: mmsubs.cpp:15
QRgb pixelRGB1(const QImage &image1Bit, int x, int y)
Get pixel method for one bit depth.
Definition: mmsubs.cpp:182
double angleFromVectorToVector(const QPointF &vFrom, const QPointF &vTo)
Angle between two vectors. Direction is positive when rotation is about +z vector, so result is betwen -pi to pi radians.
Definition: mmsubs.cpp:32
void setPixelRGB1(QImage &image1Bit, int x, int y, QRgb q)
Set pixel method for one bit depth.
Definition: mmsubs.cpp:297