win32 ver

This commit is contained in:
xinyang
2019-05-14 20:03:03 +08:00
parent 601bf2a510
commit 6980145e83
28 changed files with 13037 additions and 395 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
cmake-build-debug
build
.idea
tools/TrainCNN/.idea
tools/TrainCNN/__pycache__

View File

@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(AutoAim)
SET(CMAKE_CXX_STANDARD 11)
@@ -11,6 +11,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPATH=\"\\\"${PROJECT_SOURCE_DIR}\\\"\"
## 固定使用相机运行
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRUN_WITH_CAMERA")
SET(BIN_NAME "run")
FIND_PROGRAM(CCACHE_FOUND ccache)
IF(CCACHE_FOUND)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
@@ -19,21 +21,16 @@ IF(CCACHE_FOUND)
ENDIF()
FIND_PACKAGE(OpenCV 3 REQUIRED)
FIND_PACKAGE(Eigen3 REQUIRED)
FIND_PACKAGE(Threads)
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
INCLUDE_DIRECTORIES("C:\\Applications\\eigen3")
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/energy/include)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/armor/include)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/others/include)
FILE(GLOB_RECURSE sourcefiles "others/src/*.cpp" "energy/src/*cpp" "armor/src/*.cpp")
ADD_EXECUTABLE(run main.cpp ${sourcefiles} )
ADD_EXECUTABLE(${BIN_NAME} main.cpp ${sourcefiles} )
TARGET_LINK_LIBRARIES(run ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(run ${OpenCV_LIBS})
TARGET_LINK_LIBRARIES(run ${PROJECT_SOURCE_DIR}/others/libMVSDK.so)
ADD_CUSTOM_TARGET(train COMMAND "gnome-terminal" "-x" "bash" "-c" "\"${PROJECT_SOURCE_DIR}/tools/TrainCNN/backward.py\"" )
ADD_CUSTOM_TARGET(bind-monitor COMMAND "${PROJECT_SOURCE_DIR}/tools/bind-monitor.sh" "${PROJECT_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")
TARGET_LINK_LIBRARIES(${BIN_NAME} ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(${BIN_NAME} ${OpenCV_LIBS})
TARGET_LINK_LIBRARIES(${BIN_NAME} "C:/Program\ Files\ (x86)/MindVision/SDK/X64/MVCAMSDK_X64.lib")

View File

@@ -7,7 +7,7 @@
#include <opencv2/core.hpp>
#include <opencv2/tracking.hpp>
#include <uart/uart.h>
#include <serial/serial.h>
#include <armor_finder/classifier/classifier.h>
typedef enum{
@@ -16,7 +16,7 @@ typedef enum{
class ArmorFinder{
public:
ArmorFinder(EnemyColor color, Uart &u, string paras_folder, const bool &use);
ArmorFinder(EnemyColor &color, Serial &u, string paras_folder, const bool &use);
~ArmorFinder() = default;
private:
@@ -26,7 +26,7 @@ private:
SEARCHING_STATE, TRACKING_STATE, STANDBY_STATE
} State;
EnemyColor enemy_color;
const EnemyColor &enemy_color;
State state;
cv::Rect2d armor_box;
cv::Ptr<cv::Tracker> tracker;
@@ -35,7 +35,7 @@ private:
Classifier classifier;
int contour_area;
Uart &uart;
Serial &serial;
const bool &use_classifier;
bool stateSearchingTarget(cv::Mat &src);
@@ -51,7 +51,7 @@ struct LightBlob {
double length;
explicit LightBlob(cv::RotatedRect &r) : rect(r) {
length = std::max(rect.size.height, rect.size.width);
length = max(rect.size.height, rect.size.width);
};
bool operator<(LightBlob &l2) { return this->rect.center.x < l2.rect.center.x; }
bool operator<=(LightBlob &l2) { return this->rect.center.x <= l2.rect.center.x; }

View File

@@ -1,15 +1,15 @@
//
// Created by xinyang on 19-3-27.
//
//#define LOG_LEVEL LOG_NONE
#define LOG_LEVEL LOG_NONE
#include <log.h>
#include <options/options.h>
#include <show_images/show_images.h>
#include <opencv2/highgui.hpp>
#include <armor_finder/armor_finder.h>
ArmorFinder::ArmorFinder(EnemyColor color, Uart &u, string paras_folder, const bool &use) :
uart(u),
ArmorFinder::ArmorFinder(EnemyColor &color, Serial &u, string paras_folder, const bool &use) :
serial(u),
enemy_color(color),
state(STANDBY_STATE),
classifier(std::move(paras_folder)),
@@ -62,16 +62,47 @@ void ArmorFinder::run(cv::Mat &src) {
#define FOCUS_PIXAL (600)
bool sendTarget(Serial& serial, double x, double y, double z) {
static short x_tmp, y_tmp, z_tmp;
static time_t last_time = time(nullptr);
static int fps;
uint8_t buff[8];
static SYSTEMTIME ts, te;
GetLocalTime(&te);
printf("Interval: %d\n", (te.wSecond - ts.wSecond) * 1000 + (te.wMilliseconds - ts.wMilliseconds));
ts = te;
time_t t = time(nullptr);
if (last_time != t) {
last_time = t;
cout << "fps:" << fps << ", (" << x << "," << y << "," << z << ")" << endl;
fps = 0;
}
fps += 1;
x_tmp = static_cast<short>(x * (32768 - 1) / 100);
y_tmp = static_cast<short>(y * (32768 - 1) / 100);
z_tmp = static_cast<short>(z * (32768 - 1) / 1000);
buff[0] = 's';
buff[1] = static_cast<char>((x_tmp >> 8) & 0xFF);
buff[2] = static_cast<char>((x_tmp >> 0) & 0xFF);
buff[3] = static_cast<char>((y_tmp >> 8) & 0xFF);
buff[4] = static_cast<char>((y_tmp >> 0) & 0xFF);
buff[5] = static_cast<char>((z_tmp >> 8) & 0xFF);
buff[6] = static_cast<char>((z_tmp >> 0) & 0xFF);
buff[7] = 'e';
return serial.WriteData(buff, sizeof(buff));
}
bool ArmorFinder::sendBoxPosition() {
static int dx_add = 0;
auto rect = armor_box;
double dx = rect.x + rect.width/2 - 320 - 8;
dx_add += dx;
dx = dx + dx_add * 0;
double dx = rect.x + rect.width/2 - 320;
double dy = rect.y + rect.height/2 - 240 - 30;
double yaw = atan(dx / FOCUS_PIXAL) * 180 / 3.14159265459;
double pitch = atan(dy / FOCUS_PIXAL) * 180 / 3.14159265459;
// cout << yaw << endl;
uart.sendTarget(yaw, -pitch, 0);
return true;
return sendTarget(serial, yaw, -pitch, 0);
}

View File

@@ -14,19 +14,19 @@
#include <sys/timeb.h>
#include "energy/constant.h"
#include "energy/param_struct_define.h"
#include "uart/uart.h"
#include "serial/serial.h"
using std::vector;
class Energy {
public:
Energy(Uart &u);
Energy(Serial &u, int &ally_color);
~Energy();
int run(cv::Mat &src);
cv::Point2f uart_hit_point;
clock_t start;
Uart &uart;
Serial &serial;
void setAllyColor(int color);
void setRotation(int rotation);
@@ -51,7 +51,7 @@ private:
double last_target_position;
double last_hit_position;
float target_armor;
int ally_color_;
int &ally_color_;
int energy_part_rotation;
float attack_distance;
int send_cnt;

View File

@@ -8,7 +8,7 @@ using std::cout;
using std::endl;
using std::vector;
Energy::Energy(Uart &u):uart(u),
Energy::Energy(Serial &u, int &ally_color):serial(u),ally_color_(ally_color),
src_blue(SRC_HEIGHT, SRC_WIDTH, CV_8UC1),
src_red(SRC_HEIGHT, SRC_WIDTH, CV_8UC1)
{

View File

@@ -13,48 +13,37 @@ extern float curr_yaw, curr_pitch, mark_yaw, mark_pitch;
void Energy::gimbleRotation(){
//该方法用于标定激光零点的情况,对操作手友好,但建立在云台稳定情况下
// yaw_rotation = static_cast<float>(180 / PI * atan2(-1*STRETCH*(hit_point.x-ZERO_POINT_X), ATTACK_DISTANCE));
// pitch_rotation = static_cast<float>(180 / PI * atan2((ATTACK_DISTANCE*tan(PITCH_ORIGIN_RAD)-STRETCH*(hit_point.y-ZERO_POINT_Y)), ATTACK_DISTANCE));
//该方法用于操作手自己完成对心工作的情况,对操作手要求高
cv::Point2f real_hit_point;
stretch(hit_point, real_hit_point);
// yaw_rotation = static_cast<float>(180 / PI * atan2((ATTACK_DISTANCE*tan(YAW_ORIGIN_RAD)-real_hit_point.x), ATTACK_DISTANCE));
// pitch_rotation = static_cast<float>(180 / PI * atan2((ATTACK_DISTANCE*tan(PITCH_ORIGIN_RAD)-real_hit_point.y), ATTACK_DISTANCE));
// yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
// pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
mark_yaw = -1.41;
mark_pitch = 12.79;
if(position_mode == 1){
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 2){
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 3){
yaw_rotation = -0.5+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
pitch_rotation = 1.5+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 4){
yaw_rotation = -2+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
pitch_rotation = 1+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 5){
yaw_rotation = -0.5+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
pitch_rotation = 0.5+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 6){
yaw_rotation = -1+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
pitch_rotation = 1+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else{
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_yaw*PI/180)-real_hit_point.x), attack_distance));
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 4){
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 5){
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
else if(position_mode == 6){
yaw_rotation = static_cast<float>(180 / PI * atan2((attack_distance * tan(mark_yaw * PI / 180) - real_hit_point.x), attack_distance));
pitch_rotation = static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
}
// else{
// pitch_rotation = 5.5+static_cast<float>(180 / PI * atan2((attack_distance*tan(mark_pitch*PI/180)-real_hit_point.y), attack_distance));
// }
// yaw_rotation = static_cast<float>(180 / PI * atan2((ATTACK_DISTANCE*tan(3.5*PI/180)-STRETCH*(hit_point.x-cycle_center.x)), ATTACK_DISTANCE));

View File

@@ -15,53 +15,50 @@ void Energy::getHitPoint(){
int limit_angle = 6;
int angle_interval = 60;
if(energy_part_rotation==1){ //顺时针
if(energy_part_rotation==1){
if(target_armor>=0 && target_armor<=limit_angle){
hit_point.x = cycle_center.x + static_cast<int>(radius / 2);
hit_point.y = cycle_center.y + static_cast<int>(radius * sqrt(3) / 2);
hit_position = -1*angle_interval;//-60
hit_position = -1*angle_interval;
position_mode = 1;
// cout<<"666"<<'\t'<<hit_position<<endl;
}
else if(target_armor>=angle_interval && target_armor<angle_interval+limit_angle){
hit_point.x = cycle_center.x + static_cast<int>(radius);
hit_point.y = cycle_center.y;
hit_position = 0;//0
hit_position = 0;
position_mode = 2;
}
else if(target_armor>=angle_interval*2 && target_armor<=angle_interval*2+limit_angle){
hit_point.x = cycle_center.x + static_cast<int>(radius / 2);
hit_point.y = cycle_center.y - static_cast<int>(radius * sqrt(3) / 2);
hit_position = angle_interval;//60
hit_position = angle_interval;
position_mode = 3;
}
else if(target_armor>=-180 && target_armor<-180+limit_angle){
hit_point.x = cycle_center.x - static_cast<int>(radius / 2);
hit_point.y = cycle_center.y - static_cast<int>(radius * sqrt(3) / 2);
hit_position = 2*angle_interval;//120
hit_position = 2*angle_interval;
position_mode = 4;
}
else if(target_armor>=-2*angle_interval&&target_armor<-2*angle_interval+limit_angle){
hit_point.x = cycle_center.x - static_cast<int>(radius);
hit_point.y = cycle_center.y;
hit_position = 180;//180
hit_position = 180;
position_mode = 5;
}
else if(target_armor>=-1*angle_interval&&target_armor<-1*angle_interval+limit_angle) {
hit_point.x = cycle_center.x - static_cast<int>(radius / 2);
hit_point.y = cycle_center.y + static_cast<int>(radius * sqrt(3) / 2);
hit_position = -2 * angle_interval;//-120
hit_position = -2 * angle_interval;
position_mode = 6;
}
else{
// last_hit_position = 2000;
position_mode = 0;
return;
}
}
if(energy_part_rotation==-1){ //逆时针
if(energy_part_rotation==-1){
if(target_armor>=0 && target_armor<=limit_angle){
hit_point.x = cycle_center.x - static_cast<int>(radius / 2);
hit_point.y = cycle_center.y - static_cast<int>(radius * sqrt(3) / 2);
@@ -99,55 +96,26 @@ void Energy::getHitPoint(){
position_mode = 6;
}
else{
// last_hit_position = 2000;
position_mode = 0;
return;
}
}
// cout<<"last: "<<last_position_mode<<'\t'<<"now: "<<position_mode<<endl;
if(position_mode!=0 && position_mode!=last_position_mode){
// last_hit_position = hit_position;
last_position_mode = position_mode;
isSendTarget = true;
cout<<"hit position: "<<hit_position<<endl;
return;
}
else if(position_mode == 0){
// last_hit_position = hit_position;
// last_position_mode = position_mode;
isSendTarget = false;
return;
}
else{
// last_hit_position = hit_position;
last_position_mode = position_mode;
isSendTarget = false;
return;
}
// if(hit_position>360&&last_hit_position>360){
// isSendTarget = false;
// return;
// }
// if(fabs(hit_position - last_hit_position) < 15||fabs(hit_position - last_hit_position) > 345 && fabs(hit_position - last_hit_position) <= 360){
// last_hit_position = hit_position;
// isSendTarget = false;
// return;
// }
// else{
// last_hit_position = hit_position;
// isSendTarget = true;
// cout<<"hit position: "<<hit_position<<endl;
// return;
// }
// double rad = static_cast<double>(energy_part_rotation * energy_part_param_.RPM
// * energy_part_param_.HIT_TIME * 360 / 60);
// rotate(rad, radius, cycle_center, target_center, hit_point);
}
bool Energy::changeTarget(){

View File

@@ -3,11 +3,41 @@
//
#include "energy/energy.h"
bool sendTarget(Serial& serial, float x, float y, float z) {
static short x_tmp, y_tmp, z_tmp;
static time_t last_time = time(nullptr);
static int fps;
uint8_t buff[8];
time_t t = time(nullptr);
if (last_time != t) {
last_time = t;
std::cout << "fps:" << fps << ", (" << x << "," << y << "," << z << ")" << std::endl;
fps = 0;
}
fps += 1;
x_tmp = static_cast<short>(x * (32768 - 1) / 100);
y_tmp = static_cast<short>(y * (32768 - 1) / 100);
z_tmp = static_cast<short>(z * (32768 - 1) / 1000);
buff[0] = 's';
buff[1] = static_cast<char>((x_tmp >> 8) & 0xFF);
buff[2] = static_cast<char>((x_tmp >> 0) & 0xFF);
buff[3] = static_cast<char>((y_tmp >> 8) & 0xFF);
buff[4] = static_cast<char>((y_tmp >> 0) & 0xFF);
buff[5] = static_cast<char>((z_tmp >> 8) & 0xFF);
buff[6] = static_cast<char>((z_tmp >> 0) & 0xFF);
buff[7] = 'e';
return serial.WriteData(buff, sizeof(buff));
}
void Energy::sendTargetByUart(float x, float y, float z) {
// if(!changeTarget()){
// return;
// }
uart.sendTarget(x, y, z);
sendTarget(serial, x, y, z);
send_cnt+=1;
}

View File

@@ -5,7 +5,7 @@
#include <opencv2/core/core.hpp>
#include <energy/energy.h>
#include <uart/uart.h>
#include <serial/serial.h>
#include <energy/param_struct_define.h>
#include <energy/constant.h>
#include <camera/camera_wrapper.h>
@@ -18,7 +18,6 @@
#define DO_NOT_CNT_TIME
#include <log.h>
#define PROJECT_DIR PATH
#define ENERGY_STATE 1
#define ARMOR_STATE 0
@@ -30,18 +29,20 @@ int state = ENERGY_STATE;
float curr_yaw = 0, curr_pitch = 0;
float mark_yaw = 0, mark_pitch = 0;
int mark = 0;
EnemyColor enemy_color = ENEMY_BLUE;
int ally_color = ALLY_RED;
bool use_classifier = true;
void uartReceive(Uart *uart);
void uartReceive(Serial *uart);
int main(int argc, char *argv[]) {
process_options(argc, argv);
Uart uart;
// thread receive(uartReceive, &uart);
Serial uart(3, 115200);
thread receive(uartReceive, &uart);
bool flag = true;
while (flag) {
int ally_color = ALLY_RED;
int energy_part_rotation = CLOCKWISE;
int from_camera = 1;
@@ -53,13 +54,13 @@ int main(int argc, char *argv[]) {
WrapperHead *video_armor;
WrapperHead *video_energy;
if (from_camera) {
video_armor = new CameraWrapper(0/*, "armor"*/);
// video_energy = new CameraWrapper(1, "energy");
video_armor = new CameraWrapper(0, "armor");
video_energy = new CameraWrapper(1, "energy");
} else {
video_armor = new VideoWrapper("/home/xinyang/Desktop/DataSets/video/blue_4.mp4");
video_energy = new VideoWrapper("/home/xinyang/Desktop/DataSets/video/blue_4.mp4");
}
if (video_armor->init()/* && video_energy->init()*/) {
if (video_armor->init() && video_energy->init()) {
cout << "Video source initialization successfully." << endl;
} else {
delete video_armor;
@@ -71,19 +72,19 @@ int main(int argc, char *argv[]) {
Mat energy_src, armor_src;
for(int i=0; i<10; i++){
video_armor->read(armor_src);
// video_energy->read(armor_src);
video_energy->read(armor_src);
}
ArmorFinder armorFinder(ENEMY_BLUE, uart, PROJECT_DIR"/tools/para/", use_classifier);
ArmorFinder armorFinder(enemy_color, uart, PROJECT_DIR"/tools/para/", use_classifier);
Energy energy(uart);
energy.setAllyColor(ally_color);
Energy energy(uart, ally_color);
// energy.setAllyColor(ally_color);
energy.setRotation(energy_part_rotation);
bool ok = video_armor->read(armor_src)/* && video_energy->read(armor_src)*/;
bool ok = video_armor->read(armor_src) && video_energy->read(armor_src);
while (ok) {
CNT_TIME(WORD_LIGHT_CYAN, "Total", {
CNT_TIME("Total", {
if (state == ENERGY_STATE) {
ok = video_energy->read(energy_src);
if (show_origin) {
@@ -95,10 +96,11 @@ int main(int argc, char *argv[]) {
energy.run(energy_src);
} else {
ok = video_armor->read(armor_src);
flip(armor_src, armor_src, 0);
if (show_origin) {
imshow("armor src", armor_src);
}
CNT_TIME(WORD_LIGHT_BLUE, "Armor Time", {
CNT_TIME("Armor Time", {
armorFinder.run(armor_src);
});
}
@@ -116,47 +118,65 @@ int main(int argc, char *argv[]) {
return 0;
}
#define RECEIVE_LOG_LEVEL LOG_MSG
#define RECEIVE_LOG_LEVEL LOG_NOTHING
void uartReceive(Uart *uart) {
char uartReadByte(Serial &uart) {
while (uart.GetBytesInCOM() == 0);
char byte;
if (uart.ReadData((uint8_t*)& byte, 1) == false) {
LOGE("serial error!");
}
return byte;
}
void uartReceive(Serial* uart) {
char buffer[100];
int cnt = 0;
LOGM("data receive start!");
while (true) {
char data;
while ((data = uart->receive()) != '\n') {
while ((data = uartReadByte(*uart)) != '\n') {
buffer[cnt++] = data;
if (cnt >= 100) {
// LOG(RECEIVE_LOG_LEVEL, "data receive over flow!");
LOG(RECEIVE_LOG_LEVEL, "data receive over flow!");
cnt = 0;
}
}
// LOGM("%d", cnt);
if (cnt == 11) {
LOGM("%d", cnt);
if (cnt == 12) {
if (buffer[8] == 'e') {
state = ENERGY_STATE;
// LOG(RECEIVE_LOG_LEVEL, "Energy state");
LOG(RECEIVE_LOG_LEVEL, "Energy state");
} else if (buffer[8] == 'a') {
state = ARMOR_STATE;
// LOG(RECEIVE_LOG_LEVEL, "Armor state");
LOG(RECEIVE_LOG_LEVEL, "Armor state");
}
if (buffer[10] == 0){
use_classifier = false;
// LOG(RECEIVE_LOG_LEVEL, "Classifier off!");
LOG(RECEIVE_LOG_LEVEL, "Classifier off!");
} else if(buffer[10] == 1){
use_classifier = true;
// LOG(RECEIVE_LOG_LEVEL, "Classifier on!");
LOG(RECEIVE_LOG_LEVEL, "Classifier on!");
}
if (buffer[11] == ENEMY_BLUE) {
LOG(RECEIVE_LOG_LEVEL, "ENEMY_BLUE!");
ally_color = ALLY_RED;
enemy_color = ENEMY_BLUE;
} else if (buffer[11] == ENEMY_RED) {
LOG(RECEIVE_LOG_LEVEL, "ENEMY_RED!");
ally_color = ALLY_BLUE;
enemy_color = ENEMY_RED;
}
memcpy(&curr_yaw, buffer, 4);
memcpy(&curr_pitch, buffer + 4, 4);
// LOG(RECEIVE_LOG_LEVEL, "Get yaw:%f pitch:%f", curr_yaw, curr_pitch);
LOG(RECEIVE_LOG_LEVEL, "Get yaw:%f pitch:%f", curr_yaw, curr_pitch);
if (buffer[9] == 1) {
if (mark == 0) {
mark = 1;
mark_yaw = curr_yaw;
mark_pitch = curr_pitch;
}
// LOG(RECEIVE_LOG_LEVEL, "Marked");
LOG(RECEIVE_LOG_LEVEL, "Marked");
}
}
cnt = 0;

153
others/armor.Config Normal file

File diff suppressed because one or more lines are too long

153
others/energy.Config Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,961 @@
#pragma once
#ifndef _CAMERA_DEFINE_H_
#define _CAMERA_DEFINE_H_
#include "CameraStatus.h"
#define MAX_CROSS_LINE 9
/// @ingroup MV_TYPEDEF
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>
/// \~english Camera handle type definition
typedef int CameraHandle;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>ʽ
/// \~english Image lookup table transformation
typedef enum
{
LUTMODE_PARAM_GEN=0, ///< \~chinese ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>LUT<55><54><EFBFBD><EFBFBD> \~english Dynamically generate LUT tables by adjusting parameters.
LUTMODE_PRESET=1, ///< \~chinese ʹ<><CAB9>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>LUT<55><54> \~english Use a preset LUT table
LUTMODE_USER_DEF=2 ///< \~chinese ʹ<><CAB9><EFBFBD>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>LUT<55><54> \~english Use a user-defined LUT table
}emSdkLutMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Camera video flow control
typedef enum
{
/// \~chinese <20><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>
/// \~english Normal preview, the captured image is displayed. (If the camera is in trigger mode, it will wait for the arrival of the trigger frame)
RUNMODE_PLAY=0,
RUNMODE_PAUSE=1, ///< \~chinese <20><>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱҲ<CAB1><D2B2><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC> \~english Pause, will pause the camera's image output, and will not capture the image.
RUNMODE_STOP=2 ///< \~chinese ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>ֹͣģʽ \~english Stop the camera. Camera is in stop mode after deinitialization.
}emSdkRunMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese SDK<44>ڲ<EFBFBD><DAB2><EFBFBD>ʾ<EFBFBD>ӿڵ<D3BF><DAB5><EFBFBD>ʾ<EFBFBD><CABE>ʽ
/// \~english How to display the internal display interface of the SDK
typedef enum
{
DISPLAYMODE_SCALE=0, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>ʾ<EFBFBD>ؼ<EFBFBD><D8BC>ijߴ<C4B3> \~english Zoom the display mode, zoom to the size of the display control
DISPLAYMODE_REAL=1, ///< \~chinese 1:1<><31>ʾģʽ<C4A3><CABD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ؼ<EFBFBD><D8BC>ijߴ<C4B3>ʱ<EFBFBD><CAB1>ֻ<EFBFBD><D6BB>ʾ<EFBFBD>ֲ<EFBFBD> \~english 1:1 display mode, when the image size is larger than the size of the display control, only the local display
DISPLAYMODE_2X=2, ///< \~chinese <20>Ŵ<EFBFBD>2X \~english Zoom in 2X
DISPLAYMODE_4X=3, ///< \~chinese <20>Ŵ<EFBFBD>4X \~english Zoom in 4X
DISPLAYMODE_8X=4, ///< \~chinese <20>Ŵ<EFBFBD>8X \~english Zoom in 8X
DISPLAYMODE_16X=5 ///< \~chinese <20>Ŵ<EFBFBD>16X \~english Zoom in 16X
}emSdkDisplayMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ¼<><C2BC>״̬
/// \~english Recording status
typedef enum
{
RECORD_STOP=0, ///< \~chinese ֹͣ \~english Stop
RECORD_START=1, ///< \~chinese ¼<><C2BC><EFBFBD><EFBFBD> \~english Start
RECORD_PAUSE=2 ///< \~chinese <20><>ͣ \~english Pause
}emSdkRecordMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ͼ<><CDBC><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Image mirroring operation
typedef enum
{
MIRROR_DIRECTION_HORIZONTAL=0, ///< \~chinese ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD> \~english Horizontal mirroring
MIRROR_DIRECTION_VERTICAL=1 ///< \~chinese <20><>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD> \~english Vertical mirroring
}emSdkMirrorDirection;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>
/// \~english Rotation of the image
typedef enum
{
ROTATE_DIRECTION_0=0, ///< \~chinese <20><><EFBFBD><EFBFBD>ת \~english Do not rotate
ROTATE_DIRECTION_90=1, ///< \~chinese <20><>ʱ<EFBFBD><CAB1>90<39><30> \~english Counterclockwise 90 degrees
ROTATE_DIRECTION_180=2, ///< \~chinese <20><>ʱ<EFBFBD><CAB1>180<38><30> \~english Counterclockwise 180 degrees
ROTATE_DIRECTION_270=3, ///< \~chinese <20><>ʱ<EFBFBD><CAB1>270<37><30> \~english Counterclockwise 270 degrees
}emSdkRotateDirection;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>֡<EFBFBD><D6A1>
/// \~english Camera video frame rate
typedef enum
{
FRAME_SPEED_LOW=0, ///< \~chinese <20><><EFBFBD><EFBFBD>ģʽ \~english Low Speed
FRAME_SPEED_NORMAL=1, ///< \~chinese <20><>ͨģʽ \~english Normal Speed
FRAME_SPEED_HIGH=2, ///< \~chinese <20><><EFBFBD><EFBFBD>ģʽ(<28><>Ҫ<EFBFBD>ϸߵĴ<DFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>֡<EFBFBD>ʵ<EFBFBD><CAB5>ȶ<EFBFBD><C8B6><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0>) \~english High Speed
FRAME_SPEED_SUPER=3 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ(<28><>Ҫ<EFBFBD>ϸߵĴ<DFB5><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>֡<EFBFBD>ʵ<EFBFBD><CAB5>ȶ<EFBFBD><C8B6><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0>) \~english Super Speed
}emSdkFrameSpeed;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>ĸ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>
/// \~english Save file format type
typedef enum
{
FILE_JPG = 1, ///< \~chinese JPG \~english JPG
FILE_BMP = 2, ///< \~chinese BMP 24bit \~english BMP 24bit
FILE_RAW = 4, ///< \~chinese RAW \~english RAW
FILE_PNG = 8, ///< \~chinese PNG 24bit \~english PNG 24bit
FILE_BMP_8BIT = 16, ///< \~chinese BMP 8bit \~english BMP 8bit
FILE_PNG_8BIT = 32, ///< \~chinese PNG 8bit \~english PNG 8bit
FILE_RAW_16BIT = 64 ///< \~chinese RAW 16bit \~english RAW 16bit
}emSdkFileType;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ͼ<EFBFBD>񴫸<EFBFBD><F1B4ABB8><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>ģʽ
/// \~english Image Sensor Operation Mode in Camera
typedef enum
{
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>ģʽ
/// \~english Continuous acquisition mode
CONTINUATION=0,
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>󣬴<EFBFBD><F3A3ACB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ɼ<EFBFBD>ָ<EFBFBD><D6B8>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>ͼ<EFBFBD>񣬲ɼ<F1A3ACB2><C9BC><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
/// \~english Software trigger mode. After the software sends the instruction, the sensor starts to capture the image of the specified frame number. After the acquisition is completed, the output is stopped.
SOFT_TRIGGER=1,
/// \~chinese Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5>ⲿ<EFBFBD>źţ<C5BA><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD>ɼ<EFBFBD>ָ<EFBFBD><D6B8>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>ͼ<EFBFBD>񣬲ɼ<F1A3ACB2><C9BC><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD>
/// \~english In the hardware trigger mode, when receiving an external signal, the sensor starts to capture the image of the specified frame number. After the acquisition is completed, the output is stopped.
EXTERNAL_TRIGGER=2
} emSdkSnapMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20>Զ<EFBFBD><D4B6>ع<EFBFBD>ʱ<EFBFBD><CAB1>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
/// \~english Anti-strobe frequency at auto exposure
typedef enum
{
/// \~chinese 50HZ,һ<><D2BB><EFBFBD>ĵƹⶼ<C6B9><E2B6BC>50HZ
/// \~english 50HZ, the general lighting is 50HZ
LIGHT_FREQUENCY_50HZ=0,
/// \~chinese 60HZ,<2C><>Ҫ<EFBFBD><D2AA>ָ<EFBFBD><D6B8>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
/// \~english 60HZ, mainly refers to the monitor
LIGHT_FREQUENCY_60HZ=1
}emSdkLightFrequency;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪA,B,C,D 4<><34><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>
/// \~english The camera configuration parameters are divided into groups A, B, C, and D for preservation.
typedef enum
{
PARAMETER_TEAM_DEFAULT = 0xff, ///< \~chinese Ĭ<>ϲ<EFBFBD><CFB2><EFBFBD> \~english Default parameters
PARAMETER_TEAM_A = 0, ///< \~chinese <20><><EFBFBD><EFBFBD>A \~english parametersA
PARAMETER_TEAM_B = 1, ///< \~chinese <20><><EFBFBD><EFBFBD>B \~english parametersB
PARAMETER_TEAM_C = 2, ///< \~chinese <20><><EFBFBD><EFBFBD>C \~english parametersC
PARAMETER_TEAM_D = 3 ///< \~chinese <20><><EFBFBD><EFBFBD>D \~english parametersD
}emSdkParameterTeam;
/// @ingroup MV_ENUM_TYPE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
/// \note <20><><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>ʹ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC>ַ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7A3AC>
/// \note MV-U300Ϊ<30><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD>̨<EFBFBD><CCA8><EFBFBD>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD><EFBFBD><EFBFBD>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4>
/// \note ʹ<><CAB9>PARAM_MODE_BY_MODEL<45><4C>ʽ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijһ̨<D2BB><CCA8><EFBFBD><EFBFBD>ij<EFBFBD><C4B3>̨MV-U300<30><30>
/// \note ʹ<><CAB9><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MV-U300<30><30>Ҫʹ<D2AA><CAB9><EFBFBD><EFBFBD>ͬ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ôʹ<C3B4><CAB9>
/// \note PARAM_MODE_BY_NAME<4D><45>ʽ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3>ÿ̨MV-U300<30><30>ʹ<EFBFBD>ò<EFBFBD>ͬ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ô
/// \note ʹ<><CAB9>PARAM_MODE_BY_SN<53><4E>ʽ<EFBFBD><CABD>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ڰ<EFBFBD>װĿ¼<C4BF><C2BC> \\Camera\\Configs Ŀ¼<C4BF>£<EFBFBD><C2A3><EFBFBD>configΪ<67><CEAA>׺<EFBFBD><D7BA><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
/// \~english
/// \brief Camera parameter loading mode
/// \note You can use the above several ways to load parameters according to your own environment. For example, with
/// \note MV-U300 as an example, you want multiple cameras of this model to share 4 sets of parameters on your computer.
/// \note Use the PARAM_MODE_BY_MODEL method; if you want one or more of the MV-U300s
/// \note Use your own parameter file and the rest of the MV-U300 use the same parameter file again, then use
/// \note PARAM_MODE_BY_NAME way; if you want each MV-U300 to use a different parameter file, then
/// \note Use the PARAM_MODE_BY_SN method.
/// \note The parameter file exists in the \\Camera\\Configs directory of the installation directory, with a config extension file.
typedef enum
{
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>м<EFBFBD><D0BC>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MV-U300
/// \note <20><><EFBFBD><EFBFBD>ͬ<EFBFBD>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ABCD<43><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>޸<EFBFBD>һ̨<D2BB><CCA8><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ӱ<EFBFBD><EFBFBD><ECB5BD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ء<EFBFBD>
/// \~english Load parameters from a file based on the camera model name, such as the MV-U300
/// \note All ABCD four-group parameter files are shared by all cameras of the same model. Modifying a camera's parameter file will affect the entire camera model parameter loading.
PARAM_MODE_BY_MODEL=0,
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dz<EFBFBD>(tSdkCameraDevInfo.acFriendlyName)<29><><EFBFBD>ļ<EFBFBD><C4BC>м<EFBFBD><D0BC>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>MV-U300,<2C><><EFBFBD>dzƿ<C7B3><C6BF>Զ<EFBFBD><D4B6><EFBFBD>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ABCD<43><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
/// \note Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ij<EFBFBD>ͺ<EFBFBD>һ̨<D2BB><CCA8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
/// \note <20><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3>ijһ̨<D2BB><CCA8><EFBFBD><EFBFBD><EFBFBD>ܹ<EFBFBD><DCB9><EFBFBD><EFBFBD><EFBFBD>
/// \note <20><>ͬ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><E8B1B8><EFBFBD>ķ<EFBFBD>ʽ
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
/// \~english Load parameters from a file based on device nickname (tSdkCameraDevInfo.acFriendlyName), such as MV-U300, which can be customized
/// \note All cameras with the same device name share the four ABCD parameter files.
/// \note By default, when only one model of a camera is connected to the computer,
/// \note The device name is the same, and you want a camera to load
/// \note different parameter files, you can modify the device name
/// \note to have it load the specified parameter file.
PARAM_MODE_BY_NAME=1,
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8>Ψһ<CEA8><D2BB><EFBFBD>кŴ<D0BA><C5B4>ļ<EFBFBD><C4BC>м<EFBFBD><D0BC>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><D0BA>ڳ<EFBFBD><DAB3><EFBFBD>ʱ<EFBFBD>Ѿ<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><E8B1B8>ÿ̨<C3BF><CCA8><EFBFBD><EFBFBD>ӵ<EFBFBD>в<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>кš<D0BA>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ψһ<CEA8><D2BB><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ABCD<43><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
/// \note <20><><EFBFBD>к<EFBFBD><D0BA>ڳ<EFBFBD><DAB3><EFBFBD>ʱ<EFBFBD>Ѿ<EFBFBD><D1BE>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>ÿ̨<C3BF><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>ʽ<EFBFBD><CABD>ÿ̨<C3BF><CCA8><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD>ġ<EFBFBD>
/// \~english The parameters are loaded from the file according to the unique serial number of the device. The serial number is already written to the device at the factory and each camera has a different serial number.
/// \note The camera loads ABCD four sets of parameter files according to their unique serial number.
/// \note The serial number has been fixed in the camera at the factory, the serial number of each camera
/// \note is not the same. In this way, the parameter files for each camera are independent.
PARAM_MODE_BY_SN=2,
/// \~chinese <20><><EFBFBD><EFBFBD>Ĺ<EFBFBD>̬<EFBFBD><EFBFBD><E6B4A2><EFBFBD>м<EFBFBD><D0BC>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>ͺŶ<CDBA>֧<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A3AC>tSdkCameraCapbility.bParamInDevice<63><65><EFBFBD><EFBFBD>
/// \~english Load parameters from the device's solid-state memory. Not all models support reading and writing parameters from the camera, as determined by tSdkCameraCapbility.bParamInDevice
PARAM_MODE_IN_DEVICE=3
}emSdkParameterMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese SDK<44><4B><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
/// \~english SDK generated camera configuration page mask values
typedef enum
{
PROP_SHEET_INDEX_EXPOSURE=0, ///< \~chinese <20>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD> \~english Exposure Settings
PROP_SHEET_INDEX_ISP_COLOR=1, ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Color Matrix Settings
PROP_SHEET_INDEX_ISP_LUT=2, ///< \~chinese LUT<55><54><EFBFBD><EFBFBD> \~english LUT setting
PROP_SHEET_INDEX_ISP_SHAPE=3, ///< \~chinese <20><EFBFBD><E4BBBB><EFBFBD><EFBFBD> \~english transform settings
PROP_SHEET_INDEX_VIDEO_FORMAT=4, ///< \~chinese <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD> \~english Formatting
PROP_SHEET_INDEX_RESOLUTION=5, ///< \~chinese <20>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english resolution setting
PROP_SHEET_INDEX_IO_CTRL=6, ///< \~chinese IO<49><4F><EFBFBD><EFBFBD> \~english IO control
PROP_SHEET_INDEX_TRIGGER_SET=7, ///< \~chinese <20><><EFBFBD><EFBFBD>ģʽ \~english trigger setting
PROP_SHEET_INDEX_OVERLAY=8, ///< \~chinese ʮ<><CAAE><EFBFBD><EFBFBD> \~english Crosshair
PROP_SHEET_INDEX_DEVICE_INFO=9, ///< \~chinese <20><EFBFBD><E8B1B8>Ϣ \~english Device Information
PROP_SHEET_INDEX_WDR=10 ///< \~chinese <20><><EFBFBD><EFBFBD>̬ \~english Wide Dynamic
}emSdkPropSheetMask;
/// @ingroup MV_ENUM_TYPE
/// \~chinese SDK<44><4B><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD>Ļص<C4BB><D8B5><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>
/// \~english SDK callback camera configuration page callback message type
typedef enum
{
SHEET_MSG_LOAD_PARAM_DEFAULT=0, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ĭ<EFBFBD>Ϻ󣬴<CFBA><F3A3ACB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english After the parameter is restored to the default, the message is triggered
SHEET_MSG_LOAD_PARAM_GROUP=1, ///< \~chinese <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Load the specified parameter group and trigger the message
SHEET_MSG_LOAD_PARAM_FROMFILE=2, ///< \~chinese <20><>ָ<EFBFBD><D6B8><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD>󣬴<EFBFBD><F3A3ACB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Fires the message after loading parameters from the specified file
SHEET_MSG_SAVE_PARAM_GROUP=3 ///< \~chinese <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9B1BB><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Trigger this message when the current parameter group is saved
}emSdkPropSheetMsg;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD>ӻ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
/// \~english Visualize the type of reference window
typedef enum
{
REF_WIN_AUTO_EXPOSURE=0, ///< \~chinese <20>Զ<EFBFBD><D4B6>عⴰ<D8B9><E2B4B0> \~english Automatic exposure window
REF_WIN_WHITE_BALANCE=1, ///< \~chinese <20><>ƽ<EFBFBD><EFBFBD><E2B4B0> \~english White balance window
}emSdkRefWinType;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD>ӻ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
/// \~english Visualize the type of reference window
typedef enum
{
RES_MODE_PREVIEW=0, ///< \~chinese Ԥ<><D4A4> \~english Preview
RES_MODE_SNAPSHOT=1, ///< \~chinese ץ<><D7A5> \~english Snapshot
}emSdkResolutionMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><>ƽ<EFBFBD><C6BD>ʱɫ<CAB1><C9AB>ģʽ
/// \~english White balance color temperature mode
typedef enum
{
CT_MODE_AUTO=0, ///< \~chinese <20>Զ<EFBFBD>ʶ<EFBFBD><CAB6>ɫ<EFBFBD><C9AB> \~english Automatically recognize color temperature
CT_MODE_PRESET=1, ///< \~chinese ʹ<><CAB9>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4>ɫ<EFBFBD><C9AB> \~english Use the specified preset color temperature
CT_MODE_USER_DEF=2 ///< \~chinese <20>Զ<EFBFBD><D4B6><EFBFBD>ɫ<EFBFBD><C9AB>(<28><><EFBFBD><EFBFBD><EFBFBD>;<EFBFBD><CDBE><EFBFBD>) \~english Custom color temperature (gain and matrix)
}emSdkClrTmpMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese LUT<55><54><EFBFBD><EFBFBD>ɫͨ<C9AB><CDA8>
/// \~english LUT color channel
typedef enum
{
LUT_CHANNEL_ALL=0, ///< \~chinese R,B,G<><47>ͨ<EFBFBD><CDA8>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD> \~english R, B, G simultaneous adjustment of three channels
LUT_CHANNEL_RED=1, ///< \~chinese <20><>ɫͨ<C9AB><CDA8> \~english Red channel
LUT_CHANNEL_GREEN=2, ///< \~chinese <20><>ɫͨ<C9AB><CDA8> \~english Green channel
LUT_CHANNEL_BLUE=3, ///< \~chinese <20><>ɫͨ<C9AB><CDA8> \~english Blue channel
}emSdkLutChannel;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ISP<53><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ
/// \~english ISP processing unit
typedef enum
{
ISP_PROCESSSOR_PC=0, ///< \~chinese ʹ<><CAB9>PC<50><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ISPģ<50><C4A3> \~english Use software ISP module of PC
ISP_PROCESSSOR_DEVICE=1 ///< \~chinese ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>Ӳ<EFBFBD><D3B2>ISPģ<50><C4A3> \~english Use the camera's own hardware ISP module
}emSdkIspProcessor;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>źſ<C5BA><C5BF>Ʒ<EFBFBD>ʽ
/// \~english Strobe signal control method
typedef enum
{
STROBE_SYNC_WITH_TRIG_AUTO=0, ///< \~chinese <20>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD>ź<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>STROBE<42>źš<C5BA><C5A1><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD><EFBFBD>(@link #CameraSetStrobePolarity @endlink)<29><> \~english Synchronized with the trigger signal, the STROBE signal is automatically generated when the camera performs exposure. At this point, the effective polarity can be set (@link #CameraSetStrobePolarity @endlink).
STROBE_SYNC_WITH_TRIG_MANUAL=1, ///< \~chinese <20>ʹ<EFBFBD><CDB4><EFBFBD><EFBFBD>ź<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>STROBE<42><45>ʱָ<CAB1><D6B8><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>(@link #CameraSetStrobeDelayTime @endlink)<29><><EFBFBD>ٳ<EFBFBD><D9B3><EFBFBD>ָ<EFBFBD><D6B8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(@link #CameraSetStrobePulseWidth @endlink)<29><><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>Կ<EFBFBD><D4BF><EFBFBD><EFBFBD><EFBFBD>(@link #CameraSetStrobePolarity @endlink)<29><> \~english Synchronized with the trigger signal. After the trigger, STROBE is delayed by the specified time (@link #CameraSetStrobeDelayTime @endlink) and continues for the specified time (@link #CameraSetStrobePulseWidth @endlink). The effective polarity can be set (@link #CameraSetStrobePolarity @endlink).
STROBE_ALWAYS_HIGH=2, ///< \~chinese ʼ<><CABC>Ϊ<EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD>STROBE<42>źŵ<C5BA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Always high, ignoring other settings of the STROBE signal
STROBE_ALWAYS_LOW=3 ///< \~chinese ʼ<><CABC>Ϊ<EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD><EFBFBD>STROBE<42>źŵ<C5BA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Always low, ignoring other settings of the STROBE signal
}emStrobeControl;
/// @ingroup MV_ENUM_TYPE
/// \~chinese Ӳ<><D3B2><EFBFBD><EFBFBD><E2B4A5><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD><EFBFBD>
/// \~english Signal types triggered by hardware
typedef enum
{
EXT_TRIG_LEADING_EDGE=0, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>Ϊ<EFBFBD>÷<EFBFBD>ʽ \~english Rising edge trigger, default is this method
EXT_TRIG_TRAILING_EDGE=1, ///< \~chinese <20>½<EFBFBD><C2BD>ش<EFBFBD><D8B4><EFBFBD> \~english Falling edge trigger
EXT_TRIG_HIGH_LEVEL=2, ///< \~chinese <20>ߵ<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>,<2C><>ƽ<EFBFBD><C6BD><EFBFBD>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD> \~english The high level triggers, the level width determines the exposure time, only some models of cameras support level triggering.
EXT_TRIG_LOW_LEVEL=3, ///< \~chinese <20>͵<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD> \~english Low level trigger
EXT_TRIG_DOUBLE_EDGE=4, ///< \~chinese ˫<><CBAB><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> \~english Bilateral trigger
}emExtTrigSignal;
/// @ingroup MV_ENUM_TYPE
/// \~chinese Ӳ<><D3B2><EFBFBD><EFBFBD><E2B4A5>ʱ<EFBFBD>Ŀ<EFBFBD><C4BF>ŷ<EFBFBD>ʽ
/// \~english Shutter mode when triggered by hardware
typedef enum
{
EXT_TRIG_EXP_STANDARD=0, ///< \~chinese <20><>׼<EFBFBD><D7BC>ʽ<EFBFBD><CABD>Ĭ<EFBFBD><C4AC>Ϊ<EFBFBD>÷<EFBFBD>ʽ<EFBFBD><CABD> \~english Standard mode, the default is this mode.
EXT_TRIG_EXP_GRR=1, ///< \~chinese ȫ<>ָ<EFBFBD>λ<EFBFBD><CEBB>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>CMOS<4F>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ָ÷<D6B8>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⲿ<EFBFBD><E2B2BF>е<EFBFBD><D0B5><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD>Դﵽȫ<EFB5BD>ֿ<EFBFBD><D6BF>ŵ<EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD><CABA>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Global reset mode, part of the rolling shutter CMOS model camera supports this method, with the external mechanical shutter, you can achieve the effect of a global shutter, suitable for shooting high-speed objects
}emExtTrigShutterMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Sharpness assessment algorithm
typedef enum
{
EVALUATE_DEFINITION_DEVIATION=0, ///< \~chinese <20><><EFBFBD> \~english Variance method
EVALUATE_DEFINITION_SMD=1, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ػҶȷ<D2B6><C8B7> \~english Adjacent Pixel Gray Difference Method
EVALUATE_DEFINITION_GRADIENT=2, ///< \~chinese <20>ݶ<EFBFBD>ͳ<EFBFBD><CDB3> \~english Gradient statistics
EVALUATE_DEFINITION_SOBEL=3, ///< \~chinese Sobel \~english Sobel
EVALUATE_DEFINITION_ROBERT=4, ///< \~chinese Robert \~english Robert
EVALUATE_DEFINITION_LAPLACE=5, ///< \~chinese Laplace \~english Laplace
EVALUATE_DEFINITION_ALG_MAX=6, ///< \~chinese <20><EFBFBD><E3B7A8><EFBFBD><EFBFBD> \~english The number of algorithms
}emEvaluateDefinitionAlgorith;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
/// \~english Text output flag
typedef enum
{
CAMERA_DT_VCENTER = 0x1, ///< \~chinese <20><>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD> \~english Vertically centered
CAMERA_DT_BOTTOM = 0x2, ///< \~chinese <20>ײ<EFBFBD><D7B2><EFBFBD><EFBFBD><EFBFBD> \~english Bottom alignment
CAMERA_DT_HCENTER = 0x4, ///< \~chinese ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD> \~english Horizontally centered
CAMERA_DT_RIGHT = 0x8, ///< \~chinese <20>Ҷ<EFBFBD><D2B6><EFBFBD> \~english Right alignment
CAMERA_DT_SINGLELINE = 0x10, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ \~english Single-line display
CAMERA_DT_ALPHA_BLEND = 0x20, ///< \~chinese Alpha<68><61><EFBFBD><EFBFBD> \~english Alpha blend
CAMERA_DT_ANTI_ALIASING = 0x40, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Anti-aliasing
}emCameraDrawTextFlags;
/// @ingroup MV_ENUM_TYPE
/// \~chinese GPIOģʽ
/// \~english GPIO Mode
typedef enum
{
IOMODE_TRIG_INPUT=0, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Trigger input
IOMODE_STROBE_OUTPUT=1, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Strobe output
IOMODE_GP_INPUT=2, ///< \~chinese ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Universal input
IOMODE_GP_OUTPUT=3, ///< \~chinese ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Universal output
IOMODE_PWM_OUTPUT=4, ///< \~chinese PWM<57><4D><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english PWM output
}emCameraGPIOMode;
/// @ingroup MV_ENUM_TYPE
/// \~chinese ȡͼ<C8A1><CDBC><EFBFBD>ȼ<EFBFBD>
/// \~english Get Image priority
typedef enum
{
CAMERA_GET_IMAGE_PRIORITY_OLDEST=0, ///< \~chinese <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>һ֡ \~english Get the oldest frame in the cache
CAMERA_GET_IMAGE_PRIORITY_NEWEST=1, ///< \~chinese <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>һ֡<D2BB><D6A1><EFBFBD>ȴ<EFBFBD>֡<EFBFBD>ɵĽ<C9B5>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Get the latest frame in the cache (older than this frame will be discarded)
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B1BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ֡
/// \note ijЩ<C4B3>ͺŵ<CDBA><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ִ˹<D6B4><CBB9>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD>ڲ<EFBFBD>֧<EFBFBD>ִ˹<D6B4><CBB9>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><EFBFBD><E0B5B1>@link #CAMERA_GET_IMAGE_PRIORITY_OLDEST @endlink
/// \~english All frames in the cache are discarded, and if the camera is now being exposed or transmitted it will be immediately interrupted, waiting to receive the next frame
/// \note Some models do not support this feature. For cameras that do not support this feature this flag is equivalent to @link #CAMERA_GET_IMAGE_PRIORITY_OLDEST @endlink
CAMERA_GET_IMAGE_PRIORITY_NEXT=2,
}emCameraGetImagePriority;
/// @ingroup MV_ENUM_TYPE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD>־
/// \~english Soft trigger function flag
typedef enum
{
CAMERA_ST_CLEAR_BUFFER_BEFORE = 0x1, ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѻ<EFBFBD><D1BB><EFBFBD><EFBFBD><EFBFBD>֡ \~english Empty camera-cached frames before soft triggering
}emCameraSoftTriggerExFlags;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8>Ϣ
/// \~english Camera device information
typedef struct
{
char acProductSeries[32]; ///< \~chinese <20><>Ʒϵ<C6B7><CFB5> \~english Product Series
char acProductName[32]; ///< \~chinese <20><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD> \~english product name
/// \~chinese <20><>Ʒ<EFBFBD>dzƣ<C7B3><C6A3>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dzƣ<C7B3><C6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱʹ<CAB1><CAB9>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@link #CameraSetFriendlyName @endlink<6E>ӿڸı<DAB8><C4B1><EFBFBD><EFBFBD>dzƣ<C7B3><C6A3><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
/// \~english Product nicknames, users can customize the nickname, saved in the camera, used to distinguish between multiple cameras at the same time, you can use the @link #CameraSetFriendlyName @endlink interface to change the nickname, the device takes effect after restart.
char acFriendlyName[32];
char acLinkName[32]; ///< \~chinese <20>ں˷<DABA><CBB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9> \~english Kernel symbolic connection name, internal use
char acDriverVersion[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>汾 \~english Driver version
char acSensorType[32]; ///< \~chinese sensor<6F><72><EFBFBD><EFBFBD> \~english Sensor type
char acPortType[32]; ///< \~chinese <20>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD> \~english Interface Type
char acSn[32]; ///< \~chinese <20><>ƷΨһ<CEA8><D2BB><EFBFBD>к<EFBFBD> \~english Product unique serial number
UINT uInstance; ///< \~chinese <20><><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸõ<DAB8><C3B5><EFBFBD><EFBFBD>ϵ<EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD><C5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>ͺŶ<CDBA><C5B6><EFBFBD><EFBFBD><EFBFBD> \~english The example index number of this model camera on this computer, used to distinguish the same model multiple cameras
} tSdkCameraDevInfo;
/// @ingroup MV_MACRO_TYPE
/// @{
#define EXT_TRIG_MASK_GRR_SHUTTER 1 ///< \~chinese <20><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7>GRRģʽ \~english Shutter supports GRR mode
#define EXT_TRIG_MASK_LEVEL_MODE 2 ///< \~chinese ֧<>ֵ<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD> \~english Support level trigger
#define EXT_TRIG_MASK_DOUBLE_EDGE 4 ///< \~chinese ֧<><D6A7>˫<EFBFBD><CBAB><EFBFBD>ش<EFBFBD><D8B4><EFBFBD> \~english Supports bilateral triggering
//tSdkResolutionRange<67><EFBFBD><E1B9B9><EFBFBD><EFBFBD>SKIP<49><50> BIN<49><4E>RESAMPLEģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
#define MASK_2X2_HD (1<<0) //Ӳ<><D3B2>SKIP<49><50>BIN<49><4E><EFBFBD>ز<EFBFBD><D8B2><EFBFBD> 2X2
#define MASK_3X3_HD (1<<1)
#define MASK_4X4_HD (1<<2)
#define MASK_5X5_HD (1<<3)
#define MASK_6X6_HD (1<<4)
#define MASK_7X7_HD (1<<5)
#define MASK_8X8_HD (1<<6)
#define MASK_9X9_HD (1<<7)
#define MASK_10X10_HD (1<<8)
#define MASK_11X11_HD (1<<9)
#define MASK_12X12_HD (1<<10)
#define MASK_13X13_HD (1<<11)
#define MASK_14X14_HD (1<<12)
#define MASK_15X15_HD (1<<13)
#define MASK_16X16_HD (1<<14)
#define MASK_17X17_HD (1<<15)
#define MASK_2X2_SW (1<<16) //<2F><><EFBFBD><EFBFBD>SKIP<49><50>BIN<49><4E><EFBFBD>ز<EFBFBD><D8B2><EFBFBD> 2X2
#define MASK_3X3_SW (1<<17)
#define MASK_4X4_SW (1<<18)
#define MASK_5X5_SW (1<<19)
#define MASK_6X6_SW (1<<20)
#define MASK_7X7_SW (1<<21)
#define MASK_8X8_SW (1<<22)
#define MASK_9X9_SW (1<<23)
#define MASK_10X10_SW (1<<24)
#define MASK_11X11_SW (1<<25)
#define MASK_12X12_SW (1<<26)
#define MASK_13X13_SW (1<<27)
#define MASK_14X14_SW (1<<28)
#define MASK_15X15_SW (1<<29)
#define MASK_16X16_SW (1<<30)
#define MASK_17X17_SW (1<<31)
/// @}
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1><EFBFBD><EFBFBD><EFBFBD><E8B6A8>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>UI
/// \~english Camera resolution setting range, can be used for component UI
typedef struct
{
INT iHeightMax; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߶<EFBFBD> \~english Maximum image height
INT iHeightMin; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD>С<EFBFBD>߶<EFBFBD> \~english Image minimum height
INT iWidthMax; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The maximum width of the image
INT iWidthMin; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD> \~english The minimum width of the image
UINT uSkipModeMask; ///< \~chinese SKIPģʽ<C4A3><CABD><EFBFBD>룬Ϊ0<CEAA><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7>SKIP <20><>bit0Ϊ1,<2C><>ʾ֧<CABE><D6A7>SKIP 2x2 ;bit1Ϊ1<CEAA><31><EFBFBD><EFBFBD>ʾ֧<CABE><D6A7>SKIP 3x3.... \~english The SKIP mode mask, which is 0, indicates that SKIP is not supported. Bit0 is 1 to indicate that SKIP 2x2 is supported; bit1 is 1 to indicate that SKIP 3x3 is supported....
UINT uBinSumModeMask; ///< \~chinese BIN(<28><><EFBFBD><EFBFBD>ʽ<C4A3><CABD><EFBFBD>룬Ϊ0<CEAA><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7>BIN <20><>bit0Ϊ1,<2C><>ʾ֧<CABE><D6A7>BIN 2x2 ;bit1Ϊ1<CEAA><31><EFBFBD><EFBFBD>ʾ֧<CABE><D6A7>BIN 3x3.... \~english The BIN (sum) pattern mask, which is 0, indicates that BIN is not supported. Bit0 is 1, indicating that BIN 2x2 is supported; bit1 is 1, indicating that BIN 3x3 is supported....
UINT uBinAverageModeMask; ///< \~chinese BIN(<28><><EFBFBD><EFBFBD>ֵ)ģʽ<C4A3><CABD><EFBFBD>룬Ϊ0<CEAA><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7>BIN <20><>bit0Ϊ1,<2C><>ʾ֧<CABE><D6A7>BIN 2x2 ;bit1Ϊ1<CEAA><31><EFBFBD><EFBFBD>ʾ֧<CABE><D6A7>BIN 3x3.... \~english The BIN (mean value) mode mask, which is 0, indicates that BIN is not supported. Bit0 is 1, indicating that BIN 2x2 is supported; bit1 is 1, indicating that BIN 3x3 is supported....
UINT uResampleMask; ///< \~chinese Ӳ<><D3B2><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Hardware resampling mask
} tSdkResolutionRange;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Camera resolution description
typedef struct
{
INT iIndex; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>[0,N]<5D><>ʾԤ<CABE><D4A4><EFBFBD>ķֱ<C4B7><D6B1><EFBFBD>(N ΪԤ<CEAA><D4A4><EFBFBD>ֱ<EFBFBD><D6B1>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><E3B2BB><EFBFBD><EFBFBD>20),OXFF <20><>ʾ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>(ROI) \~english Index number, [0, N] indicates the preset resolution (N is the maximum number of preset resolutions, generally no more than 20), OXFF indicates custom resolution (ROI)
char acDescription[32]; ///< \~chinese <20>÷ֱ<C3B7><D6B1>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>Ч<EFBFBD><D0A7><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>ʿɺ<CABF><C9BA>Ը<EFBFBD><D4B8><EFBFBD>Ϣ \~english The description of the resolution. This information is valid only when the resolution is preset. Custom resolution ignores this information
UINT uBinSumMode; ///< \~chinese BIN(<28><><EFBFBD><EFBFBD>)<29><>ģʽ,<2C><>Χ<EFBFBD><CEA7><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>tSdkResolutionRange.uBinSumModeMask \~english The BIN (sum) mode cannot exceed the tSdkResolutionRange.uBinSumModeMask
UINT uBinAverageMode; ///< \~chinese BIN(<28><><EFBFBD><EFBFBD>ֵ)<29><>ģʽ,<2C><>Χ<EFBFBD><CEA7><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>tSdkResolutionRange.uBinAverageModeMask \~english BIN (average) mode, the range cannot exceed tSdkResolutionRange.uBinAverageModeMask
UINT uSkipMode; ///< \~chinese <20>Ƿ<EFBFBD>SKIP<49>ijߴ磬Ϊ0<CEAA><30>ʾ<EFBFBD><CABE>ֹSKIPģʽ<C4A3><CABD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>tSdkResolutionRange.uSkipModeMask \~english Whether the SKIP size is 0 indicates that the SKIP mode is disabled and the range cannot exceed the tSdkResolutionRange.uSkipModeMask
UINT uResampleMask; ///< \~chinese Ӳ<><D3B2><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Hardware resampling mask
INT iHOffsetFOV; ///< \~chinese <20>ɼ<EFBFBD><C9BC>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sensor<6F><72><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD>Ͻǵ<CFBD>ˮƽƫ<C6BD><C6AB> \~english The horizontal offset of the acquisition field of view relative to the top left corner of the Sensor's largest field of view
INT iVOffsetFOV; ///< \~chinese <20>ɼ<EFBFBD><C9BC>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sensor<6F><72><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD>ϽǵĴ<C7B5>ֱƫ<D6B1><C6AB> \~english The vertical offset of the acquisition field of view relative to the upper left corner of the Sensor's largest field of view
INT iWidthFOV; ///< \~chinese <20>ɼ<EFBFBD><C9BC>ӳ<EFBFBD><D3B3>Ŀ<EFBFBD><C4BF><EFBFBD> \~english The width of the field of view
INT iHeightFOV; ///< \~chinese <20>ɼ<EFBFBD><C9BC>ӳ<EFBFBD><D3B3>ĸ߶<C4B8> \~english The height of the field of view
INT iWidth; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD> \~english The width of the final output image of the camera
INT iHeight; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ĸ߶<C4B8> \~english The height of the final output image of the camera
INT iWidthZoomHd; ///< \~chinese Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD>ŵĿ<C5B5><C4BF><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>д˲<D0B4><CBB2><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1>ʣ<EFBFBD><CAA3>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english The width of the hardware zoom, resolution that does not require this operation, this variable is set to 0.
INT iHeightZoomHd; ///< \~chinese Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD>ŵĸ߶<C4B8>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>д˲<D0B4><CBB2><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1>ʣ<EFBFBD><CAA3>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english The height of the hardware zoom, resolution that does not require this operation, this variable is set to 0.
INT iWidthZoomSw; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵĿ<C5B5><C4BF><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>д˲<D0B4><CBB2><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1>ʣ<EFBFBD><CAA3>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english The width of the software's zoom, which does not require the resolution of this operation, this variable is set to 0.
INT iHeightZoomSw; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵĸ߶<C4B8>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>д˲<D0B4><CBB2><EFBFBD><EFBFBD>ķֱ<C4B7><D6B1>ʣ<EFBFBD><CAA3>˱<EFBFBD><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english The height of the software's zoom, which does not require the resolution of this operation, this variable is set to 0.
} tSdkImageResolution;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD>ɫ<EFBFBD><C9AB>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
/// \~english Camera white balance color temperature mode description information
typedef struct
{
INT iIndex; ///< \~chinese ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Mode index number
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Description
} tSdkColorTemperatureDes;
/// \~chinese <20><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
/// \~english Camera frame rate description information
typedef struct
{
INT iIndex; ///< \~chinese ֡<><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>һ<EFBFBD><D2BB>0<EFBFBD><30>Ӧ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ģʽ<C4A3><CABD>1<EFBFBD><31>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD>ͨģʽ<C4A3><CABD>2<EFBFBD><32>Ӧ<EFBFBD>ڸ<EFBFBD><DAB8><EFBFBD>ģʽ \~english Frame rate index number, generally 0 corresponds to low speed mode, 1 corresponds to normal mode, 2 corresponds to high speed mode
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Description
} tSdkFrameSpeed;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ع⹦<D8B9>ܷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>
/// \see tSdkCameraCapbility.sExposeDesc
/// \~english Camera exposure function scope definition
/// \see tSdkCameraCapbility.sExposeDesc
typedef struct
{
UINT uiTargetMin; ///< \~chinese <20>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>Сֵ \~english Auto exposure brightness target minimum
UINT uiTargetMax; ///< \~chinese <20>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ \~english Auto exposure brightness target maximum
UINT uiAnalogGainMin; ///< \~chinese ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ<D0A1><D6B5><EFBFBD><EFBFBD>λΪfAnalogGainStep<65>ж<EFBFBD><D0B6><EFBFBD> \~english The minimum value of the analog gain in fAnalog defined in GainStep
UINT uiAnalogGainMax; ///< \~chinese ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>λΪfAnalogGainStep<65>ж<EFBFBD><D0B6><EFBFBD> \~english The maximum value of the analog gain in fAnalog defined in GainStep
float fAnalogGainStep; ///< \~chinese ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>ӵķŴ<C4B7><C5B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>磬uiAnalogGainMinһ<6E><D2BB>Ϊ16<31><36>fAnalogGainStepһ<70><D2BB>Ϊ0.125<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD>С<EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>16*0.125 = 2<><32> \~english Each increase in analog gain corresponds to an increased amplification factor. For example, uiAnalogGainMin is generally 16 and fAnalogGainStep is generally 0.125, so the minimum magnification is 16*0.125 = 2 times
UINT uiExposeTimeMin; ///< \~chinese <20>ֶ<EFBFBD>ģʽ<C4A3>£<EFBFBD><C2A3>ع<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ<D0A1><D6B5><EFBFBD><EFBFBD>λ:<3A>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD>CameraGetExposureLineTime<6D><65><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>һ<EFBFBD>ж<EFBFBD>Ӧ<EFBFBD><D3A6>ʱ<EFBFBD><CAB1><><CEA2>),<2C>Ӷ<EFBFBD><D3B6>õ<EFBFBD><C3B5><EFBFBD>֡<EFBFBD><D6A1><EFBFBD>ع<EFBFBD>ʱ<EFBFBD><CAB1> \~english The minimum exposure time in manual mode, unit: line. According to CameraGetExposureLineTime can get a row of corresponding time (microseconds) to get the entire frame exposure time
UINT uiExposeTimeMax; ///< \~chinese <20>ֶ<EFBFBD>ģʽ<C4A3>£<EFBFBD><C2A3>ع<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>λ:<3A><> \~english Maximum exposure time in manual mode, unit: line
} tSdkExpose;
/// \~chinese <20><><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD><EFBFBD>
/// \~english Trigger mode description
typedef struct
{
INT iIndex; ///< \~chinese ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Mode index number
char acDescription[32]; ///< \~chinese <20><>ģʽ<C4A3><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Description information of this mode
} tSdkTrigger;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ְ<EFBFBD><D6B0><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ijЩ<C4B3><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч)
/// \~english Transmission packet size description (valid for some web cameras)
typedef struct
{
INT iIndex; ///< \~chinese <20>ְ<EFBFBD><D6B0><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Packet size index number
char acDescription[32]; ///< \~chinese <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english Corresponding description information
UINT iPackSize; ///< \~chinese <20><><EFBFBD><EFBFBD>С \~english Packet size
} tSdkPackLength;
/// \~chinese Ԥ<><D4A4><EFBFBD><EFBFBD>LUT<55><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Preset LUT Table Description
typedef struct
{
INT iIndex; ///< \~chinese <20><><EFBFBD><EFBFBD> \~english index
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english description
} tSdkPresetLut;
/// \~chinese AE<41><EFBFBD><E3B7A8><EFBFBD><EFBFBD>
/// \~english AE algorithm description
typedef struct
{
INT iIndex; ///< \~chinese <20><><EFBFBD><EFBFBD> \~english index
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english description
} tSdkAeAlgorithm;
/// \~chinese RAWתRGB<47><EFBFBD><E3B7A8><EFBFBD><EFBFBD>
/// \~english RAW to RGB algorithm description
typedef struct
{
INT iIndex; ///< \~chinese <20><><EFBFBD><EFBFBD> \~english index
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english description
} tSdkBayerDecodeAlgorithm;
/// \~chinese ֡ͳ<D6A1><CDB3><EFBFBD><EFBFBD>Ϣ
/// \~english Frame statistics
typedef struct
{
INT iTotal; ///< \~chinese <20><>ǰ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD><D6A1> \~english The current total number of frames collected (including error frames)
INT iCapture; ///< \~chinese <20><>ǰ<EFBFBD>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>Ч֡<D0A7><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The number of valid frames currently collected
INT iLost; ///< \~chinese <20><>ǰ<EFBFBD><C7B0>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Current number of dropped frames
} tSdkFrameStatistic;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD>ʽ
/// \~english Camera output image data format
typedef struct
{
INT iIndex; ///< \~chinese <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Format type number
char acDescription[32]; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ \~english description
UINT iMediaType; ///< \~chinese <20><>Ӧ<EFBFBD><D3A6>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EBA3AC>CAMERA_MEDIA_TYPE_BAYGR8<52><38> \~english Corresponding image format encoding, such as CAMERA_MEDIA_TYPE_BAYGR8.
} tSdkMediaType;
/// \~chinese ٤<><D9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B6A8>Χ
/// \~english Gamma setting range
typedef struct
{
INT iMin; ///< \~chinese <20><>Сֵ \~english min
INT iMax; ///< \~chinese <20><><EFBFBD><EFBFBD>ֵ \~english max
} tGammaRange;
/// \~chinese <20>Աȶȵ<C8B6><C8B5><EFBFBD><E8B6A8>Χ
/// \~english Contrast setting range
typedef struct
{
INT iMin; ///< \~chinese <20><>Сֵ \~english min
INT iMax; ///< \~chinese <20><><EFBFBD><EFBFBD>ֵ \~english max
} tContrastRange;
/// \~chinese RGB<47><42>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B6A8>Χ
/// \~english RGB three channel digital gain setting range
typedef struct
{
INT iRGainMin; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ \~english Red gain minimum
INT iRGainMax; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ \~english Red gain maximum
INT iGGainMin; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ \~english Green gain minimum
INT iGGainMax; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ \~english Green gain maximum
INT iBGainMin; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сֵ \~english Blue gain minimum
INT iBGainMax; ///< \~chinese <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ \~english blue gain maximum
} tRgbGainRange;
/// \~chinese <20><><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>ķ<EFBFBD>Χ
/// \~english Saturation setting range
typedef struct
{
INT iMin; ///< \~chinese <20><>Сֵ \~english min
INT iMax; ///< \~chinese <20><><EFBFBD><EFBFBD>ֵ \~english max
} tSaturationRange;
/// \~chinese <20>񻯵<EFBFBD><F1BBAFB5><EFBFBD><E8B6A8>Χ
/// \~english Sharpening setting range
typedef struct
{
INT iMin; ///< \~chinese <20><>Сֵ \~english min
INT iMax; ///< \~chinese <20><><EFBFBD><EFBFBD>ֵ \~english max
} tSharpnessRange;
/// \~chinese ISPģ<50><C4A3><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>Ϣ
/// \~english ISP module enable information
typedef struct
{
BOOL bMonoSensor; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD>ڰ<EFBFBD><DAB0><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>Ǻڰ<C7BA><DAB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD>صĹ<D8B5><C4B9>ܶ<EFBFBD><DCB6>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD> \~english Indicates whether this model is a black-and-white camera. If it is a black-and-white camera, color-related functions cannot be adjusted.
BOOL bWbOnce; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>ƽ<EFBFBD><EFBFBD><E2B9A6> \~english Indicates whether this model camera supports manual white balance function
BOOL bAutoWb; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ƽ<EFBFBD><EFBFBD><E2B9A6> \~english Indicates whether this model camera supports automatic white balance function
BOOL bAutoExposure; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD>Զ<EFBFBD><D4B6>ع⹦<D8B9><E2B9A6> \~english Indicates whether this model camera supports auto exposure function
BOOL bManualExposure; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD>ֶ<EFBFBD><D6B6>ع⹦<D8B9><E2B9A6> \~english Indicates whether this model camera supports manual exposure function
BOOL bAntiFlick; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD>ֿ<EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Indicates whether this model camera supports anti-strobe function
BOOL bDeviceIsp; ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD>ͺ<EFBFBD><CDBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7>Ӳ<EFBFBD><D3B2>ISP<53><50><EFBFBD><EFBFBD> \~english Indicates whether this model camera supports hardware ISP function
BOOL bForceUseDeviceIsp;///< \~chinese bDeviceIsp<73><70>bForceUseDeviceIspͬʱΪTRUEʱ<45><CAB1><EFBFBD><EFBFBD>ʾǿ<CABE><C7BF>ֻ<EFBFBD><D6BB>Ӳ<EFBFBD><D3B2>ISP<53><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> \~english When both bDeviceIsp and bForceUseDeviceIsp are TRUE, this means that only the hardware ISP is forced and cannot be cancelled.
BOOL bZoomHD; ///< \~chinese <20><><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><D6A7>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С)<29><> \~english Whether the camera hardware supports image scaling output (can only be reduced).
} tSdkIspCapacity;
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>Щ<EFBFBD><D0A9>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>UI
/// \note <20><><EFBFBD><EFBFBD>@link #CameraGetCapability @endlink<6E><6B>ȡ<EFBFBD><C8A1><EFBFBD>
/// \~english Define integrated device description information that can be used to dynamically build UI
/// \note call @link #CameraGetCapability @endlink to get this structure
typedef struct
{
tSdkTrigger *pTriggerDesc; ///< \~chinese <20><><EFBFBD><EFBFBD>ģʽ \~english trigger mode
INT iTriggerDesc; ///< \~chinese <20><><EFBFBD><EFBFBD>ģʽ<C4A3>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pTriggerDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С \~english The number of trigger modes, that is, the size of the pTriggerDesc array
tSdkImageResolution *pImageSizeDesc;///< \~chinese Ԥ<><D4A4><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD> \~english Preset resolution
INT iImageSizeDesc; ///< \~chinese Ԥ<><D4A4><EFBFBD>ֱ<EFBFBD><D6B1>ʵĸ<CAB5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pImageSizeDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С \~english The number of preset resolutions, that is, the size of the pImageSizeDesc array
tSdkColorTemperatureDes *pClrTempDesc;///< \~chinese Ԥ<><D4A4>ɫ<EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD>ڰ<EFBFBD>ƽ<EFBFBD><C6BD> \~english Preset color temperature for white balance
INT iClrTempDesc; ///< \~chinese Ԥ<><D4A4>ɫ<EFBFBD>¸<EFBFBD><C2B8><EFBFBD> \~english The number of preset color temperatures
tSdkMediaType *pMediaTypeDesc; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʽ \~english Camera output image format
INT iMediaTypdeDesc; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pMediaTypeDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><D0A1> \~english The number of types of camera output image formats, that is, the size of the pMediaTypeDesc array.
tSdkFrameSpeed *pFrameSpeedDesc; ///< \~chinese <20>ɵ<EFBFBD><C9B5><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ <20><><EFBFBD><EFBFBD> <20>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD> \~english Adjustable frame rate type, normal high speed and super three speed settings on the corresponding interface
INT iFrameSpeedDesc; ///< \~chinese <20>ɵ<EFBFBD><C9B5><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD>͵ĸ<CDB5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pFrameSpeedDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><D0A1> \~english The number of frame rate types that can be adjusted, that is, the size of the pFrameSpeedDesc array.
tSdkPackLength *pPackLenDesc; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸 \~english Transmission packet length, generally used for network equipment
INT iPackLenDesc; ///< \~chinese <20>ɹ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>ְ<EFBFBD><D6B0><EFBFBD><EFBFBD>ȵĸ<C8B5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pPackLenDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С<EFBFBD><D0A1> \~english The number of transmission packetization lengths available for selection, which is the size of the pPackLenDesc array.
INT iOutputIoCounts; ///< \~chinese <20>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IO<49>ĸ<EFBFBD><C4B8><EFBFBD> \~english Number of programmable output IOs
INT iInputIoCounts; ///< \~chinese <20>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IO<49>ĸ<EFBFBD><C4B8><EFBFBD> \~english Number of programmable input IOs
tSdkPresetLut *pPresetLutDesc; ///< \~chinese <20><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>LUT<55><54> \~english Camera preset LUT table
INT iPresetLut; ///< \~chinese <20><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>LUT<55><54><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pPresetLutDesc<73><63><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С \~english The number of LUT tables preset by the camera, that is, the size of the pPresetLutDesc array
INT iUserDataMaxLen; ///< \~chinese ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󳤶ȡ<F3B3A4B6>Ϊ0<CEAA><30>ʾ<EFBFBD>ޡ<EFBFBD> \~english Indicates the maximum length in the camera used to save the user data area. 0 means no.
BOOL bParamInDevice; ///< \~chinese ָʾ<D6B8><CABE><EFBFBD><EFBFBD>Ƿ<EFBFBD>֧<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>ж<EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>顣1Ϊ֧<CEAA>֣<EFBFBD>0<EFBFBD><30>֧<EFBFBD>֡<EFBFBD> \~english Indicates whether the device supports reading and writing parameter groups from the device. 1 is supported, 0 is not supported.
tSdkAeAlgorithm *pAeAlmSwDesc; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><E3B7A8><EFBFBD><EFBFBD> \~english Software auto exposure algorithm description
int iAeAlmSwDesc; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><E3B7A8><EFBFBD><EFBFBD> \~english Software automatic exposure algorithm number
tSdkAeAlgorithm *pAeAlmHdDesc; ///< \~chinese Ӳ<><D3B2><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪNULL<4C><4C>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7>Ӳ<EFBFBD><D3B2><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD> \~english Hardware auto exposure algorithm description, NULL means hardware auto exposure is not supported
int iAeAlmHdDesc; ///< \~chinese Ӳ<><D3B2><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD><D8B9><EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0<CEAA><30>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7>Ӳ<EFBFBD><D3B2><EFBFBD>Զ<EFBFBD><D4B6>ع<EFBFBD> \~english Number of hardware auto exposure algorithms, 0 means hardware auto exposure is not supported
tSdkBayerDecodeAlgorithm *pBayerDecAlmSwDesc; ///< \~chinese <20><><EFBFBD><EFBFBD>Bayerת<72><D7AA>ΪRGB<47><42><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><E3B7A8><EFBFBD><EFBFBD> \~english Algorithm Description of Software Bayer Conversion to RGB Data
int iBayerDecAlmSwDesc; ///< \~chinese <20><><EFBFBD><EFBFBD>Bayerת<72><D7AA>ΪRGB<47><42><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><E3B7A8><EFBFBD><EFBFBD> \~english The number of algorithms that Bayer converts to RGB data
tSdkBayerDecodeAlgorithm *pBayerDecAlmHdDesc; ///< \~chinese Ӳ<><D3B2>Bayerת<72><D7AA>ΪRGB<47><42><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪNULL<4C><4C>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7> \~english Hardware Bayer converts to RGB data algorithm description, is not supported for NULL representation
int iBayerDecAlmHdDesc; ///< \~chinese Ӳ<><D3B2>Bayerת<72><D7AA>ΪRGB<47><42><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><E3B7A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0<CEAA><30>ʾ<EFBFBD><CABE>֧<EFBFBD><D6A7> \~english The number of algorithms that hardware Bayer converts to RGB data, 0 means not supported
/* ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>ڷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>,<2C><><EFBFBD>ڶ<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>UI*/
tSdkExpose sExposeDesc; ///< \~chinese <20>ع<EFBFBD><D8B9>ķ<EFBFBD>Χֵ \~english Exposure range value
tSdkResolutionRange sResolutionRange; ///< \~chinese <20>ֱ<EFBFBD><D6B1>ʷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD> \~english Resolution range description
tRgbGainRange sRgbGainRange; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<E6B7B6><CEA7><EFBFBD><EFBFBD> \~english Image digital gain range description
tSaturationRange sSaturationRange; ///< \~chinese <20><><EFBFBD>Ͷȷ<CDB6>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD> \~english Saturation range description
tGammaRange sGammaRange; ///< \~chinese ٤<><D9A4><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD> \~english Gamma range description
tContrastRange sContrastRange; ///< \~chinese <20>Աȶȷ<C8B6>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD> \~english Contrast range description
tSharpnessRange sSharpnessRange; ///< \~chinese <20>񻯷<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD> \~english Sharpening range description
tSdkIspCapacity sIspCapacity; ///< \~chinese ISP<53><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english ISP capability description
} tSdkCameraCapbility;
/// \~chinese ͼ<><CDBC>֡ͷ<D6A1><CDB7>Ϣ
/// \~english Image frame header information
typedef struct
{
UINT uiMediaType; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD>ʽ \~english Image Format
UINT uBytes; ///< \~chinese ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD> \~english Total bytes
INT iWidth; ///< \~chinese ͼ<><CDBC><EFBFBD>Ŀ<EFBFBD><C4BF>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣬸ñ<F3A3ACB8><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD>̬<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ߴ<EFBFBD> \~english The width of the image, after calling the image processing function, the variable may be dynamically modified to indicate the image size after processing
INT iHeight; ///< \~chinese ͼ<><CDBC><EFBFBD>ĸ߶ȣ<DFB6><C8A3><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣬸ñ<F3A3ACB8><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD>̬<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ߴ<EFBFBD> \~english The height of the image, after calling the image processing function, the variable may be dynamically modified to indicate the image size after processing
INT iWidthZoomSw; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵĿ<C5B5><C4BF><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>ͼ<EFBFBD>񣬴˱<F1A3ACB4><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english The width of the software zoom, which does not require software cropping. This variable is set to 0.
INT iHeightZoomSw; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵĸ߶<C4B8>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD>ͼ<EFBFBD>񣬴˱<F1A3ACB4><CBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0. \~english Software zoom height, no software cropped image is required. This variable is set to 0.
BOOL bIsTrigger; ///< \~chinese ָʾ<D6B8>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>֡ \~english is trigger
UINT uiTimeStamp; ///< \~chinese <20><>֡<EFBFBD>IJɼ<C4B2>ʱ<EFBFBD><EFBFBD><E4A3AC>λ0.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The frame acquisition time, in units of 0.1 milliseconds
UINT uiExpTime; ///< \~chinese <20><>ǰͼ<C7B0><CDBC><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>λΪ΢<CEAA><CEA2>us \~english Exposure of the current image in microseconds us
float fAnalogGain; ///< \~chinese <20><>ǰͼ<C7B0><CDBC><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1B6> \~english The current image's analog gain multiplier
INT iGamma; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD><EFBFBD>٤<EFBFBD><D9A4><EFBFBD>趨ֵ<E8B6A8><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LUTģʽΪ<CABD><CEAA>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>Ϊ-1 \~english The gamma setting value of the frame image is valid only when the LUT mode is a dynamic parameter generation, and is -1 in other modes.
INT iContrast; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD>ĶԱȶ<D4B1><C8B6>趨ֵ<E8B6A8><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>LUTģʽΪ<CABD><CEAA>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<C4A3><CABD>Ϊ-1 \~english The contrast setting value of the frame image is only valid when the LUT mode is generated by the dynamic parameter, and is -1 in other modes.
INT iSaturation; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD>ı<EFBFBD><C4B1>Ͷ<EFBFBD><CDB6>趨ֵ<E8B6A8><D6B5><EFBFBD><EFBFBD><EFBFBD>ںڰ<DABA><DAB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壬Ϊ0 \~english The saturation value of the frame image, which is meaningless for a black and white camera, is 0
float fRgain; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںڰ<DABA><DAB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壬Ϊ1 \~english The red digital gain multiple of this frame image processing is meaningless for a black and white camera and is 1
float fGgain; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںڰ<DABA><DAB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壬Ϊ1 \~english The green digital gain multiplier for this frame image processing, meaning no significance for black and white cameras, is 1
float fBgain; ///< \~chinese <20><>֡ͼ<D6A1><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E6B1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ںڰ<DABA><DAB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壬Ϊ1 \~english The blue digital gain multiplier for this frame image processing, meaning no significance for black and white cameras, is 1
}tSdkFrameHead;
/// \~chinese ͼ<><CDBC>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>
/// \~english Image frame description
typedef struct sCameraFrame
{
tSdkFrameHead head; ///< \~chinese ֡ͷ \~english Frame Head
BYTE * pBuffer; ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Image Data
}tSdkFrame;
/// @ingroup API_GRAB_CB
/// \~chinese ͼ<>񲶻<EFBFBD><F1B2B6BB>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Callback function definition for image capture
typedef void (WINAPI* CAMERA_SNAP_PROC)(CameraHandle hCamera, BYTE *pFrameBuffer, tSdkFrameHead* pFrameHead,PVOID pContext);
/// @ingroup API_SETTINGS_PAGE
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english camera configuration page message callback function definition
typedef void (WINAPI* CAMERA_PAGE_MSG_PROC)(CameraHandle hCamera,UINT MSG,UINT uParam,PVOID pContext);
/// @ingroup API_RECONNECT
/// \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4>ص<EFBFBD>
/// \param [in] hCamera <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] MSG <20><>Ϣ<EFBFBD><CFA2>0: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӶϿ<D3B6> 1: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻָ<D3BB>
/// \param [in] uParam <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
/// \param [in] pContext <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
/// \return <20><>
/// \note USB<53><42><EFBFBD><EFBFBD>uParamȡֵ<C8A1><D6B5>
/// \note δ<><CEB4><EFBFBD><EFBFBD>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>uParamȡֵ<C8A1><D6B5>
/// \note <09><>MSG=0ʱ<30><CAB1>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>
/// \note <09><>MSG=1ʱ<31><CAB1>
/// \note 0<><30><EFBFBD>ϴε<CFB4><CEB5><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶʧ<D1B6><CAA7>
/// \note 1<><31><EFBFBD>ϴε<CFB4><CEB5><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Camera connection status callback
/// \param [in] hCamera Camera handle
/// \param [in] MSG message, 0: Camera disconnected 1: Camera connection restored
/// \param [in] uParam Additional Information
/// \param [in] pContext user data
/// \return None
/// \note USB camera uParam value:
/// \note Undefined
/// \note network camera uParam value:
/// \note When MSG=0: Undefined
/// \note When MSG=1:
/// \note 0: The last dropped reason, network communication failed
/// \note 1: The last dropped reason, the camera lost power
typedef void (WINAPI* CAMERA_CONNECTION_STATUS_CALLBACK)(CameraHandle hCamera,UINT MSG,UINT uParam,PVOID pContext);
//////////////////////////////////////////////////////////////////////////
// Grabber <20><><EFBFBD><EFBFBD>
/// \~chinese Grabberͳ<72><CDB3><EFBFBD><EFBFBD>Ϣ
/// \~english Grabber statistics
typedef struct
{
int Width; ///< \~chinese ֡<><D6A1><EFBFBD><EFBFBD> \~english Frame image width
int Height; ///< \~chinese ֡<>߶<EFBFBD> \~english Frame image height
int Disp; ///< \~chinese <20><>ʾ֡<CABE><D6A1><EFBFBD><EFBFBD> \~english Display frame number
int Capture; ///< \~chinese <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>Ч֡<D0A7><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The number of valid frames collected
int Lost; ///< \~chinese <20><>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The number of dropped frames
int Error; ///< \~chinese <20><>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The number of error frames
float DispFps; ///< \~chinese <20><>ʾ֡<CABE><D6A1> \~english Display frame rate
float CapFps; ///< \~chinese <20><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1> \~english Capture frame rate
}tSdkGrabberStat;
/// @ingroup GRABBER_CB
/// \~chinese ͼ<>񲶻<EFBFBD><F1B2B6BB>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english Callback function definition for image capture
typedef void (__stdcall *pfnCameraGrabberFrameCallback)(
void* Grabber,
BYTE *pFrameBuffer,
tSdkFrameHead* pFrameHead,
void* Context);
/// @ingroup GRABBER_CB
/// \~chinese ֡<><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Grabber
/// \param [in] Phase ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׶<EFBFBD>
/// \param [in] pFrameBuffer ֡<><D6A1><EFBFBD><EFBFBD>
/// \param [in] pFrameHead ֡ͷ
/// \param [in] Context <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
/// \return 0:Grabber<65><72><EFBFBD><EFBFBD><E1B6AA><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׶<EFBFBD> 1:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>׶δ<D7B6><CEB4><EFBFBD>
/// \note ÿ<><C3BF>Grabber<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ֡ͼ<D6A1><CDBC>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD>׶<EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD>FrameListener
/// \note <20>׶<EFBFBD>0: RAW<41><57><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD>pFrameBuffer=Raw<61><77><EFBFBD><EFBFBD>
/// \note <20>׶<EFBFBD>1: <20><>ͼǰ<CDBC><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pFrameBuffer=RGB<47><42><EFBFBD><EFBFBD>
/// \note <20>׶<EFBFBD>2: <20><>ʾǰ<CABE><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>pFrameBuffer=RGB<47><42><EFBFBD><EFBFBD>
/// \note <20>ر<EFBFBD><D8B1>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߺ<EFBFBD><DFBA>˻ص<CBBB>Ҳ<EFBFBD><EFBFBD><E1B1BB><EFBFBD>ã<EFBFBD><C3A3><EFBFBD>ʱPhase=-1<><31>pFrameBuffer=NULL,pFrameHead=NULL<4C><4C>
/// \~english Frame listening function definition
/// \param [in] Grabber
/// \param [in] Phase image processing phase
/// \param [in] pFrameBuffer frame data
/// \param [in] pFrameHead Frame Header
/// \param [in] Context user data
/// \return 0: Grabber will discard this frame and end all subsequent processing stages for this frame 1: Continue to the next stage of processing
/// \note Whenever Grabber captures a frame of image, it will call FrameListener in turn in 3 stages.
/// \note Phase 0: RAW data processing, pFrameBuffer= Raw data
/// \note Phase 1: Screenshot pre-processing, pFrameBuffer=RGB data
/// \note Phase 2: Display preprocessing, pFrameBuffer=RGB data
/// \note In particular, this callback will be called when the camera is disconnected. At this time, Phase=-1, pFrameBuffer=NULL, and pFrameHead=NULL.
typedef int (__stdcall *pfnCameraGrabberFrameListener)(
void* Grabber,
int Phase,
BYTE *pFrameBuffer,
tSdkFrameHead* pFrameHead,
void* Context);
/// @ingroup GRABBER_SNAPSHOT
/// \~chinese <20>첽ץͼ<D7A5>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \warning Image<67><65>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> @link CameraImage_Destroy @endlink <20>ͷ<EFBFBD>
/// \~english Asynchronous snapshot callback function definition
/// \warning Image needs to call @link CameraImage_Destroy @endlink to release
typedef void (__stdcall *pfnCameraGrabberSaveImageComplete)(
void* Grabber,
void* Image, // <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>CameraImage_Destroy<6F>ͷ<EFBFBD>
CameraSdkStatus Status,
void* Context
);
/// @ingroup MV_MACRO_TYPE
/// @{
//----------------------------IMAGE FORMAT DEFINE------------------------------------
//----------------------------ͼ<><CDBC><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>-------------------------------------------
#define CAMERA_MEDIA_TYPE_MONO 0x01000000
#define CAMERA_MEDIA_TYPE_RGB 0x02000000
#define CAMERA_MEDIA_TYPE_COLOR 0x02000000
#define CAMERA_MEDIA_TYPE_CUSTOM 0x80000000
#define CAMERA_MEDIA_TYPE_COLOR_MASK 0xFF000000
#define CAMERA_MEDIA_TYPE_OCCUPY1BIT 0x00010000
#define CAMERA_MEDIA_TYPE_OCCUPY2BIT 0x00020000
#define CAMERA_MEDIA_TYPE_OCCUPY4BIT 0x00040000
#define CAMERA_MEDIA_TYPE_OCCUPY8BIT 0x00080000
#define CAMERA_MEDIA_TYPE_OCCUPY10BIT 0x000A0000
#define CAMERA_MEDIA_TYPE_OCCUPY12BIT 0x000C0000
#define CAMERA_MEDIA_TYPE_OCCUPY16BIT 0x00100000
#define CAMERA_MEDIA_TYPE_OCCUPY24BIT 0x00180000
#define CAMERA_MEDIA_TYPE_OCCUPY32BIT 0x00200000
#define CAMERA_MEDIA_TYPE_OCCUPY36BIT 0x00240000
#define CAMERA_MEDIA_TYPE_OCCUPY48BIT 0x00300000
#define CAMERA_MEDIA_TYPE_OCCUPY64BIT 0x00400000
#define CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_MASK 0x00FF0000
#define CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_SHIFT 16
#define CAMERA_MEDIA_TYPE_PIXEL_SIZE(type) (((type) & CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_MASK) >> CAMERA_MEDIA_TYPE_EFFECTIVE_PIXEL_SIZE_SHIFT)
#define CAMERA_MEDIA_TYPE_ID_MASK 0x0000FFFF
#define CAMERA_MEDIA_TYPE_COUNT 0x46
/*mono*/
#define CAMERA_MEDIA_TYPE_MONO1P (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY1BIT | 0x0037)
#define CAMERA_MEDIA_TYPE_MONO2P (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY2BIT | 0x0038)
#define CAMERA_MEDIA_TYPE_MONO4P (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY4BIT | 0x0039)
#define CAMERA_MEDIA_TYPE_MONO8 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0001)
#define CAMERA_MEDIA_TYPE_MONO8S (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0002)
#define CAMERA_MEDIA_TYPE_MONO10 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0003)
#define CAMERA_MEDIA_TYPE_MONO10_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0004)
#define CAMERA_MEDIA_TYPE_MONO12 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0005)
#define CAMERA_MEDIA_TYPE_MONO12_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0006)
#define CAMERA_MEDIA_TYPE_MONO14 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0025)
#define CAMERA_MEDIA_TYPE_MONO16 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0007)
/*Bayer */
#define CAMERA_MEDIA_TYPE_BAYGR8 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0008)
#define CAMERA_MEDIA_TYPE_BAYRG8 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x0009)
#define CAMERA_MEDIA_TYPE_BAYGB8 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000A)
#define CAMERA_MEDIA_TYPE_BAYBG8 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY8BIT | 0x000B)
#define CAMERA_MEDIA_TYPE_BAYGR10_MIPI (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0026)
#define CAMERA_MEDIA_TYPE_BAYRG10_MIPI (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0027)
#define CAMERA_MEDIA_TYPE_BAYGB10_MIPI (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0028)
#define CAMERA_MEDIA_TYPE_BAYBG10_MIPI (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY10BIT | 0x0029)
#define CAMERA_MEDIA_TYPE_BAYGR10 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000C)
#define CAMERA_MEDIA_TYPE_BAYRG10 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000D)
#define CAMERA_MEDIA_TYPE_BAYGB10 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000E)
#define CAMERA_MEDIA_TYPE_BAYBG10 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x000F)
#define CAMERA_MEDIA_TYPE_BAYGR12 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0010)
#define CAMERA_MEDIA_TYPE_BAYRG12 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0011)
#define CAMERA_MEDIA_TYPE_BAYGB12 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0012)
#define CAMERA_MEDIA_TYPE_BAYBG12 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0013)
#define CAMERA_MEDIA_TYPE_BAYGR10_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0026)
#define CAMERA_MEDIA_TYPE_BAYRG10_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0027)
#define CAMERA_MEDIA_TYPE_BAYGB10_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0028)
#define CAMERA_MEDIA_TYPE_BAYBG10_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0029)
#define CAMERA_MEDIA_TYPE_BAYGR12_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002A)
#define CAMERA_MEDIA_TYPE_BAYRG12_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002B)
#define CAMERA_MEDIA_TYPE_BAYGB12_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002C)
#define CAMERA_MEDIA_TYPE_BAYBG12_PACKED (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x002D)
#define CAMERA_MEDIA_TYPE_BAYGR16 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002E)
#define CAMERA_MEDIA_TYPE_BAYRG16 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x002F)
#define CAMERA_MEDIA_TYPE_BAYGB16 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0030)
#define CAMERA_MEDIA_TYPE_BAYBG16 (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0031)
/*RGB */
#define CAMERA_MEDIA_TYPE_RGB8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0014)
#define CAMERA_MEDIA_TYPE_BGR8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0015)
#define CAMERA_MEDIA_TYPE_RGBA8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0016)
#define CAMERA_MEDIA_TYPE_BGRA8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x0017)
#define CAMERA_MEDIA_TYPE_RGB10 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0018)
#define CAMERA_MEDIA_TYPE_BGR10 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0019)
#define CAMERA_MEDIA_TYPE_RGB12 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001A)
#define CAMERA_MEDIA_TYPE_BGR12 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x001B)
#define CAMERA_MEDIA_TYPE_RGB16 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0033)
#define CAMERA_MEDIA_TYPE_BGR16 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x004B)
#define CAMERA_MEDIA_TYPE_RGBA16 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY64BIT | 0x0064)
#define CAMERA_MEDIA_TYPE_BGRA16 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY64BIT | 0x0051)
#define CAMERA_MEDIA_TYPE_RGB10V1_PACKED (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001C)
#define CAMERA_MEDIA_TYPE_RGB10P32 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY32BIT | 0x001D)
#define CAMERA_MEDIA_TYPE_RGB12V1_PACKED (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY36BIT | 0X0034)
#define CAMERA_MEDIA_TYPE_RGB565P (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0035)
#define CAMERA_MEDIA_TYPE_BGR565P (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0X0036)
/*YUV and YCbCr*/
#define CAMERA_MEDIA_TYPE_YUV411_8_UYYVYY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x001E)
#define CAMERA_MEDIA_TYPE_YUV422_8_UYVY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x001F)
#define CAMERA_MEDIA_TYPE_YUV422_8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0032)
#define CAMERA_MEDIA_TYPE_YUV8_UYV (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0020)
#define CAMERA_MEDIA_TYPE_YCBCR8_CBYCR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003A)
//CAMERA_MEDIA_TYPE_YCBCR422_8 : YYYYCbCrCbCr
#define CAMERA_MEDIA_TYPE_YCBCR422_8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003B)
#define CAMERA_MEDIA_TYPE_YCBCR422_8_CBYCRY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0043)
#define CAMERA_MEDIA_TYPE_YCBCR411_8_CBYYCRYY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003C)
#define CAMERA_MEDIA_TYPE_YCBCR601_8_CBYCR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x003D)
#define CAMERA_MEDIA_TYPE_YCBCR601_422_8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x003E)
#define CAMERA_MEDIA_TYPE_YCBCR601_422_8_CBYCRY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0044)
#define CAMERA_MEDIA_TYPE_YCBCR601_411_8_CBYYCRYY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x003F)
#define CAMERA_MEDIA_TYPE_YCBCR709_8_CBYCR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0040)
#define CAMERA_MEDIA_TYPE_YCBCR709_422_8 (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0041)
#define CAMERA_MEDIA_TYPE_YCBCR709_422_8_CBYCRY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY16BIT | 0x0045)
#define CAMERA_MEDIA_TYPE_YCBCR709_411_8_CBYYCRYY (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0042)
/*RGB Planar */
#define CAMERA_MEDIA_TYPE_RGB8_PLANAR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY24BIT | 0x0021)
#define CAMERA_MEDIA_TYPE_RGB10_PLANAR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0022)
#define CAMERA_MEDIA_TYPE_RGB12_PLANAR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0023)
#define CAMERA_MEDIA_TYPE_RGB16_PLANAR (CAMERA_MEDIA_TYPE_COLOR | CAMERA_MEDIA_TYPE_OCCUPY48BIT | 0x0024)
/*MindVision 12bit packed bayer*/
#define CAMERA_MEDIA_TYPE_BAYGR12_PACKED_MV (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0060)
#define CAMERA_MEDIA_TYPE_BAYRG12_PACKED_MV (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0061)
#define CAMERA_MEDIA_TYPE_BAYGB12_PACKED_MV (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0062)
#define CAMERA_MEDIA_TYPE_BAYBG12_PACKED_MV (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0063)
/*MindVision 12bit packed monochome*/
#define CAMERA_MEDIA_TYPE_MONO12_PACKED_MV (CAMERA_MEDIA_TYPE_MONO | CAMERA_MEDIA_TYPE_OCCUPY12BIT | 0x0064)
/// @}
#endif

View File

@@ -0,0 +1,333 @@
#ifndef _MV_CAMERA_GRABBER_H_
#define _MV_CAMERA_GRABBER_H_
#include "CameraDefine.h"
#include "CameraStatus.h"
/// @ingroup GRABBER_CREATE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>û<EFBFBD>ѡ<EFBFBD><D1A1>Ҫ<EFBFBD>򿪵<EFBFBD><F2BFAAB5><EFBFBD><EFBFBD><EFBFBD>
/// \param [out] Grabber <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD>IJɼ<C4B2><C9BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> @link CameraInit @endlink <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD>ʹ<EFBFBD><CAB9> @link CameraGrabber_GetCameraHandle @endlink <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK API<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english
/// \brief Pop-up camera list allows the user to select the camera to open
/// \param [out] Grabber returns newly created grabber
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \note This function uses @link CameraInit @endlink internally to open the camera, so you can use @link CameraGrabber_GetCameraHandle @endlink to get the camera handle and use other SDK APIs to operate the camera.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_CreateFromDevicePage(
void** Grabber
);
/// @ingroup GRABBER_CREATE
/// \~chinese
/// \brief ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Grabber
/// \param [out] Grabber <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD>IJɼ<C4B2><C9BC><EFBFBD>
/// \param [in] Index <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> @link CameraInit @endlink <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD>ʹ<EFBFBD><CAB9> @link CameraGrabber_GetCameraHandle @endlink <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK API<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english
/// \brief Creating a Grabber Using a Camera List Index
/// \param [out] Grabber returns newly created grabber
/// \param [in] Index Camera index
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \note This function uses @link CameraInit @endlink internally to open the camera, so you can use @link CameraGrabber_GetCameraHandle @endlink to get the camera handle and use other SDK APIs to operate the camera.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_CreateByIndex(
void** Grabber,
int Index
);
/// @ingroup GRABBER_CREATE
/// \~chinese
/// \brief ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD>Grabber
/// \param [out] Grabber <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD>IJɼ<C4B2><C9BC><EFBFBD>
/// \param [in] Name <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>@link #tSdkCameraDevInfo.acFriendlyName @endlink
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> @link CameraInit @endlink <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD>ʹ<EFBFBD><CAB9> @link CameraGrabber_GetCameraHandle @endlink <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK API<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english
/// \brief Create a Grabber with a Camera Name
/// \param [out] Grabber returns newly created grabber
/// \param [in] Name Camera name.@link #tSdkCameraDevInfo.acFriendlyName @endlink
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \note This function uses @link CameraInit @endlink internally to open the camera, so you can use @link CameraGrabber_GetCameraHandle @endlink to get the camera handle and use other SDK APIs to operate the camera.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_CreateByName(
void** Grabber,
char* Name
);
/// @ingroup GRABBER_CREATE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD>Grabber
/// \param [out] Grabber <20><><EFBFBD><EFBFBD><EFBFBD>´<EFBFBD><C2B4><EFBFBD><EFBFBD>IJɼ<C4B2><C9BC><EFBFBD>
/// \param [in] pDevInfo <20><EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2>@link #CameraEnumerateDevice @endlink
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \note <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD> @link CameraInit @endlink <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF><EFBFBD>ʹ<EFBFBD><CAB9> @link CameraGrabber_GetCameraHandle @endlink <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SDK API<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english
/// \brief Create Grabber from device info
/// \param [out] Grabber returns newly created grabber
/// \param [in] pDevInfo device information. @link #CameraEnumerateDevice @endlink
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \note This function uses @link CameraInit @endlink internally to open the camera, so you can use @link CameraGrabber_GetCameraHandle @endlink to get the camera handle and use other SDK APIs to operate the camera.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_Create(
void** Grabber,
tSdkCameraDevInfo* pDevInfo
);
/// @ingroup GRABBER_DESTROY
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Grabber
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Destroy Grabber
/// \param [in] Grabber
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_Destroy(
void* Grabber
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] hWnd <20><>ʾ<EFBFBD><CABE><EFBFBD>ڵĴ<DAB5><C4B4>ھ<EFBFBD><DABE><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Set the preview video display window
/// \param [in] Grabber
/// \param [in] hWnd window handle of the display window
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetHWnd(
void* Grabber,
HWND hWnd
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Grabberȡͼʱʹ<CAB1>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ȼ<EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] Priority ȡͼ<C8A1><CDBC><EFBFBD>ȼ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>@link #emCameraGetImagePriority @endlink
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Sets the priority used by Grabber when fetching graphs
/// \param [in] Grabber
/// \param [in] Priority GetImageBuffer priority, For details see: @link #emCameraGetImagePriority @endlink
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetPriority(
void* Grabber,
UINT Priority
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><>ʼ<EFBFBD>ɼ<EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \note Grabber<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD>״̬<D7B4><CCAC><EFBFBD>ɼ<EFBFBD><C9BC>ص<EFBFBD><D8B5><EFBFBD>ץͼ<D7A5>ȹ<EFBFBD><C8B9>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english
/// \brief Start Grabber
/// \param [in] Grabber
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \note Grabber must enter the acquisition state, grab callbacks, snapshot and other functions in order to function properly
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_StartLive(
void* Grabber
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief ֹͣ<CDA3>ɼ<EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \warning <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD>лص<D0BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD><C5B7>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ڵȴ<DAB5>ʱ<EFBFBD><CAB1><EFBFBD>ɷ<EFBFBD>windows<77><73>Ϣ<EFBFBD><CFA2>
/// \~english
/// \brief Stop Grabber
/// \param [in] Grabber
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \warning This function will wait for all callbacks to end before returning to the caller,And it will dispatch windows messages while waiting.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_StopLive(
void* Grabber
);
/// @ingroup GRABBER_SNAPSHOT
/// \~chinese
/// \brief ͬ<><CDAC>ץͼ
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [out] Image <20><><EFBFBD><EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC> \note <20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>@link #CameraImage_Destroy @endlink<6E>ͷ<EFBFBD>
/// \param [in] TimeOut <20><>ʱʱ<CAB1><EFBFBD><E4A3A8><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Synchronized snapshot
/// \param [in] Grabber
/// \param [out] Image Returns Captured Image \note Need to Call @link #CameraImage_Destroy @endlink Release
/// \param [in] TimeOut Timeout (milliseconds)
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SaveImage(
void* Grabber,
void** Image,
DWORD TimeOut
);
/// @ingroup GRABBER_SNAPSHOT
/// \~chinese
/// \brief <20>һ<E1BDBB><D2BB><EFBFBD><EFBFBD><ECB2BD>ץͼ<D7A5><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>ץͼ<D7A5><CDBC><EFBFBD>ɻ<EFBFBD><C9BB>ص<EFBFBD><D8B5>û<EFBFBD><C3BB><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \see CameraGrabber_SetSaveImageCompleteCallback
/// \~english
/// \brief Submit an asynchronous snapshot request, complete the user's completion function after the completion of the submission.
/// \param [in] Grabber
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \see CameraGrabber_SetSaveImageCompleteCallback
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SaveImageAsync(
void* Grabber
);
/// @ingroup GRABBER_SNAPSHOT
/// \~chinese
/// \brief <20>һ<E1BDBB><D2BB><EFBFBD><EFBFBD><ECB2BD>ץͼ<D7A5><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>ץͼ<D7A5><CDBC><EFBFBD>ɻ<EFBFBD><C9BB>ص<EFBFBD><D8B5>û<EFBFBD><C3BB><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] UserData <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>ʹ<EFBFBD><CAB9> @link CameraImage_GetUserData @endlink <20><>Image<67><65>ȡ<EFBFBD><C8A1>ֵ
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \see CameraGrabber_SetSaveImageCompleteCallback
/// \~english
/// \brief Submit an asynchronous snapshot request, complete the user's completion function after the completion of the submission.
/// \param [in] Grabber
/// \param [in] UserData user data, which can be obtained from Image using @link CameraImage_GetUserData @endlink
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \see CameraGrabber_SetSaveImageCompleteCallback
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SaveImageAsyncEx(
void* Grabber,
void* UserData
);
/// @ingroup GRABBER_SNAPSHOT
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><ECB2BD>ʽץͼ<D7A5><CDBC><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD><C9BA><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] Callback <20><><EFBFBD>첽ץͼ<D7A5><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Context <20><>Callback<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Callback
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \see CameraGrabber_SaveImageAsync CameraGrabber_SaveImageAsyncEx
/// \~english
/// \brief Set the completion function of asynchronous mode snapshot
/// \param [in] Grabber
/// \param [in] Callback Callback is called when the asynchronous snapshot task completes
/// \param [in] Context Passed as a parameter when the Callback is invoked
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
/// \see CameraGrabber_SaveImageAsync CameraGrabber_SaveImageAsyncEx
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetSaveImageCompleteCallback(
void* Grabber,
pfnCameraGrabberSaveImageComplete Callback,
void* Context
);
/// @ingroup GRABBER_CB
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] Listener <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Context <20><>Listener<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Listener
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Set frame listening function
/// \param [in] Grabber
/// \param [in] Listener listener function
/// \param [in] Context Passed as a parameter when the Listener is invoked
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetFrameListener(
void* Grabber,
pfnCameraGrabberFrameListener Listener,
void* Context
);
/// @ingroup GRABBER_CB
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>RAW<41><57><EFBFBD>ݻص<DDBB><D8B5><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] Callback Raw<61>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Context <20><>Callback<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Callback
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Set RAW data callback function
/// \param [in] Grabber
/// \param [in] Callback Raw data callback function
/// \param [in] Context Passed as a parameter when the Callback is invoked
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetRawCallback(
void* Grabber,
pfnCameraGrabberFrameCallback Callback,
void* Context
);
/// @ingroup GRABBER_CB
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>RGB<47>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [in] Callback RGB<47>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Context <20><>Callback<63><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Callback
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Set RGB callback function
/// \param [in] Grabber
/// \param [in] Callback RGB data callback function
/// \param [in] Context Passed as a parameter when the Callback is invoked
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_SetRGBCallback(
void* Grabber,
pfnCameraGrabberFrameCallback Callback,
void* Context
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [out] hCamera <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Get camera handle
/// \param [in] Grabber
/// \param [out] hCamera returned camera handle
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_GetCameraHandle(
void* Grabber,
CameraHandle *hCamera
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><>ȡ֡ͳ<D6A1><CDB3><EFBFBD><EFBFBD>Ϣ
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [out] stat <20><><EFBFBD>ص<EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD>Ϣ
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Get frame statistics
/// \param [in] Grabber
/// \param [out] stat returned statistics
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_GetStat(
void* Grabber,
tSdkGrabberStat *stat
);
/// @ingroup GRABBER_CTRL
/// \~chinese
/// \brief <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>DevInfo
/// \param [in] Grabber <20>ɼ<EFBFBD><C9BC><EFBFBD>
/// \param [out] DevInfo <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>DevInfo
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Get Camera DevInfo
/// \param [in] Grabber
/// \param [out] DevInfo Returns Camera DevInfo
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraGrabber_GetCameraDevInfo(
void* Grabber,
tSdkCameraDevInfo *DevInfo
);
#endif // _MV_CAMERA_GRABBER_H_

View File

@@ -0,0 +1,380 @@
#ifndef _MV_CAMERA_IMAGE_H_
#define _MV_CAMERA_IMAGE_H_
#include "CameraDefine.h"
#include "CameraStatus.h"
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>µ<EFBFBD>Image
/// \param [out] Image <20>´<EFBFBD><C2B4><EFBFBD><EFBFBD><EFBFBD>ͼƬ
/// \param [in] pFrameBuffer ֡<><D6A1><EFBFBD><EFBFBD>
/// \param [in] pFrameHead ֡ͷ
/// \param [in] bCopy TRUE: <20><><EFBFBD>Ƴ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD>µ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD> FALSE: <20><><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD>ֱ<EFBFBD><D6B1>ʹ<EFBFBD><CAB9>pFrameBufferָ<72><D6B8><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Create a new Image
/// \param [out] Image Newly Created Image
/// \param [in] pFrameBuffer frame data
/// \param [in] pFrameHead Frame Header
/// \param [in] bCopy TRUE: Copy a new frame data FALSE: Do not copy, directly use the buffer pointed to by pFrameBuffer
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_Create(
void** Image,
BYTE *pFrameBuffer,
tSdkFrameHead* pFrameHead,
BOOL bCopy
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>յ<EFBFBD>Image
/// \param [out] Image <20>´<EFBFBD><C2B4><EFBFBD><EFBFBD><EFBFBD>ͼƬ
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Create an empty Image
/// \param [out] Image Newly Created Image
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_CreateEmpty(
void** Image
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image
/// \param [in] Image
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Destroy Image
/// \param [in] Image
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_Destroy(
void* Image
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>Image<67><65>ȡ֡<C8A1><D6A1><EFBFBD>ݺ<EFBFBD>֡ͷ
/// \param [in] Image
/// \param [out] DataBuffer ֡<><D6A1><EFBFBD><EFBFBD>
/// \param [out] Head ֡ͷ
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Get frame data and frame header from Image
/// \param [in] Image
/// \param [out] DataBuffer Frame Data
/// \param [out] Head header
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_GetData(
void* Image,
BYTE** DataBuffer,
tSdkFrameHead** Head
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>ȡImage<67><65><EFBFBD>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Image
/// \param [out] UserData <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Get User's Custom Data of Image
/// \param [in] Image
/// \param [out] UserData returns user-defined data
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_GetUserData(
void* Image,
void** UserData
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image<67><65><EFBFBD>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Image
/// \param [in] UserData <20>û<EFBFBD><C3BB>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Set user-defined data for Image
/// \param [in] Image
/// \param [in] UserData User-defined data
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_SetUserData(
void* Image,
void* UserData
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20>ж<EFBFBD>һ<EFBFBD><D2BB>Image<67>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA>
/// \param [in] Image
/// \param [out] IsEmpty Ϊ<>շ<EFBFBD><D5B7><EFBFBD>:TRUE(1) <20><><EFBFBD>򷵻<EFBFBD>:FALSE(0)
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Determine if an Image is empty
/// \param [in] Image
/// \param [out] IsEmpty Empty Returns: TRUE(1) Otherwise returns: FALSE(0)
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_IsEmpty(
void* Image,
BOOL* IsEmpty
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Image
/// \param [in] hWnd Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>
/// \param [in] Algorithm <20><><EFBFBD><EFBFBD><EFBFBD>㷨 0<><30><EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD> 1<><31><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Draw Image to the specified window
/// \param [in] Image
/// \param [in] hWnd destination window
/// \param [in] Algorithm scaling algorithm 0:fast but slightly worse quality 1:slower but better quality
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_Draw(
void* Image,
HWND hWnd,
int Algorithm
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] Image
/// \param [in] hWnd Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>
/// \param [in] Algorithm <20><><EFBFBD><EFBFBD><EFBFBD>㷨 0<><30><EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD> 1<><31><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Pull up drawing Image to the specified window
/// \param [in] Image
/// \param [in] hWnd destination window
/// \param [in] Algorithm scaling algorithm 0:fast but slightly worse quality 1:slower but better quality
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_DrawFit(
void* Image,
HWND hWnd,
int Algorithm
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8>DC
/// \param [in] Image
/// \param [in] hDC Ŀ<><C4BF>DC
/// \param [in] Algorithm <20><><EFBFBD><EFBFBD><EFBFBD>㷨 0<><30><EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD> 1<><31><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] xDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] yDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \param [in] cxDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĿ<CEB5><C4BF><EFBFBD>
/// \param [in] cyDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĸ߶<C4B8>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Draw Image to specified DC
/// \param [in] Image
/// \param [in] hDC destination DC
/// \param [in] Algorithm scaling algorithm 0:fast but slightly worse quality 1:slower but better quality
/// \param [in] xDst The X coordinate of the upper left corner of the target rectangle
/// \param [in] yDst The Y coordinate of the upper left corner of the target rectangle
/// \param [in] cxDst Width of target rectangle
/// \param [in] cyDst Height of target rectangle
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_DrawToDC(
void* Image,
HDC hDC,
int Algorithm,
int xDst,
int yDst,
int cxDst,
int cyDst
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8>DC
/// \param [in] Image
/// \param [in] hDC Ŀ<><C4BF>DC
/// \param [in] Algorithm <20><><EFBFBD><EFBFBD><EFBFBD>㷨 0<><30><EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD><D9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Բ<EFBFBD> 1<><31><EFBFBD>ٶ<EFBFBD><D9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \param [in] xDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] yDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \param [in] cxDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĿ<CEB5><C4BF><EFBFBD>
/// \param [in] cyDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĸ߶<C4B8>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Pull up drawing Image to specified DC
/// \param [in] Image
/// \param [in] hDC destination DC
/// \param [in] Algorithm scaling algorithm 0:fast but slightly worse quality 1:slower but better quality
/// \param [in] xDst The X coordinate of the upper left corner of the target rectangle
/// \param [in] yDst The Y coordinate of the upper left corner of the target rectangle
/// \param [in] cxDst Width of target rectangle
/// \param [in] cyDst Height of target rectangle
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_DrawToDCFit(
void* Image,
HDC hDC,
int Algorithm,
int xDst,
int yDst,
int cxDst,
int cyDst
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>
/// \param [in] Image
/// \param [in] hWnd Ŀ<>Ĵ<EFBFBD><C4B4><EFBFBD>
/// \param [in] xDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] yDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \param [in] cxDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĿ<CEB5><C4BF><EFBFBD>
/// \param [in] cyDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĸ߶<C4B8>
/// \param [in] xSrc ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] ySrc ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Draw Image to specified window (without scaling)
/// \param [in] Image
/// \param [in] hWnd destination window
/// \param [in] xDst The X coordinate of the upper left corner of the target rectangle
/// \param [in] yDst The Y coordinate of the upper left corner of the target rectangle
/// \param [in] cxDst Width of target rectangle
/// \param [in] cyDst Height of target rectangle
/// \param [in] xSrc X coordinate of the upper left corner of the image rectangle
/// \param [in] ySrc Y coordinate of the upper left corner of the image rectangle
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_BitBlt(
void* Image,
HWND hWnd,
int xDst,
int yDst,
int cxDst,
int cyDst,
int xSrc,
int ySrc
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><><EFBFBD><EFBFBD>Image<67><65>ָ<EFBFBD><D6B8>DC<44><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>
/// \param [in] Image
/// \param [in] hDC Ŀ<><C4BF>DC
/// \param [in] xDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] yDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \param [in] cxDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĿ<CEB5><C4BF><EFBFBD>
/// \param [in] cyDst Ŀ<><C4BF><EFBFBD><EFBFBD><EFBFBD>εĸ߶<C4B8>
/// \param [in] xSrc ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>X<EFBFBD><58><EFBFBD><EFBFBD>
/// \param [in] ySrc ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD><EFBFBD>Ͻ<EFBFBD>Y<EFBFBD><59><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Draw Image to specified DC (without scaling)
/// \param [in] Image
/// \param [in] hDC destination DC
/// \param [in] xDst The X coordinate of the upper left corner of the target rectangle
/// \param [in] yDst The Y coordinate of the upper left corner of the target rectangle
/// \param [in] cxDst Width of target rectangle
/// \param [in] cyDst Height of target rectangle
/// \param [in] xSrc X coordinate of the upper left corner of the image rectangle
/// \param [in] ySrc Y coordinate of the upper left corner of the image rectangle
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_BitBltToDC(
void* Image,
HDC hDC,
int xDst,
int yDst,
int cxDst,
int cyDst,
int xSrc,
int ySrc
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>bmp<6D><70>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Image
/// \param [in] Image
/// \param [in] FileName <20>ļ<EFBFBD><C4BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Save Image as bmp
/// \param [in] Image
/// \param [in] FileName file name
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_SaveAsBmp(
void* Image,
char const* FileName
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>jpg<70><67>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Image
/// \param [in] Image
/// \param [in] FileName <20>ļ<EFBFBD><C4BC><EFBFBD>
/// \param [in] Quality <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(1-100)<29><>100Ϊ<30><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѵ<EFBFBD><D1B5>ļ<EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Save Image as jpg
/// \param [in] Image
/// \param [in] FileName file name
/// \param [in] Quality save quality (1-100), 100 is the best quality but the file is also the largest
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_SaveAsJpeg(
void* Image,
char const* FileName,
BYTE Quality
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>png<6E><67>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Image
/// \param [in] Image
/// \param [in] FileName <20>ļ<EFBFBD><C4BC><EFBFBD>
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Save Image as png
/// \param [in] Image
/// \param [in] FileName file name
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_SaveAsPng(
void* Image,
char const* FileName
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>raw<61><77>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Image
/// \param [in] Image
/// \param [in] FileName <20>ļ<EFBFBD><C4BC><EFBFBD>
/// \param [in] Format 0: 8Bit Raw 1: 16Bit Raw
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Save Image as raw
/// \param [in] Image
/// \param [in] FileName file name
/// \param [in] Format 0: 8Bit Raw 1: 16Bit Raw
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_SaveAsRaw(
void* Image,
char const* FileName,
int Format
);
/// @ingroup MV_IMAGE
/// \~chinese
/// \brief <20><>Image<67><65><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>IPicture
/// \param [in] Image
/// \param [out] NewPic <20>´<EFBFBD><C2B4><EFBFBD><EFBFBD><EFBFBD>IPicture
/// \return <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD> CAMERA_STATUS_SUCCESS(0)<29><><EFBFBD><EFBFBD><EFBFBD>򷵻ط<F2B7B5BB><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ο<EFBFBD> CameraStatus.h <20>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6>
/// \~english
/// \brief Create an IPicture from an Image
/// \param [in] Image
/// \param [out] NewPic Newly created IPicture
/// \return Returns CAMERA_STATUS_SUCCESS(0) successfully. Otherwise, it returns a non-zero error code. Please refer to the definition of the error code in CameraStatus.h.
MVSDK_API CameraSdkStatus __stdcall CameraImage_IPicture(
void* Image,
IPicture** NewPic
);
#endif // _MV_CAMERA_IMAGE_H_

View File

@@ -0,0 +1,114 @@
#ifndef __CAMERA_STATUS_DEF__
#define __CAMERA_STATUS_DEF__
/// @ingroup MV_TYPEDEF
/// \~chinese SDK<44><4B><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// \~english SDK error code
typedef int CameraSdkStatus;
/*<2A><><EFBFBD>õĺ<C3B5>*/
#define SDK_SUCCESS(_FUC_) (_FUC_ == CAMERA_STATUS_SUCCESS)
#define SDK_UNSUCCESS(_FUC_) (_FUC_ != CAMERA_STATUS_SUCCESS)
#define SDK_UNSUCCESS_RETURN(_FUC_,RET) if((RET = _FUC_) != CAMERA_STATUS_SUCCESS)\
{\
return RET;\
}
#define SDK_UNSUCCESS_BREAK(_FUC_) if(_FUC_ != CAMERA_STATUS_SUCCESS)\
{\
break;\
}
/// @ingroup MV_MACRO_TYPE
/// @{
/* <20><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD> */
#define CAMERA_STATUS_SUCCESS 0 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD> \~english Successful
#define CAMERA_STATUS_FAILED -1 ///< \~chinese <20><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> \~english operation failed
#define CAMERA_STATUS_INTERNAL_ERROR -2 ///< \~chinese <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD> \~english internal error
#define CAMERA_STATUS_UNKNOW -3 ///< \~chinese δ֪<CEB4><D6AA><EFBFBD><EFBFBD> \~english unknown error
#define CAMERA_STATUS_NOT_SUPPORTED -4 ///< \~chinese <20><>֧<EFBFBD>ָù<D6B8><C3B9><EFBFBD> \~english Does not support this feature
#define CAMERA_STATUS_NOT_INITIALIZED -5 ///< \~chinese <20><>ʼ<EFBFBD><CABC>δ<EFBFBD><CEB4><EFBFBD><EFBFBD> \~english Incomplete initialization
#define CAMERA_STATUS_PARAMETER_INVALID -6 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч \~english Invalid argument
#define CAMERA_STATUS_PARAMETER_OUT_OF_BOUND -7 ///< \~chinese <20><><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD> \~english Out of bounds of parameters
#define CAMERA_STATUS_UNENABLED -8 ///< \~chinese δʹ<CEB4><CAB9> \~english Not enabled
#define CAMERA_STATUS_USER_CANCEL -9 ///< \~chinese <20>û<EFBFBD><C3BB>ֶ<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD>roi<6F><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english The user manually canceled, such as roi panel click cancel, return
#define CAMERA_STATUS_PATH_NOT_FOUND -10 ///< \~chinese ע<><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ӧ<EFBFBD><D3A6>·<EFBFBD><C2B7> \~english The corresponding path was not found in the registry
#define CAMERA_STATUS_SIZE_DISMATCH -11 ///< \~chinese <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3>ȺͶ<C8BA><CDB6><EFBFBD><EFBFBD>ijߴ粻ƥ<E7B2BB><C6A5> \~english The length of the obtained image data does not match the defined size
#define CAMERA_STATUS_TIME_OUT -12 ///< \~chinese <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD> \~english Timeout error
#define CAMERA_STATUS_IO_ERROR -13 ///< \~chinese Ӳ<><D3B2>IO<49><4F><EFBFBD><EFBFBD> \~english Hardware IO error
#define CAMERA_STATUS_COMM_ERROR -14 ///< \~chinese ͨѶ<CDA8><D1B6><EFBFBD><EFBFBD> \~english Communication error
#define CAMERA_STATUS_BUS_ERROR -15 ///< \~chinese <20><><EFBFBD>ߴ<EFBFBD><DFB4><EFBFBD> \~english Bus error
#define CAMERA_STATUS_NO_DEVICE_FOUND -16 ///< \~chinese û<>з<EFBFBD><D0B7><EFBFBD><EFBFBD>豸 \~english No device found
#define CAMERA_STATUS_NO_LOGIC_DEVICE_FOUND -17 ///< \~chinese δ<>ҵ<EFBFBD><D2B5>߼<EFBFBD><DFBC>豸 \~english Logical device not found
#define CAMERA_STATUS_DEVICE_IS_OPENED -18 ///< \~chinese <20><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD> \~english The device is already open
#define CAMERA_STATUS_DEVICE_IS_CLOSED -19 ///< \~chinese <20><EFBFBD>Ѿ<EFBFBD><D1BE>ر<EFBFBD> \~english Device is off
#define CAMERA_STATUS_DEVICE_VEDIO_CLOSED -20 ///< \~chinese û<>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD><E8B1B8>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>صĺ<D8B5><C4BA><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶû<C6B5>д򿪣<D0B4><F2BFAAA3><EFBFBD><EFBFBD>ط<EFBFBD><D8B7>ظô<D8B8><C3B4><EFBFBD><EFBFBD><EFBFBD> \~english Without opening the device video, when the video-related function is called, if the camera video is not open, the error is returned back.
#define CAMERA_STATUS_NO_MEMORY -21 ///< \~chinese û<><C3BB><EFBFBD>㹻ϵͳ<CFB5>ڴ<EFBFBD> \~english Not enough system memory
#define CAMERA_STATUS_FILE_CREATE_FAILED -22 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><CAA7> \~english Failed to create file
#define CAMERA_STATUS_FILE_INVALID -23 ///< \~chinese <20>ļ<EFBFBD><C4BC><EFBFBD>ʽ<EFBFBD><CABD>Ч \~english Invalid file format
#define CAMERA_STATUS_WRITE_PROTECTED -24 ///< \~chinese д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д \~english Write protection, not write
#define CAMERA_STATUS_GRAB_FAILED -25 ///< \~chinese <20><><EFBFBD>ݲɼ<DDB2>ʧ<EFBFBD><CAA7> \~english Data collection failed
#define CAMERA_STATUS_LOST_DATA -26 ///< \~chinese <20><><EFBFBD>ݶ<EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Loss of data, incomplete
#define CAMERA_STATUS_EOF_ERROR -27 ///< \~chinese δ<><CEB4><EFBFBD>յ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english No frame terminator received
#define CAMERA_STATUS_BUSY -28 ///< \~chinese <20><>æ(<28><>һ<EFBFBD>β<EFBFBD><CEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>˴β<CBB4><CEB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><DCBD><EFBFBD> \~english Busy (last operation is still in progress), this operation cannot be performed
#define CAMERA_STATUS_WAIT -29 ///< \~chinese <20><>Ҫ<EFBFBD>ȴ<EFBFBD>(<28><><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴγ<D9B4><CEB3><EFBFBD> \~english Need to wait (condition of operation is not established), can try again
#define CAMERA_STATUS_IN_PROCESS -30 ///< \~chinese <20><><EFBFBD>ڽ<EFBFBD><DABD>У<EFBFBD><D0A3>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Ongoing, has been operated
#define CAMERA_STATUS_IIC_ERROR -31 ///< \~chinese IIC<49><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english IIC transmission error
#define CAMERA_STATUS_SPI_ERROR -32 ///< \~chinese SPI<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english SPI transmission error
#define CAMERA_STATUS_USB_CONTROL_ERROR -33 ///< \~chinese USB<53><42><EFBFBD>ƴ<EFBFBD><C6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english USB control transmission error
#define CAMERA_STATUS_USB_BULK_ERROR -34 ///< \~chinese USB BULK<4C><4B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english USB BULK transmission error
#define CAMERA_STATUS_SOCKET_INIT_ERROR -35 ///< \~chinese <20><><EFBFBD><EFBFBD><E7B4AB><EFBFBD>׼<EFBFBD><D7BC><EFBFBD>ʼ<EFBFBD><CABC>ʧ<EFBFBD><CAA7> \~english Network Transport Suite Initialization Failed
#define CAMERA_STATUS_GIGE_FILTER_INIT_ERROR -36 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ں˹<DABA><CBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ<EFBFBD><C8B7>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>°<EFBFBD>װ<EFBFBD><D7B0> \~english The webcam kernel filter driver failed to initialize. Please check if the driver is installed correctly or reinstall it.
#define CAMERA_STATUS_NET_SEND_ERROR -37 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7>ʹ<EFBFBD><CDB4><EFBFBD> \~english Network data sending error
#define CAMERA_STATUS_DEVICE_LOST -38 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧȥ<CAA7><C8A5><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ⳬʱ \~english Lost connection with webcam, heartbeat timeout
#define CAMERA_STATUS_DATA_RECV_LESS -39 ///< \~chinese <20><><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Received fewer bytes than requested
#define CAMERA_STATUS_FUNCTION_LOAD_FAILED -40 ///< \~chinese <20><><EFBFBD>ļ<EFBFBD><C4BC>м<EFBFBD><D0BC>س<EFBFBD><D8B3><EFBFBD>ʧ<EFBFBD><CAA7> \~english Failed to load program from file
#define CAMERA_STATUS_CRITICAL_FILE_LOST -41 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>ʧ<EFBFBD><CAA7> \~english The file necessary to run the program is missing.
#define CAMERA_STATUS_SENSOR_ID_DISMATCH -42 ///< \~chinese <20>̼<EFBFBD><CCBC>ͳ<EFBFBD><CDB3><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD>䣬ԭ<E4A3AC><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD><EFBFBD>Ĺ̼<C4B9><CCBC><EFBFBD> \~english The firmware and program do not match because the wrong firmware was downloaded.
#define CAMERA_STATUS_OUT_OF_RANGE -43 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>Χ<EFBFBD><CEA7> \~english The parameter is out of valid range.
#define CAMERA_STATUS_REGISTRY_ERROR -44 ///< \~chinese <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>°<EFBFBD>װ<EFBFBD><D7B0><EFBFBD>򣬻<EFBFBD><F2A3ACBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD>װĿ¼Setup/Installer.exe \~english Setup registration error. Please reinstall the program, or run the installation directory Setup/Installer.exe
#define CAMERA_STATUS_ACCESS_DENY -45 ///< \~chinese <20><>ֹ<EFBFBD><D6B9><EFBFBD>ʡ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>״̬<D7B4><CCAC>(һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD>) \~english No Access. When the specified camera has been occupied by another program, it will return to this state if you request to access the camera. (A camera cannot be accessed simultaneously by multiple programs)
#define CAMERA_STATUS_CAMERA_NEED_RESET -46 ///< \~chinese <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5>󣬱<EFBFBD><F3A3ACB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>á<EFBFBD> \~english It means that the camera needs to be reset before it can be used normally. At this time, please make the camera power off and restart, or restart the operating system, then it can be used normally.
#define CAMERA_STATUS_ISP_MOUDLE_NOT_INITIALIZED -47 ///< \~chinese ISPģ<50><C4A3>δ<EFBFBD><CEB4>ʼ<EFBFBD><CABC> \~english ISP module is not initialized
#define CAMERA_STATUS_ISP_DATA_CRC_ERROR -48 ///< \~chinese <20><><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Data check error
#define CAMERA_STATUS_MV_TEST_FAILED -49 ///< \~chinese <20><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>ʧ<EFBFBD><CAA7> \~english Data test failed
#define CAMERA_STATUS_INTERNAL_ERR1 -50 ///< \~chinese <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>1 \~english Internal error 1
#define CAMERA_STATUS_U3V_NO_CONTROL_EP -51 ///< \~chinese U3V<33><56><EFBFBD>ƶ˵<C6B6>δ<EFBFBD>ҵ<EFBFBD> \~english U3V control endpoint not found
#define CAMERA_STATUS_U3V_CONTROL_ERROR -52 ///< \~chinese U3V<33><56><EFBFBD><EFBFBD>ͨѶ<CDA8><D1B6><EFBFBD><EFBFBD> \~english U3V control communication error
#define CAMERA_STATUS_INVALID_FRIENDLY_NAME -53 ///< \~chinese <20><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>(\/:*?"<>|") \~english Invalid device name, the name cannot contain the following characters (\/:*?"<>|")
//<2F><>AIA<49>ƶ<EFBFBD><C6B6>ı<EFBFBD>׼<EFBFBD><D7BC>ͬ
/*#define CAMERA_AIA_SUCCESS 0x0000 */
#define CAMERA_AIA_PACKET_RESEND 0x0100 ///< \~chinese <20><>֡<EFBFBD><D6A1>Ҫ<EFBFBD>ش<EFBFBD> \~english The frame needs to be retransmitted
#define CAMERA_AIA_NOT_IMPLEMENTED 0x8001 ///< \~chinese <20><EFBFBD><E8B1B8>֧<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD> \~english Device does not support commands
#define CAMERA_AIA_INVALID_PARAMETER 0x8002 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> \~english Illegal command parameters
#define CAMERA_AIA_INVALID_ADDRESS 0x8003 ///< \~chinese <20><><EFBFBD>ɷ<EFBFBD><C9B7>ʵĵ<CAB5>ַ \~english Inaccessible address
#define CAMERA_AIA_WRITE_PROTECT 0x8004 ///< \~chinese <20><><EFBFBD>ʵĶ<CAB5><C4B6>󲻿<EFBFBD>д \~english The accessed object cannot be written
#define CAMERA_AIA_BAD_ALIGNMENT 0x8005 ///< \~chinese <20><><EFBFBD>ʵĵ<CAB5>ַû<D6B7>а<EFBFBD><D0B0><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Visited address is not aligned as required
#define CAMERA_AIA_ACCESS_DENIED 0x8006 ///< \~chinese û<>з<EFBFBD><D0B7><EFBFBD>Ȩ<EFBFBD><C8A8> \~english No access
#define CAMERA_AIA_BUSY 0x8007 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD> \~english Command is processing
#define CAMERA_AIA_DEPRECATED 0x8008 ///< \~chinese 0x8008-0x0800B 0x800F <20><>ָ<EFBFBD><D6B8><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD> \~english 0x8008-0x0800B 0x800F This instruction has been deprecated
#define CAMERA_AIA_PACKET_UNAVAILABLE 0x800C ///< \~chinese <20><><EFBFBD><EFBFBD>Ч \~english Invalid package
#define CAMERA_AIA_DATA_OVERRUN 0x800D ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>Ҫ<EFBFBD>Ķ<EFBFBD> \~english Data overflow, usually more data than needed
#define CAMERA_AIA_INVALID_HEADER 0x800E ///< \~chinese <20><><EFBFBD>ݰ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>ijЩ<C4B3><D0A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD>鲻ƥ<E9B2BB><C6A5> \~english Some areas in the packet header do not match the protocol
#define CAMERA_AIA_PACKET_NOT_YET_AVAILABLE 0x8010 ///< \~chinese ͼ<><CDBC><EFBFBD>ְ<EFBFBD><D6B0><EFBFBD><EFBFBD>ݻ<EFBFBD>δ׼<CEB4><D7BC><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ģʽ<C4A3><CABD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʳ<EFBFBD>ʱ \~english Image packet data is not ready yet. It is mostly used in trigger mode. Application access timeout
#define CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY 0x8011 ///< \~chinese <20><>Ҫ<EFBFBD><D2AA><EFBFBD>ʵķְ<C4B7><D6B0>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD><DAA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Subcontracts that require access no longer exist. Mostly used for data retransmission is not in the buffer
#define CAMERA_AIA_PACKET_REMOVED_FROM_MEMORY 0x8012 ///< \~chinese CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY \~english CAMERA_AIA_PACKET_AND_PREV_REMOVED_FROM_MEMORY
#define CAMERA_AIA_NO_REF_TIME 0x0813 ///< \~chinese û<>вο<D0B2>ʱ<EFBFBD><CAB1>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>ʱ \~english There is no reference clock source. When used for time synchronization commands
#define CAMERA_AIA_PACKET_TEMPORARILY_UNAVAILABLE 0x0814 ///< \~chinese <20><><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A3AC>ǰ<EFBFBD>ְ<EFBFBD><D6B0><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD> \~english Due to channel bandwidth issues, the current subcontracting is temporarily unavailable and needs to be accessed later
#define CAMERA_AIA_OVERFLOW 0x0815 ///< \~chinese <20><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \~english Data overflow on the device, usually the queue is full
#define CAMERA_AIA_ACTION_LATE 0x0816 ///< \~chinese <20><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>ָ<EFBFBD><D6B8>ʱ<EFBFBD><CAB1> \~english Command execution has exceeded valid specified time
#define CAMERA_AIA_ERROR 0x8FFF ///< \~chinese <20><><EFBFBD><EFBFBD> \~english error
/// @} end of MV_MACRO_TYPE
#endif

View File

@@ -14,21 +14,22 @@ typedef unsigned int UINT;
typedef unsigned long long UINT64;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned int DWORD;
#define DWORD unsigned int
typedef void* PVOID;
typedef void* HWND;
typedef char* LPCTSTR;
#define HWND typedef void*
#define LPCTSTR char*
typedef unsigned short USHORT;
typedef short SHORT;
typedef unsigned char* LPBYTE;
typedef char CHAR;
typedef short WORD;
typedef INT HANDLE;
typedef void VOID;
#define WORD short
#define HANDLE INT
#define VOID void
typedef unsigned long ULONG;
typedef void** LPVOID;
#define LPVOID void**
typedef unsigned char UCHAR;
typedef void* HMODULE;
#define HMODULE void*
#define TRUE 1
#define FALSE 0

View File

@@ -14,7 +14,7 @@
#include <opencv2/imgproc/imgproc.hpp>
#include "camera/wrapper_head.h"
#include "camera/camera_api.h"
#include "camera/CameraApi.h"
class CameraWrapper: public WrapperHead {
private:

View File

@@ -6,7 +6,6 @@
#define _LOG_H_
#include <stdio.h>
#include <sys/time.h>
/************** Define the control code *************/
#define START_CTR "\033[0"
@@ -125,16 +124,28 @@
__FILE__, __LINE__, ##__VA_ARGS__)
/******************** the time counter API ************************/
#if LOG_LEVEL > LOG_NONE && (!defined(DO_NOT_CNT_TIME))
#define CNT_TIME(str_ctrs, tag, codes, ...) do{\
timeval ts, te; \
gettimeofday(&ts, NULL); \
#ifndef DO_NOT_CNT_TIME && LOG_LEVEL > LOG_NONE
#ifdef WIN32
#include <Windows.h>
#define CNT_TIME(tag, codes, ...) do{ \
static SYSTEMTIME ts, te; \
GetLocalTime(&ts); \
codes; \
gettimeofday(&te, NULL); \
LOGM(STR_CTR(str_ctrs, tag": %fms"), ## __VA_ARGS__, (te.tv_sec-ts.tv_sec)*1000.0 + (te.tv_usec-ts.tv_usec)/1000.0); \
}while(0)
GetLocalTime(&te); \
LOGM(tag": %dms", (te.wSecond-ts.wSecond)*1000+(te.wMilliseconds-ts.wMilliseconds)); \
}while (0)
#else
#include <sys/time.h>
#define CNT_TIME(tag, codes, ...) do{ \
static timeval ts, te; \
gettimeofday(&ts); \
codes; \
gettimeofday(&te); \
LOGM(tag": %.1lfms", (te.tv_sec-ts.tv_sec)*1000.0+(te.tv_usec-ts.tv_usec)/1000.0); \
}while (0)
#endif
#else
#define CNT_TIME(str_ctrs, tag, codes, ...) codes
#define CNT_TIME(tag, codes, ...) codes
#endif
#else /* _LOG_H_ */
#warning "Multiple include of log.h, some settings may not work."

View File

@@ -5,6 +5,7 @@
#ifndef _OPTIONS_H_
#define _OPTIONS_H_
#define PROJECT_DIR PATH
extern bool show_armor_box;
extern bool show_armor_boxes;

View File

@@ -0,0 +1,30 @@
#ifndef _SERIAL_H_
#define _SERIAL_H_
#include <Windows.h>
class Serial
{
public:
Serial(UINT portNo = 1, UINT baud = CBR_9600, char parity = 'N', UINT databits = 8, UINT stopsbits = 1, DWORD dwCommEvents = EV_RXCHAR);
~Serial();
bool InitPort(UINT portNo = 1, UINT baud = CBR_9600, char parity = 'N', UINT databits = 8, UINT stopsbits = 1, DWORD dwCommEvents = EV_RXCHAR);
UINT GetBytesInCOM() const ;
bool WriteData(const unsigned char* pData, unsigned int length);
bool ReadData(unsigned char* buffer, unsigned int length);
private:
bool openPort(UINT portNo);
void ClosePort();
void ErrorHandler();
private:
HANDLE hComm;
UINT portNo;
UINT baud;
char parity;
UINT databits;
UINT stopsbits;
DWORD dwCommEvents;
};
#endif /* _SERIAL_H_ */

View File

@@ -1,42 +0,0 @@
//
// Created by xixiliadorabarry on 1/24/19.
//
#ifndef STEREOVISION_UART_H
#define STEREOVISION_UART_H
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <time.h>
//#include <opencv2/core/core.hpp>
class Uart {
private:
int fd;
char buff[8];
int fps;
time_t cur_time;
int set_opt(int fd, int nSpeed, int nBits, char nEvent, int nStop);
public:
Uart();
void sendTarget(float x, float y ,float z);
uint8_t receive();
void receive_data();
};
#endif //STEREOVISION_UART_H

View File

@@ -4,6 +4,9 @@
#include <camera/camera_wrapper.h>
#include <log.h>
#include <options/options.h>
using namespace std;
using std::cout;
using std::endl;
@@ -22,20 +25,16 @@ CameraWrapper::CameraWrapper(int camera_mode, const std::string &n):
bool CameraWrapper::init() {
CameraSdkInit(1);
//枚举设备,并建立设备列表
int camera_enumerate_device_status = CameraEnumerateDevice(camera_enum_list, &camera_cnts);
if(camera_enumerate_device_status != CAMERA_STATUS_SUCCESS){
LOGE("CameraEnumerateDevice fail with %d!", camera_enumerate_device_status);
}
//没有连接设备
if (camera_cnts == 0) {
LOGE("No camera device detected!");
return false;
}else if(camera_cnts >= 1){
LOGM("%d camera device detected!", camera_cnts);
}
//相机初始化。初始化成功后,才能调用任何其他相机相关的操作接口
int i;
for(i=0; i<camera_cnts; i++){
camera_status = CameraInit(&camera_enum_list[i], -1, -1, &h_camera);
@@ -54,15 +53,26 @@ bool CameraWrapper::init() {
return false;
}
//获得相机的特性描述结构体。该结构体中包含了相机可设置的各种参数的范围信息。决定了相关函数的参数
CameraGetCapability(h_camera, &tCapability);
// set resolution to 320*240
// CameraSetImageResolution(hCamera, &(tCapability.pImageSizeDesc[2]));
auto status = CameraGetCapability(h_camera, &tCapability);
if (status != CAMERA_STATUS_SUCCESS) {
cout << "CameraGetCapability return error code " << status << endl;
return false;
}
rgb_buffer = (unsigned char *)malloc(tCapability.sResolutionRange.iHeightMax *
tCapability.sResolutionRange.iWidthMax * 3);
if(mode == 0){
char filepath[200];
sprintf_s(filepath, PROJECT_DIR"/others/%s.Config", name.data());
if (CameraReadParameterFromFile(h_camera, filepath) != CAMERA_STATUS_SUCCESS) {
LOGE("Load parameter %s from file fail!", filepath);
return false;
}
if (CameraLoadParameter(h_camera, PARAMETER_TEAM_A) != CAMERA_STATUS_SUCCESS) {
LOGE("CameraLoadParameter %s fail!", filepath);
return false;
}
LOGM("successfully loaded %s!", filepath);
/* if(mode == 0){
// 不使用自动曝光
CameraSetAeState(h_camera, false);
// 曝光时间10ms
@@ -71,7 +81,7 @@ bool CameraWrapper::init() {
CameraGetExposureTime(h_camera, &t);
LOGM("Exposure time: %lfms", t/1000.0);
// 模拟增益4
CameraSetAnalogGain(h_camera, 63);
CameraSetAnalogGain(h_camera, 64);
// 使用预设LUT表
CameraSetLutMode(h_camera, LUTMODE_PRESET);
// 抗频闪
@@ -83,7 +93,7 @@ bool CameraWrapper::init() {
// 抗频闪
// CameraSetAntiFlick(h_camera, true);
}
*/
/*让SDK进入工作模式开始接收来自相机发送的图像
数据。如果当前相机是触发模式,则需要接收到
触发帧以后才会更新图像。 */
@@ -95,7 +105,7 @@ bool CameraWrapper::init() {
CameraSetGamma、CameraSetContrast、CameraSetGain等设置图像伽马、对比度、RGB数字增益等等。
CameraGetFriendlyName CameraSetFriendlyName 获取/设置相机名称(该名称可写入相机硬件)
*/
cout << tCapability.sIspCapacity.bMonoSensor << endl;
if (tCapability.sIspCapacity.bMonoSensor) {
channel = 1;
CameraSetIspOutFormat(h_camera, CAMERA_MEDIA_TYPE_MONO8);
@@ -140,18 +150,15 @@ bool CameraWrapper::readRaw(cv::Mat &src) {
}
bool CameraWrapper::readProcessed(cv::Mat &src) {
// cerr << "Get-1" << endl;
if (CameraGetImageBuffer(h_camera, &frame_info, &pby_buffer, 1000) == CAMERA_STATUS_SUCCESS){
CameraImageProcess(h_camera, pby_buffer, rgb_buffer, &frame_info); // this function is super slow, better not to use it.
if (iplImage) {
cvReleaseImageHeader(&iplImage);
}
iplImage = cvCreateImageHeader(cvSize(frame_info.iWidth, frame_info.iHeight), IPL_DEPTH_8U, channel);
cvSetData(iplImage, rgb_buffer, frame_info.iWidth * channel); //此处只是设置指针,无图像块数据拷贝,不需担心转换效率
src = cv::cvarrToMat(iplImage).clone();
//在成功调用CameraGetImageBuffer后必须调用CameraReleaseImageBuffer来释放获得的buffer。
//否则再次调用CameraGetImageBuffer时程序将被挂起一直阻塞直到其他线程中调用CameraReleaseImageBuffer来释放了buffer
CameraReleaseImageBuffer(h_camera, pby_buffer);

View File

@@ -0,0 +1,170 @@
#include <serial/serial.h>
#include <options/options.h>
#include <log.h>
using namespace std;
#include <iostream>
Serial::Serial(UINT portNo, UINT baud, char parity, UINT databits, UINT stopsbits, DWORD dwCommEvents) :
hComm(INVALID_HANDLE_VALUE),
portNo(portNo),
parity(parity),
databits(databits),
stopsbits(stopsbits),
dwCommEvents(dwCommEvents){
if (wait_uart) {
LOGM("Waiting for serial COM%d", portNo);
while (InitPort(portNo, baud, parity, databits, stopsbits, dwCommEvents) == false);
LOGM("Port COM%d open success!", portNo);
} else {
if (InitPort(portNo, baud, parity, databits, stopsbits, dwCommEvents)) {
LOGM("Port COM%d open success!", portNo);
} else {
LOGE("Port COM%d open fail!", portNo);
}
}
}
Serial::~Serial() {
ClosePort();
}
void Serial::ErrorHandler() {
if (wait_uart) {
LOGE("Serial COM%d offline, waiting for serial COM%d", portNo, portNo);
while (InitPort(portNo, baud, parity, databits, stopsbits, dwCommEvents) == false);
LOGM("Port COM%d reopen success!", portNo);
}
}
bool Serial::openPort(UINT portNo) {
char szPort[50];
sprintf_s(szPort, "COM%d", portNo);
/** <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD> */
hComm = CreateFileA(szPort, /** <20><EFBFBD><E8B1B8>,COM1,COM2<4D><32> */
GENERIC_READ | GENERIC_WRITE, /** <20><><EFBFBD><EFBFBD>ģʽ,<2C><>ͬʱ<CDAC><CAB1>д */
0, /** <20><><EFBFBD><EFBFBD>ģʽ,0<><30>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
NULL, /** <20><>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,һ<><D2BB>ʹ<EFBFBD><CAB9>NULL */
OPEN_EXISTING, /** <20>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><E8B1B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>򴴽<EFBFBD>ʧ<EFBFBD><CAA7> */
0,
0);
return hComm != INVALID_HANDLE_VALUE;
}
void Serial::ClosePort() {
/** <20><><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ڱ<EFBFBD><DAB1>򿪣<EFBFBD><F2BFAAA3>ر<EFBFBD><D8B1><EFBFBD> */
if (hComm != INVALID_HANDLE_VALUE) {
CloseHandle(hComm);
hComm = INVALID_HANDLE_VALUE;
}
}
bool Serial::InitPort(UINT portNo, UINT baud, char parity, UINT databits, UINT stopsbits, DWORD dwCommEvents) {
/** <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>,<2C><><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ʽ,<2C>Թ<EFBFBD><D4B9><EFBFBD>DCB<43>ṹ */
char szDCBparam[50];
sprintf_s(szDCBparam, "baud=%d parity=%c data=%d stop=%d", baud, parity, databits, stopsbits);
if (!openPort(portNo)){
cout << "open error!" << endl;
return false;
}
BOOL bIsSuccess = TRUE;
COMMTIMEOUTS CommTimeouts;
CommTimeouts.ReadIntervalTimeout = 0;
CommTimeouts.ReadTotalTimeoutMultiplier = 0;
CommTimeouts.ReadTotalTimeoutConstant = 0;
CommTimeouts.WriteTotalTimeoutMultiplier = 0;
CommTimeouts.WriteTotalTimeoutConstant = 0;
if (bIsSuccess) {
bIsSuccess = SetCommTimeouts(hComm, &CommTimeouts);
} else {
cout << "SetCommTimeouts error!" << endl;
}
DCB dcb;
if (bIsSuccess) {
/** <20><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>,<2C><><EFBFBD>ҹ<EFBFBD><D2B9><EFBFBD><ECB4AE>DCB<43><42><EFBFBD><EFBFBD> */
bIsSuccess = GetCommState(hComm, &dcb);
bIsSuccess = BuildCommDCB(szDCBparam, &dcb);
if (!bIsSuccess) {
cout << "Create dcb fail with "<< GetLastError() << endl;
}
/** <20><><EFBFBD><EFBFBD>RTS flow<6F><77><EFBFBD><EFBFBD> */
dcb.fRtsControl = RTS_CONTROL_ENABLE;
}
if (bIsSuccess) {
/** ʹ<><CAB9>DCB<43><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD>״̬ */
bIsSuccess = SetCommState(hComm, &dcb);
if (!bIsSuccess) {
cout << "SetCommState error!" << endl;
}
}
/** <20><><EFBFBD>մ<EFBFBD><D5B4>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD> */
PurgeComm(hComm, PURGE_RXCLEAR | PURGE_TXCLEAR | PURGE_RXABORT | PURGE_TXABORT);
return bIsSuccess;
}
UINT Serial::GetBytesInCOM() const {
DWORD dwError = 0; /** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
COMSTAT comstat; /** COMSTAT<41><EFBFBD><E1B9B9>,<2C><>¼ͨ<C2BC><CDA8><EFBFBD><EFBFBD><E8B1B8>״̬<D7B4><CCAC>Ϣ */
memset(&comstat, 0, sizeof(COMSTAT));
UINT BytesInQue = 0;
/** <20>ڵ<EFBFBD><DAB5><EFBFBD>ReadFile<6C><65>WriteFile֮ǰ,ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>־ */
if (ClearCommError(hComm, &dwError, &comstat)) {
BytesInQue = comstat.cbInQue; /** <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBBBBA><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5>ֽ<EFBFBD><D6BD><EFBFBD> */
}
return BytesInQue;
}
bool Serial::WriteData(const unsigned char* pData, unsigned int length) {
if (hComm == INVALID_HANDLE_VALUE) {
ErrorHandler();
return false;
}
/** <20>򻺳<EFBFBD><F2BBBAB3><EFBFBD>д<EFBFBD><D0B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
BOOL bResult = TRUE;
DWORD BytesToSend = 0;
bResult = WriteFile(hComm, pData, length, &BytesToSend, NULL);
if (!bResult) {
DWORD dwError = GetLastError();
/** <20><><EFBFBD>մ<EFBFBD><D5B4>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD> */
PurgeComm(hComm, PURGE_RXCLEAR | PURGE_RXABORT);
ErrorHandler();
return false;
}
return true;
}
bool Serial::ReadData(unsigned char *buffer, unsigned int length) {
if (hComm == INVALID_HANDLE_VALUE) {
ErrorHandler();
return false;
}
/** <20>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡlength<74>ֽڵ<D6BD><DAB5><EFBFBD><EFBFBD><EFBFBD> */
BOOL bResult = TRUE;
DWORD totalRead = 0, onceRead = 0;
while (totalRead < length) {
bResult = ReadFile(hComm, buffer, length-totalRead, &onceRead, NULL);
totalRead += onceRead;
if ((!bResult)) {
/** <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>Ը<EFBFBD><D4B8>ݸô<DDB8><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD> */
DWORD dwError = GetLastError();
/** <20><><EFBFBD>մ<EFBFBD><D5B4>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD> */
PurgeComm(hComm, PURGE_RXCLEAR | PURGE_RXABORT);
ErrorHandler();
return false;
}
}
return bResult;
}

View File

@@ -1,183 +0,0 @@
//
// Created by xixiliadorabarry on 1/24/19.
//
#include <uart/uart.h>
#include <energy/param_struct_define.h>
#include <options/options.h>
#include <log.h>
using namespace std;
GMAngle_t aim;
string get_uart_dev_name(){
FILE* ls = popen("ls /dev/ttyUSB* --color=never", "r");
char name[20] = {0};
fscanf(ls, "%s", name);
return name;
}
Uart::Uart(){
if(wait_uart){
string name;
do{
name = get_uart_dev_name();
if(name == ""){
continue;
}
}while((fd=open(name.data(), O_RDWR)) < 0);
}else{
string name = get_uart_dev_name();
if(name == ""){
cerr<<"open port error"<<endl;
return;
}
fd = open(name.data(), O_RDWR);
if(fd < 0) {
cerr<<"open port error"<<endl;
return;
}
}
// fd = open("/dev/ttyUSB1", O_RDWR);
// if(fd < 0) {
// cerr<<"open port error"<<endl;
// return;
// }
if(set_opt(fd, 115200, 8, 'N', 1) < 0 )
{
cerr<<"set opt error"<<endl;
return;
}
cout << "uart port success" << endl;
buff[0] = 's';
buff[1] = '+';
buff[2] = (0 >> 8) & 0xFF;
buff[3] = 0 & 0xFF;
buff[4] = '+';
buff[5] = (0 >> 8) & 0xFF;
buff[6] = (0 & 0xFF);
buff[7] = 'e';
fps = 0;
cur_time = time(nullptr);
}
int Uart::set_opt(int fd, int nSpeed, int nBits, char nEvent, int nStop) {
termios newtio{}, oldtio{};
if (tcgetattr(fd, &oldtio) != 0) {
perror("SetupSerial 1");
return -1;
}
bzero(&newtio, sizeof(newtio));
newtio.c_cflag |= CLOCAL | CREAD;
newtio.c_cflag &= ~CSIZE;
switch (nBits) {
case 7:
newtio.c_cflag |= CS7;break;
case 8:
newtio.c_cflag |= CS8;break;
default:break;
}
switch (nEvent) {
case 'O': //奇校验
newtio.c_cflag |= PARENB;
newtio.c_cflag |= PARODD;
newtio.c_iflag |= (INPCK | ISTRIP);
break;
case 'E': //偶校验
newtio.c_iflag |= (INPCK | ISTRIP);
newtio.c_cflag |= PARENB;
newtio.c_cflag &= ~PARODD;
break;
case 'N': //无校验
newtio.c_cflag &= ~PARENB;
break;
default:break;
}
switch (nSpeed) {
case 2400:
cfsetispeed(&newtio, B2400);
cfsetospeed(&newtio, B2400);
break;
case 4800:
cfsetispeed(&newtio, B4800);
cfsetospeed(&newtio, B4800);
break;
case 9600:
cfsetispeed(&newtio, B9600);
cfsetospeed(&newtio, B9600);
break;
case 115200:
cfsetispeed(&newtio, B115200);
cfsetospeed(&newtio, B115200);
break;
default:
cfsetispeed(&newtio, B9600);
cfsetospeed(&newtio, B9600);
break;
}
if (nStop == 1) {
newtio.c_cflag &= ~CSTOPB;
} else if (nStop == 2) {
newtio.c_cflag |= CSTOPB;
}
newtio.c_cc[VTIME] = 0;
newtio.c_cc[VMIN] = 0;
tcflush(fd, TCIFLUSH);
if ((tcsetattr(fd, TCSANOW, &newtio)) != 0) {
perror("com set error");
return -1;
}
printf("set done!\n");
return 0;
}
void Uart::sendTarget(float x, float y, float z) {
static short x_tmp, y_tmp, z_tmp;
time_t t = time(nullptr);
if(cur_time != t)
{
cur_time = t;
cout<<"fps:"<<fps<<", ("<<x<<","<<y<<","<<z<<")"<<endl;
fps = 0;
}
fps += 1;
x_tmp= static_cast<short>(x * (32768 - 1) / 100);
y_tmp= static_cast<short>(y * (32768 - 1) / 100);
z_tmp= static_cast<short>(z * (32768 - 1) / 1000);
buff[0] = 's';
buff[1] = static_cast<char>((x_tmp >> 8) & 0xFF);
buff[2] = static_cast<char>((x_tmp >> 0) & 0xFF);
buff[3] = static_cast<char>((y_tmp >> 8) & 0xFF);
buff[4] = static_cast<char>((y_tmp >> 0) & 0xFF);
buff[5] = static_cast<char>((z_tmp >> 8) & 0xFF);
buff[6] = static_cast<char>((z_tmp >> 0) & 0xFF);
buff[7] = 'e';
int cnt=0;
while((cnt+=write(fd, buff+cnt, 8-cnt))!=-1 && cnt<8);
if(cnt==-1 && wait_uart){
LOGE("Uart send fail, the uart device may offline! Restart!");
exit(-1);
}
}
uint8_t Uart::receive() {
uint8_t data;
while(read(fd, &data, 1) < 1);
return data;
}

53
tools/monitor.bat Normal file
View File

@@ -0,0 +1,53 @@
@echo off
rem <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><C9B8><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>
set AppName=run.exe
set AppArgs= --run-with-camera --wait-uart --show-armor-box
set AppPath=C:\Users\sjturm\Desktop\AutoAim\build\Release\
title <20><><EFBFBD>̼<EFBFBD><CCBC><EFBFBD>
cls
echo.
echo <20><><EFBFBD>̼<EFBFBD><CCBC>ؿ<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
echo.
rem <20><><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD><EFBFBD>
:startjc
rem <20>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD>б<EFBFBD><D0B1>в<EFBFBD><D0B2><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
rem <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2>д<EFBFBD><D0B4> qprocess %AppName% >nul <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9B7A2><EFBFBD>󲹳䣩
qprocess|findstr /i %AppName% >nul
rem <20><><EFBFBD><EFBFBD>errorlevel<65><6C>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>0<EFBFBD><30>ʾ<EFBFBD><CABE><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD>̣<EFBFBD><CCA3><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>в<EFBFBD><D0B2>ҵ<EFBFBD><D2B5><EFBFBD><EFBFBD><EFBFBD>
if %errorlevel%==0 (
echo ^>%date:~0,10% %time:~0,8% <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>
)else (
echo ^>%date:~0,10% %time:~0,8% û<>з<EFBFBD><D0B7>ֳ<EFBFBD><D6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
echo ^>%date:~0,10% %time:~0,8% <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
start %AppPath%%AppName%%AppArgs% 2>nul && echo ^>%date:~0,10% %time:~0,8% <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>
)
rem <20><>ping<6E><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
ping -n 2 -w 1000 1.1.1.1>nul
goto startjc
echo on