📄 artpec.h
字号:
/* * Copyright (c) 2002-2007 Axis Communications AB * */#ifndef __ARTPEC_H__#define __ARTPEC_H__#ifdef __KERNEL__#include <linux/time.h>#else#include <sys/time.h>#endif#define ARTPEC_MAGIC 42/* asynchronous read */#define ASYNC_INFO_SIZE 220struct async_request { char *image_buffer; /* the buffer to hold the image */ unsigned int buffer_length; /* length of the above buffer */ int image_size; /* resulting length, * * 0 if the image is not ready * * -1 image buffer to small */ struct timeval user_time; /* the user time when the image was made */ struct timeval unit_time; /* the unit time when the image was made */ unsigned char invalid_time; /* 1 if time is invalid, else 0 */ unsigned long id; /* A monotonically increasing ID number */ unsigned long conf_timestamp; /* A timestamp that is updated if the * parameters affecting the image size * have been modified. */ unsigned char profile_level; /* The MPEG-4 Profile@Level if applicable. */ unsigned char vop_coding_type; /* The type of the MPEG-4 image (IPB) */ struct timeval timestamp; /* The time the image was taken */ unsigned int headers; /* Which MPEG-4 headers are present */};#define CAM_IOC_ASYNC_READ _IOR(ARTPEC_MAGIC, 0x01, struct async_request*)/* read elementary stream configuration (MPEG-4) */#define CAM_IOC_GET_ES_CONFIG _IOR(ARTPEC_MAGIC, 0x02, unsigned char*)/* upload chip program */struct chip_program { char *data; /* pointer to the program data */ unsigned int size; /* size of the progam data */};#define CAM_IOC_UPLOAD_PROGRAM _IOW(ARTPEC_MAGIC, 0x0a, struct chip_program*)/* new image (don't use the same image twice, always enabled as default) */#define CAM_IOC_SET_NEW_IMAGE_ENABLED _IOW(ARTPEC_MAGIC, 0x0f, unsigned char)/* image parameters */typedef enum { IMAGE_RESOLUTION_HUGESIZE = 0, IMAGE_RESOLUTION_4CIF = 0, IMAGE_RESOLUTION_704x576 = 0, IMAGE_RESOLUTION_704x480 = 0, IMAGE_RESOLUTION_VGA = 0, IMAGE_RESOLUTION_640x480 = 0, IMAGE_RESOLUTION_FULLSIZE = 1, IMAGE_RESOLUTION_CIF = 1, IMAGE_RESOLUTION_352x288 = 1, IMAGE_RESOLUTION_352x240 = 1, IMAGE_RESOLUTION_320x240 = 1, IMAGE_RESOLUTION_HALFSIZE = 2, IMAGE_RESOLUTION_QCIF = 2, IMAGE_RESOLUTION_176x144 = 2, IMAGE_RESOLUTION_176x120 = 2, IMAGE_RESOLUTION_160x120 = 2, IMAGE_RESOLUTION_FIELDSIZE = 3, IMAGE_RESOLUTION_2CIF = 3, IMAGE_RESOLUTION_704x288 = 3, IMAGE_RESOLUTION_704x240 = 3, IMAGE_RESOLUTION_FIELDSIZE_EXPANDED = 4, IMAGE_RESOLUTION_2CIF_EXPANDED = 4, IMAGE_RESOLUTION_704x288x2 = 4, IMAGE_RESOLUTION_704x240x2 = 4} image_resolution_type;typedef enum { IMAGE_ROTATION_0 = 0, IMAGE_ROTATION_180 = 1, IMAGE_ROTATION_90 = 2, IMAGE_ROTATION_270 = 3} image_rotation_type;typedef enum { IMAGE_TEXT_POSITION_TOP = 0, IMAGE_TEXT_POSITION_BOTTOM = 1} image_text_position_type;typedef enum { IMAGE_TEXT_COLOR_WHITE = 0, IMAGE_TEXT_COLOR_BLACK = 1, IMAGE_TEXT_COLOR_TRANSPARENT = 2, IMAGE_TEXT_COLOR_SEMITRANSPARENT = 3} image_text_color_type;#define IMAGE_TEXT_MAX_SIZE 128#define NBR_OF_MASKS 3typedef enum { PRIVACY_MASK_COLOR_BLACK = 0, PRIVACY_MASK_COLOR_GREY = 1, PRIVACY_MASK_COLOR_WHITE = 2, PRIVACY_MASK_COLOR_RED = 3} privacy_mask_color_type;/* Defines a single privacy mask */struct privacy_mask { unsigned char enabled; unsigned int x; unsigned int y; unsigned int width; unsigned int height;};/* Defines a set of masks. */struct privacy_masks { unsigned int active_masks; /* Number if active masks */ privacy_mask_color_type color; /* Color of the privacy masks */ struct privacy_mask mask[NBR_OF_MASKS]; /* Mask dimensions */};struct image_param { image_resolution_type resolution; unsigned char square_pixel_enabled; unsigned int compression; unsigned char color_enabled; image_rotation_type rotation; unsigned char mirror_enabled; unsigned char scale_enabled; unsigned int scale_width; unsigned int scale_height; unsigned int mpeg_width; unsigned int mpeg_height; unsigned char crop_enabled; unsigned int crop_x; unsigned int crop_y; unsigned int crop_width; unsigned int crop_height; unsigned char overlay_enabled; unsigned int overlay_x; unsigned int overlay_y; unsigned char text_enabled; image_text_position_type text_position; image_text_color_type text_color; image_text_color_type text_bgcolor; char text_string[IMAGE_TEXT_MAX_SIZE]; struct timeval frame_delay; /* Privacy mask parameters */ struct privacy_masks masks; /* These are ignored by the driver. They are only here to make it * easier for the user mode applications to create the text_string. */ unsigned char template_text_enabled; unsigned char template_date_enabled; unsigned char template_time_enabled; char template_text_format[IMAGE_TEXT_MAX_SIZE]; char template_date_format[IMAGE_TEXT_MAX_SIZE]; char template_time_format[IMAGE_TEXT_MAX_SIZE]; /* This should be the combined version of the three strings above. */ char template_text_string[IMAGE_TEXT_MAX_SIZE]; /* These are controlled by the driver and trying to change them from * user space will have no effect. */ unsigned int image_width; unsigned int image_height;};/* get dynamic/default image parameters */#define CAM_IOC_GET_MPEG_WIDTH _IO(ARTPEC_MAGIC, 0x0e)#define CAM_IOC_GET_MPEG_HEIGHT _IO(ARTPEC_MAGIC, 0x0f)#define CAM_IOC_GET_IMAGE_PARAMS _IOR(ARTPEC_MAGIC, 0x10, struct image_param*)#define CAM_IOC_GET_IMAGE_WIDTH _IO(ARTPEC_MAGIC, 0x11)#define CAM_IOC_GET_IMAGE_HEIGHT _IO(ARTPEC_MAGIC, 0x12)#define CAM_IOC_GET_IMAGE_SIZE _IO(ARTPEC_MAGIC, 0x13)#define CAM_IOC_GET_DEFAULT _IOR(ARTPEC_MAGIC, 0x14, struct image_param*)#define CAM_IOC_GET_DEFAULT_WIDTH _IO(ARTPEC_MAGIC, 0x15)#define CAM_IOC_GET_DEFAULT_HEIGHT _IO(ARTPEC_MAGIC, 0x16)#define CAM_IOC_GET_DEFAULT_SIZE _IO(ARTPEC_MAGIC, 0x17)/* set dynamic image parameters */#define CAM_IOC_SET_DEFAULT _IO(ARTPEC_MAGIC, 0x20)#define CAM_IOC_SET_IMAGE_PARAMS _IOW(ARTPEC_MAGIC, 0x21, struct image_param*)#define CAM_IOC_SET_RESOLUTION _IOW(ARTPEC_MAGIC, 0x22, image_resolution_type)#define CAM_IOC_SET_SQUARE_PIXEL_ENABLED _IOW(ARTPEC_MAGIC, 0x23, unsigned char)#define CAM_IOC_SET_COMPRESSION _IOW(ARTPEC_MAGIC, 0x24, unsigned int)#define CAM_IOC_SET_COLOR_ENABLED _IOW(ARTPEC_MAGIC, 0x25, unsigned char)#define CAM_IOC_SET_ROTATION _IOW(ARTPEC_MAGIC, 0x26, image_rotation_type)#define CAM_IOC_SET_SCALE_ENABLED _IOW(ARTPEC_MAGIC, 0x27, unsigned char)#define CAM_IOC_SET_SCALE_WIDTH _IOW(ARTPEC_MAGIC, 0x28, unsigned int)#define CAM_IOC_SET_SCALE_HEIGHT _IOW(ARTPEC_MAGIC, 0x29, unsigned int)#define CAM_IOC_SET_CROP_ENABLED _IOW(ARTPEC_MAGIC, 0x2a, unsigned char)#define CAM_IOC_SET_CROP_X_POSITION _IOW(ARTPEC_MAGIC, 0x2b, unsigned int)#define CAM_IOC_SET_CROP_Y_POSITION _IOW(ARTPEC_MAGIC, 0x2c, unsigned int)#define CAM_IOC_SET_CROP_WIDTH _IOW(ARTPEC_MAGIC, 0x2d, unsigned int)#define CAM_IOC_SET_CROP_HEIGHT _IOW(ARTPEC_MAGIC, 0x2e, unsigned int)#define CAM_IOC_SET_MIRROR_ENABLED _IOW(ARTPEC_MAGIC, 0x2f, unsigned char)#define CAM_IOC_SET_TEXT_ENABLED _IOW(ARTPEC_MAGIC, 0x30, unsigned char)#define CAM_IOC_SET_TEXT_STRING _IOW(ARTPEC_MAGIC, 0x31, char*)#define CAM_IOC_SET_TEXT_COLOR _IOW(ARTPEC_MAGIC, 0x32, image_text_color_type)#define CAM_IOC_SET_TEXT_BG_COLOR _IOW(ARTPEC_MAGIC, 0x33, image_text_color_type)#define CAM_IOC_SET_TEXT_POSITION _IOW(ARTPEC_MAGIC, 0x34, image_text_position_type)#define CAM_IOC_SET_OVERLAY_ENABLED _IOW(ARTPEC_MAGIC, 0x35, unsigned char)#define CAM_IOC_SET_OVERLAY_X_POSITION _IOW(ARTPEC_MAGIC, 0x36, unsigned int)#define CAM_IOC_SET_OVERLAY_Y_POSITION _IOW(ARTPEC_MAGIC, 0x37, unsigned int)#define CAM_IOC_SET_FRAME_DELAY _IOW(ARTPEC_MAGIC, 0x38, struct timeval*)/* set default values for dynamic image parameters */#define CAM_IOC_DEFAULT_IMAGE_PARAMS _IOW(ARTPEC_MAGIC, 0x41, struct image_param*)#define CAM_IOC_DEFAULT_RESOLUTION _IOW(ARTPEC_MAGIC, 0x42, image_resolution_type)#define CAM_IOC_DEFAULT_SQUARE_PIXEL_ENABLED _IOW(ARTPEC_MAGIC, 0x43, unsigned char)#define CAM_IOC_DEFAULT_COMPRESSION _IOW(ARTPEC_MAGIC, 0x44, unsigned int)#define CAM_IOC_DEFAULT_COLOR_ENABLED _IOW(ARTPEC_MAGIC, 0x45, unsigned char)#define CAM_IOC_DEFAULT_ROTATION _IOW(ARTPEC_MAGIC, 0x46, image_rotation_type)#define CAM_IOC_DEFAULT_SCALE_ENABLED _IOW(ARTPEC_MAGIC, 0x47, unsigned char)#define CAM_IOC_DEFAULT_SCALE_WIDTH _IOW(ARTPEC_MAGIC, 0x48, unsigned int)#define CAM_IOC_DEFAULT_SCALE_HEIGHT _IOW(ARTPEC_MAGIC, 0x49, unsigned int)#define CAM_IOC_DEFAULT_CROP_ENABLED _IOW(ARTPEC_MAGIC, 0x4a, unsigned char)#define CAM_IOC_DEFAULT_CROP_X_POSITION _IOW(ARTPEC_MAGIC, 0x4b, unsigned int)#define CAM_IOC_DEFAULT_CROP_Y_POSITION _IOW(ARTPEC_MAGIC, 0x4c, unsigned int)#define CAM_IOC_DEFAULT_CROP_WIDTH _IOW(ARTPEC_MAGIC, 0x4d, unsigned int)#define CAM_IOC_DEFAULT_CROP_HEIGHT _IOW(ARTPEC_MAGIC, 0x4e, unsigned int)#define CAM_IOC_DEFAULT_MIRROR_ENABLED _IOW(ARTPEC_MAGIC, 0x4f, unsigned char)#define CAM_IOC_DEFAULT_TEXT_ENABLED _IOW(ARTPEC_MAGIC, 0x50, unsigned char)#define CAM_IOC_DEFAULT_TEXT_STRING _IOW(ARTPEC_MAGIC, 0x51, char*)#define CAM_IOC_DEFAULT_TEXT_COLOR _IOW(ARTPEC_MAGIC, 0x52, image_text_color_type)#define CAM_IOC_DEFAULT_TEXT_BG_COLOR _IOW(ARTPEC_MAGIC, 0x53, image_text_color_type)#define CAM_IOC_DEFAULT_TEXT_POSITION _IOW(ARTPEC_MAGIC, 0x54, image_text_position_type)#define CAM_IOC_DEFAULT_OVERLAY_ENABLED _IOW(ARTPEC_MAGIC, 0x55, unsigned char)#define CAM_IOC_DEFAULT_OVERLAY_X_POSITION _IOW(ARTPEC_MAGIC, 0x56, unsigned int)#define CAM_IOC_DEFAULT_OVERLAY_Y_POSITION _IOW(ARTPEC_MAGIC, 0x57, unsigned int)#define CAM_IOC_DEFAULT_FRAME_DELAY _IOW(ARTPEC_MAGIC, 0x58, struct timeval*)/* upload image overlay */struct image_overlay { char *data; /* pointer to the image overlay data */ unsigned int size; /* size of the image overlay data */};#define CAM_IOC_UPLOAD_OVERLAY _IOW(ARTPEC_MAGIC, 0x60, struct image_overlay*)/* image header */#define IMAGE_HEADER_MAX_COMMENT_SIZE 256struct image_header_param { unsigned char jfif_enabled; unsigned char product_info_enabled; unsigned char time_stamp_enabled; unsigned char time_invalid_enabled; unsigned char crc_enabled; unsigned char image_param_enabled; unsigned char comment_size; unsigned char comment[IMAGE_HEADER_MAX_COMMENT_SIZE]; unsigned char trigger_data_size; unsigned char trigger_data[IMAGE_HEADER_MAX_COMMENT_SIZE];};#define CAM_IOC_SET_HEADER_PARAMS _IOW(ARTPEC_MAGIC, 0x70, struct image_header_param*)#define CAM_IOC_GET_HEADER_PARAMS _IOR(ARTPEC_MAGIC, 0x71, struct image_header_param*)#define CAM_IOC_HEADER_JFIF_ENABLED _IOW(ARTPEC_MAGIC, 0x72, unsigned char)#define CAM_IOC_HEADER_PRODUCT_INFO_ENABLED _IOW(ARTPEC_MAGIC, 0x73, unsigned char)#define CAM_IOC_HEADER_TIME_STAMP_ENABLED _IOW(ARTPEC_MAGIC, 0x74, unsigned char)#define CAM_IOC_HEADER_INVALID_TIME_ENABLED _IOW(ARTPEC_MAGIC, 0x75, unsigned char)#define CAM_IOC_HEADER_CRC_ENABLED _IOW(ARTPEC_MAGIC, 0x76, unsigned char)#define CAM_IOC_HEADER_IMAGE_PARAMS_ENABLED _IOW(ARTPEC_MAGIC, 0x77, unsigned char)#define CAM_IOC_HEADER_COMMENT_SIZE _IOW(ARTPEC_MAGIC, 0x78, unsigned char)#define CAM_IOC_HEADER_COMMENT _IOW(ARTPEC_MAGIC, 0x79, unsigned char*)/* product info */struct image_product_info_param { unsigned short hwid; unsigned short version; unsigned char build; unsigned int serno;};#define CAM_IOC_SET_PRODUCT_INFO_PARAMS _IOW(ARTPEC_MAGIC, 0x7a, struct image_product_info_param*)#define CAM_IOC_GET_PRODUCT_INFO_PARAMS _IOR(ARTPEC_MAGIC, 0x7b, struct image_product_info_param*)/* trigger data */#define CAM_IOC_HEADER_TRIGGER_DATA_SIZE _IOW(ARTPEC_MAGIC, 0x7c, unsigned char)#define CAM_IOC_HEADER_TRIGGER_DATA _IOW(ARTPEC_MAGIC, 0x7d, unsigned char*)/* hardware specific */#define IMAGE_DRIVER_VIDEO 0#define IMAGE_DRIVER_SENSOR 1#define CAM_IOC_GET_DRIVER_TYPE _IO(ARTPEC_MAGIC, 0x80)#define CAM_IOC_GET_NBR_OF_CAMERAS _IO(ARTPEC_MAGIC, 0x81)#define CAM_IOC_GET_NBR_OF_CONFIGS _IO(ARTPEC_MAGIC, 0x82)/* Image Sensor CCD/CMOS (only available in CCD/CMOS Driver) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -