1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-22 10:20:47 +01:00

Compare commits

..

No commits in common. "32262e7c46dff6ea8a4d2d50c84e17384056f6e3" and "cdb2fd0284d4533d9a597e1ef2521524e9513e8f" have entirely different histories.

7 changed files with 44 additions and 11 deletions

View File

@ -1,4 +1,4 @@
version: 13.17.{build} version: 13.16.{build}
configuration: configuration:
- Release - Release

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else { } else {
TARGET = GPXSee TARGET = GPXSee
} }
VERSION = 13.17 VERSION = 13.16
QT += core \ QT += core \

View File

@ -37,7 +37,7 @@ Unicode true
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "13.17" !define VERSION "13.16"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -27,7 +27,7 @@ public:
const Data &data) : _tag(tag), _subFields(subFields), _data(data) {} const Data &data) : _tag(tag), _subFields(subFields), _data(data) {}
const QByteArray &tag() const {return _tag;} const QByteArray &tag() const {return _tag;}
const QVector<QByteArray> &subFields() const {return _subFields;} const QVector<QByteArray> subFields() const {return _subFields;}
const Data &data() const {return _data;} const Data &data() const {return _data;}
bool subfield(const char *name, int *val, int idx = 0) const; bool subfield(const char *name, int *val, int idx = 0) const;

View File

@ -3,11 +3,33 @@
#define abs(x) ((x)<0 ? -(x) : (x)) #define abs(x) ((x)<0 ? -(x) : (x))
Matrix::~Matrix()
{
delete[] _m;
}
Matrix::Matrix(size_t h, size_t w) Matrix::Matrix(size_t h, size_t w)
{ {
_h = h; _h = h; _w = w;
_w = w;
_m.resize(_h * _w); if (isNull())
_m = 0;
else
_m = new double[_h * _w];
}
Matrix::Matrix(const Matrix& M)
{
_h = M._h; _w = M._w;
if (isNull())
_m = 0;
else
_m = new double[_h * _w];
for (size_t i = 0; i < _h; i++)
for (size_t j = 0; j < _w; j++)
m(i,j) = M.m(i,j);
} }
bool Matrix::eliminate(double epsilon) bool Matrix::eliminate(double epsilon)
@ -65,6 +87,12 @@ Matrix Matrix::augemented(const Matrix &M) const
return A; return A;
} }
void Matrix::zeroize()
{
for (size_t i = 0; i < _h * _w; i++)
_m[i] = 0;
}
#ifndef QT_NO_DEBUG #ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Matrix &matrix) QDebug operator<<(QDebug dbg, const Matrix &matrix)
{ {

View File

@ -3,27 +3,29 @@
#include <cstddef> #include <cstddef>
#include <cfloat> #include <cfloat>
#include <QVector>
#include <QDebug> #include <QDebug>
class Matrix class Matrix
{ {
public: public:
Matrix() {_h = 0; _w = 0;} Matrix() {_h = 0; _w = 0; _m = 0;}
Matrix(size_t h, size_t w); Matrix(size_t h, size_t w);
Matrix(const Matrix& M);
~Matrix();
size_t h() const {return _h;} size_t h() const {return _h;}
size_t w() const {return _w;} size_t w() const {return _w;}
double &m(size_t i, size_t j) {return _m[_w * i + j];} double &m(size_t i, size_t j) {return _m[_w * i + j];}
double const &m(size_t i, size_t j) const {return _m.at(_w * i + j);} double const &m(size_t i, size_t j) const {return _m[_w * i + j];}
bool isNull() const {return (_h == 0 || _w == 0);} bool isNull() const {return (_h == 0 || _w == 0);}
void zeroize();
bool eliminate(double epsilon = DBL_EPSILON); bool eliminate(double epsilon = DBL_EPSILON);
Matrix augemented(const Matrix &M) const; Matrix augemented(const Matrix &M) const;
private: private:
QVector<double> _m; double *_m;
size_t _h; size_t _h;
size_t _w; size_t _w;
}; };

View File

@ -23,6 +23,7 @@ void Transform::simple(const ReferencePoint &p1, const ReferencePoint &p2)
void Transform::affine(const QList<ReferencePoint> &points) void Transform::affine(const QList<ReferencePoint> &points)
{ {
Matrix c(3, 2); Matrix c(3, 2);
c.zeroize();
for (size_t i = 0; i < c.h(); i++) { for (size_t i = 0; i < c.h(); i++) {
for (size_t j = 0; j < c.w(); j++) { for (size_t j = 0; j < c.w(); j++) {
for (int k = 0; k < points.size(); k++) { for (int k = 0; k < points.size(); k++) {
@ -39,6 +40,7 @@ void Transform::affine(const QList<ReferencePoint> &points)
} }
Matrix Q(3, 3); Matrix Q(3, 3);
Q.zeroize();
for (int qi = 0; qi < points.size(); qi++) { for (int qi = 0; qi < points.size(); qi++) {
double v[3]; double v[3];
@ -61,6 +63,7 @@ void Transform::affine(const QList<ReferencePoint> &points)
_img2proj = _proj2img.inverted(); _img2proj = _proj2img.inverted();
} }
Transform::Transform() Transform::Transform()
: _proj2img(NULL_QTRANSFORM), _img2proj(NULL_QTRANSFORM) : _proj2img(NULL_QTRANSFORM), _img2proj(NULL_QTRANSFORM)
{ {