speedcontroller/3rdparty/nick/common.h

281 lines
6.0 KiB
C

#ifndef COMMON_H
#define COMMON_H
#ifdef __cplusplus
extern "C"{
#endif
typedef struct hg_tag_SIZE
{
long cx;
long cy;
}CSSIZE, *PCSSIZE, *LPCSSIZE;
typedef CSSIZE CSSIZEL;
typedef CSSIZE *PCSSIZEL, *LPCSSIZEL;
enum hg_tagUsbSupported
{
/*停止扫描**/
SCAN_STOP = -1,
/*异常******/
HAVE_ERROR = -2,
/*正常状态****/
NORMAL = 0,
/*开盖***/
OPEN_COVER = 1,
/*无纸****/
NO_FEED = 2,
/*搓纸失败****/
FEED_IN_ERROR = 4,
/**卡纸*****/
PAPER_JAM = 8,
/**检测到双张**/
DETECT_DOUBLE_FEED = 16,
/**检测到订书钉**/
DETECT_STAPLE = 32,
/*纸张倾斜******/
PAPER_SKEW = 64,
/**自动模式****/
AUTO_SCAN_MODE = 65,
/**手动模式****/
MANAUL_SCAN_MODE = 66,
/**计数模式****/
COUNT_MODE = 67,
/*硬件错误*****/
HARDWARE_ERROR = 68,
/*FPGA崩溃***/
FPGA_ERROR = 68,
/*开始******/
START_SCAN = 69,
/**停止*****/
STOP_SCAN = 70,
/**有图*****/
HAVE_IMAGE = 71,
/*更新扫描参数***/
UPDATE_SCAN_PARAMETER = 72,
/*PC繁忙或出错***/
PC_SCAN_BUSY_or_ERROR = 73,
/*USB链接断开***/
DEVICE_OFF_LINE = 74
};
typedef enum hg_tagUsbSupported tagUsbSupported;
enum hg_twSS
{
None = 0,
A4Letter = 1,
A4 = 1,
B5Letter = 2,
JISB5 = 2,
B5 = 2,
USLetter = 3,
USLegal = 4,
A5 = 5,
B4 = 6,
ISOB4 = 6,
B6 = 7,
ISOB6 = 7,
USLedger = 9,
USExecutive = 10,
A3 = 11,
B3 = 12,
ISOB3 = 12,
A6 = 13,
C4 = 14,
C5 = 15,
C6 = 16,
_4A0 = 17,
_2A0 = 18,
A0 = 19,
A1 = 20,
A2 = 21,
A7 = 22,
A8 = 23,
A9 = 24,
A10 = 25,
ISOB0 = 26,
ISOB1 = 27,
ISOB2 = 28,
ISOB5 = 29,
ISOB7 = 30,
ISOB8 = 31,
ISOB9 = 32,
ISOB10 = 33,
JISB0 = 34,
JISB1 = 35,
JISB2 = 36,
JISB3 = 37,
JISB4 = 38,
JISB6 = 39,
JISB7 = 40,
JISB8 = 41,
JISB9 = 42,
JISB10 = 43,
C0 = 44,
C1 = 45,
C2 = 46,
C3 = 47,
C7 = 48,
C8 = 49,
C9 = 50,
C10 = 51,
USStatement = 52,
BusinessCard = 53,
MaxSize = 54,
};
typedef enum hg_twSS TwSS;
enum hg_tagFrontBack
{
FRONT_PAGE = 0,
BACK_PAGE
};
typedef enum hg_tagFrontBack FRONTBACK;
enum hg_tagFilter
{
FILTER_RED,
FILTER_GREEN,
FILTER_BLUE,
FILTER_ALL,
FILTER_NONE,
ENHANCE_RED,
ENHANCE_GREEN,
ENHANCE_BLUE
};
typedef enum hg_tagFilter Filter;
enum hg_tagOrentations
{
ROTATE_NONE = 0,
ROTATE_90,
ROTATE_180,
ROTATE_270,
AUTOTEXT_DETECT
};
typedef enum hg_tagOrentations Orentations;
struct hg_tagOutHoleParam
{
int OutHole;
int OutHoleValue;/*1~50;*/
};
typedef struct hg_tagOutHoleParam OutHoleParams;
struct hg_tagCropRect
{
int enable;
int x; /*****自定义裁切区域左上角x坐标*/
int y; /*****自定义裁切区域左上角y坐标*/
int width; /*****自定义裁切区域宽度*******/
int height; /*****自定义裁切区域高度*******/
};
typedef struct hg_tagCropRect CropRect;
struct hg_tagCustomGamma
{
int isDefined;
unsigned char* table;
int tableLength;
};
typedef struct hg_tagCustomGamma CustomGamma;
enum hg_PaperAlign {
Rot0 = 0,
Rot270 = 3,
AutoTextOrientation = 5
};
typedef enum hg_PaperAlign PaperAlign;
enum hg_Multi_output {
Unused = -1,
All,
ColorGray,
ColorBw,
GrayBw
};
typedef enum hg_Multi_output Multi_output;
struct hg_tagImageProcessParams
{
int PixType; /*same as color*/
int DestResulution; /*same sa resulution*/
int NativeResulution; /*fixed 200 for now*/
int AutoDiscardBlank; /****跳过空白页通用****************/
int AutoDiscardBlankVince; /****跳过空白页(发票)***********************/
int IsDuplex; /*false:single*/
int IsFold; /*对折*/
int AutoDescrew;
int AutoCrop;
int FillBlackRect;
int Filter; /*decolor ,0:red 1:green 2:blue 3:none encolor 5:red 6:green 7:blue*/
OutHoleParams OutHoleParam;
int Orentation; /*0:none 1:90 2:180 3:270 4:auto*/
int BackRotate180;
int Brightness; /*1~255*/
int Contrast; /*1~7*/
float Gamma; /*0.1f~5.0f*/
int MultiOutRed;
int MultiOutputType;/*-1:none 0:all 1:COLORGRAY 2:COLORBW 3:GRAYBW*/
CropRect cropRect;
CustomGamma customGamma;/*****色调曲线**************/
int RefuseInflow;/*防止渗透**************************/
int ColorCorrection;/*色彩校正**/
int RemoveMorr; /**去除摩尔纹********/
int ErrorExtention; /**错误扩散*****************/
int TextureRemove;/****除网纹*******************/
int imageSharpen;/*0:none 1:sharpen 2:sharpen_more 3:blur 4:blur_more*/
int SplitImage;
int AnswerSheetFilter;
int NosieDetach;
int AutoDetctOrentation;
};
typedef struct hg_tagImageProcessParams ImageProcessParams;
enum hg_color_mode {
BW,
Gray,
Color
};
typedef enum hg_color_mode ColorMode;
struct hg_tagScanParams
{
int colorMode;/*2:color 1:gray 0:bw*/
int papertype;
PaperAlign paperAlign;
int Resolution;/*fixed 200 for now*/
int UltrasonicDetect;/*double check*/
int BindingDetect;/*staple check*/
int ScrewDetect;
int ScrewTopLevel;/*1-5,1 easiest*/
int ScanCount;/*1-500*/
ImageProcessParams ImageProcessParam;
};
typedef struct hg_tagScanParams ScanParam;
struct hg_tagImageInfo
{
int Width;
int Height;
int bpp;
};
typedef struct hg_tagImageInfo ImageInfo;
enum hg_sharpenType
{
SharpenNone,
Sharpen, /*********锐化**********************/
SharpenMore, /*********进一步锐化*****************/
Blur, /*********模糊*********************/
BlurMore /*********进一步模糊***************/
};
typedef enum hg_sharpenType ImageSharpen;
#ifdef __cplusplus
}
#endif
#endif