Engauge Digitizer 2
Loading...
Searching...
No Matches
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
12class QImage;
13class QPointF;
14
16extern double angleBetweenVectors (const QPointF &v1,
17 const QPointF &v2);
18
20extern double angleFromVectorToVector (const QPointF &vFrom,
21 const QPointF &vTo);
22
26extern 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
37extern QRgb pixelRGB (const QImage &image, int x, int y);
38
40extern QRgb pixelRGB1 (const QImage &image1Bit, int x, int y);
41
43extern QRgb pixelRGB8 (const QImage &image8Bit, int x, int y);
44
46extern QRgb pixelRGB32 (const QImage &image32Bit, int x, int y);
47
62extern 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,
71 double *distanceToLine);
72
74extern void setPixelRGB (QImage &image, int x, int y, QRgb q);
75
77extern void setPixelRGB1 (QImage &image1Bit, int x, int y, QRgb q);
78
80extern void setPixelRGB8 (QImage &image8Bit, int x, int y, QRgb q);
81
83extern void setPixelRGB32 (QImage &image32Bit, int x, int y, QRgb q);
84
85#endif // MM_SUBS_H
const int INNER_RADIUS_MIN
QRgb pixelRGB8(const QImage &image8Bit, int x, int y)
Get pixel method for 8 bit depth.
Definition mmsubs.cpp:195
double angleFromVectorToVector(const QPointF &vFrom, const QPointF &vTo)
Angle between two vectors. Direction is positive when rotation is about +z vector,...
Definition mmsubs.cpp:32
QRgb pixelRGB32(const QImage &image32Bit, int x, int y)
Get pixel method for 32 bit depth.
Definition mmsubs.cpp:201
QRgb pixelRGB(const QImage &image, int x, int y)
Get pixel method for any bit depth.
Definition mmsubs.cpp:169
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
void setPixelRGB(QImage &image, int x, int y, QRgb q)
Set pixel method for any bit depth.
Definition mmsubs.cpp:281
void setPixelRGB1(QImage &image1Bit, int x, int y, QRgb q)
Set pixel method for one bit depth.
Definition mmsubs.cpp:297
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 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,...
Definition mmsubs.cpp:52
QRgb pixelRGB1(const QImage &image1Bit, int x, int y)
Get pixel method for one bit depth.
Definition mmsubs.cpp:182
void setPixelRGB32(QImage &image32Bit, int x, int y, QRgb q)
Set pixel method for 32 bit depth.
Definition mmsubs.cpp:330