103 lines
2.1 KiB
C++
103 lines
2.1 KiB
C++
#pragma once
|
||
#include <string>
|
||
|
||
#define Color 3
|
||
|
||
typedef enum Scan_Mode
|
||
{
|
||
SM_GRAY,
|
||
SM_COLOR
|
||
} ScanMode;
|
||
|
||
const std::string ScanPaperTypes[] =
|
||
{
|
||
|
||
"A4",
|
||
"A3"
|
||
};
|
||
|
||
const int SPTSizes[] = {1728, 1632};
|
||
|
||
typedef enum Scan_Paper_Type
|
||
{
|
||
SPT_A4,
|
||
SPT_A3
|
||
}ScanPaperType;
|
||
|
||
#ifdef A3
|
||
|
||
// 图像像素值
|
||
#define IMG_HEIGHT 3600
|
||
#define IMG_WIDTH 2592 * 2
|
||
#define SPI_COLOR 0x04501003 //0x0cf01002, 0x04501003
|
||
#define SPI_GRAY 0x0cf01002
|
||
|
||
// 300 dpi 图像宽度像素值(目前仅为双面扫描,故尺寸为单面尺寸乘以2)
|
||
#define IMG_WIDTH_300DPI 3672 * 2
|
||
|
||
// 200 dpi 图像宽度像素值(目前仅为双面扫描,故尺寸为单面尺寸乘以2)
|
||
#define IMG_WIDTH_200DPI 2448 * 2
|
||
|
||
#define IMG_WIDTH_150DPI 1836 * 2
|
||
|
||
#define IMG_HEIGHT_200DPI IMG_HEIGHT
|
||
|
||
#define IMG_HEIGHT_300DPI IMG_HEIGHT * 1.5
|
||
|
||
#define IMG_HEIGHT_150DPI IMG_HEIGHT * 0.75
|
||
|
||
//原始图像相对于200dpi的倍数
|
||
#define IMG_W_RADIO 1
|
||
#define IMG_H_RADIO 1
|
||
#define FRAME_COUNT 4
|
||
|
||
|
||
#else
|
||
// 300 dpi 图像宽度像素值(目前仅为双面扫描,故尺寸为单面尺寸乘以2)
|
||
|
||
#define IMG_WIDTH_300DPI 2592 * 2
|
||
|
||
// 200 dpi 图像宽度像素值(目前仅为双面扫描,故尺寸为单面尺寸乘以2)
|
||
#define IMG_WIDTH_200DPI 1728 * 2
|
||
|
||
#define IMG_WIDTH_150DPI 1296 * 2
|
||
|
||
|
||
#define IMG_HEIGHT_200DPI 3600
|
||
|
||
#define IMG_HEIGHT_300DPI 4050
|
||
|
||
#define IMG_HEIGHT_150DPI 2025
|
||
|
||
//原始图像相对于200dpi 系数
|
||
#define IMG_W_RADIO 1/1.5
|
||
#define IMG_H_RADIO 1
|
||
|
||
// 图像像素值
|
||
|
||
|
||
|
||
|
||
#ifdef HAS_UV
|
||
// #define SPI_COLOR 0x03D81001
|
||
// #define SPI_GRAY 0x13001000
|
||
#define SPI_COLOR 0x05181001
|
||
#define SPI_GRAY 0x19501000
|
||
// 0x19501000, 0x05181001
|
||
#else
|
||
const int SPI_SP = 0x04b0;
|
||
const int SPI_SAMPLE = 256;
|
||
const int SPI_COLOR_MODE = SM_COLOR;
|
||
const int SCAN_PAPER_TYPE = SPT_A4;
|
||
#endif
|
||
|
||
const int IMG_HEIGHT = 12000;
|
||
const int IMG_V4L_WIDTH = SPTSizes[SCAN_PAPER_TYPE];
|
||
const int FRAME_COUNT = 3;
|
||
const int TEST_FRAME = 1;
|
||
const int TEST_ENABLE = 0;
|
||
const int LED_ENABLE = 1;
|
||
const bool SAVE_ENABLE = true;
|
||
|
||
#endif
|