-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeoCalculator.h
38 lines (29 loc) · 1.03 KB
/
GeoCalculator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef GEO_CALCULATOR_H
#define GEO_CALCULATOR_H
#include <iostream>
#include <Magick++.h>
#include <cstdio>
#include <cstring>
using namespace Magick;
class GeoCalculator {
private:
char inputSize[21];
double tolerance;
int geoWidth;
int geoHeight;
double maxRatio;
double minRatio;
void parseInputSize(const char mode, const char *inputSize);
//int calcSize(int size, double ratio);
void setWidthOption(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
void setHeightOption(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
void setFixedOption(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
void setMobileOption(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
void setAutoOption(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
void setNoresize(Image *&image, Geometry &imgGeo, Geometry &pageGeo);
public:
GeoCalculator(double tolerance);
~GeoCalculator();
void calcGeo(Geometry &imgGeo, Geometry &pageGeo, Image *&image, char &mode, char *&inputSize);
};
#endif // GEO_CALCULATOR_H