qt-correction-tool/hgdev/PaperSize.h

46 lines
909 B
C++

#ifndef PAPER_SIZE_H
#define PAPER_SIZE_H
#include <map>
#ifdef WIN32
#include <Windows.h>
#endif
#include "sane_common.h"
#include <predefine.h>
typedef unsigned long DWORD;
typedef long LONG;
typedef struct Paper_Status {
unsigned int Paper;
unsigned int Orentate;
friend bool operator<(const struct Paper_Status& a, const struct Paper_Status& b) {
if (a.Paper < b.Paper ||
(a.Paper == b.Paper && a.Orentate < b.Orentate)) {
return true;
}
return false;
}
}PaperStatus;
namespace Device {
class PaperSize
{
public:
PaperSize();
~PaperSize();
private:
void InitPaperMap();
std::map<std::pair<TwSS, float>, hgsize> dpiDct;
std::map<TwSS, hgsize> dpiDct_100;
std::map<TwSS, hgsize> dpiDct_400;
std::map<TwSS, hgsize> dpiDct_300;
public:
hgsize GetPaperSize(DWORD paperType, float dpi, int orentation,ScannerSerial serial);
};
}
#endif