feat: 完成控制代码编写
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "page_ui_widget.h"
|
||||
#include "zf_common_headfile.h"
|
||||
#include "gl_data.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief 绘制光标
|
||||
@@ -137,57 +137,57 @@ void Set_Vaule(ITEM *item, uint8_t item_num, float step)
|
||||
// }
|
||||
}
|
||||
|
||||
void Show_Marked_Image(void)
|
||||
{
|
||||
#define IMAGE_DISPLAY_WIDTH (230U)
|
||||
#define IMAGE_DISPLAY_HEIGHT (146U)
|
||||
#define START_X ((240U - IMAGE_DISPLAY_WIDTH) / 2U)
|
||||
#define START_Y (16U)
|
||||
// void Show_Marked_Image(void)
|
||||
// {
|
||||
// #define IMAGE_DISPLAY_WIDTH (230U)
|
||||
// #define IMAGE_DISPLAY_HEIGHT (146U)
|
||||
// #define START_X ((240U - IMAGE_DISPLAY_WIDTH) / 2U)
|
||||
// #define START_Y (16U)
|
||||
|
||||
float horizontal_zoom_rate = ((float)(IMAGE_DISPLAY_WIDTH)) / ((float)(MT9V03X_W));
|
||||
float vertical_zoom_rate = ((float)(IMAGE_DISPLAY_HEIGHT)) / ((float)(MT9V03X_H));
|
||||
// float horizontal_zoom_rate = ((float)(IMAGE_DISPLAY_WIDTH)) / ((float)(MT9V03X_W));
|
||||
// float vertical_zoom_rate = ((float)(IMAGE_DISPLAY_HEIGHT)) / ((float)(MT9V03X_H));
|
||||
|
||||
ips200_show_gray_image(START_X, START_Y, mt9v03x_image_copy[0], MT9V03X_W, MT9V03X_H, IMAGE_DISPLAY_WIDTH, IMAGE_DISPLAY_HEIGHT, 0);
|
||||
ips200_draw_frame(START_X - 3, START_Y - 3, START_X + IMAGE_DISPLAY_WIDTH + 2, START_Y + IMAGE_DISPLAY_HEIGHT + 2, 2, RGB565_BLUE);
|
||||
// 确认边线数组在显示前不会清空
|
||||
for (uint i = 0; i < PT_MAXLEN; i++) {
|
||||
//寻近线逆透视后边线数组
|
||||
uint16_t l_x = START_X + (uint16_t)((float)pts_inv_r[i][1] * horizontal_zoom_rate);
|
||||
uint16_t l_y = START_Y + (uint16_t)((float)pts_inv_r[i][0] * vertical_zoom_rate);
|
||||
uint16_t r_x = START_X + (uint16_t)((float)pts_inv_l[i][1] * horizontal_zoom_rate);
|
||||
uint16_t r_y = START_Y + (uint16_t)((float)pts_inv_l[i][0] * vertical_zoom_rate);
|
||||
//寻远线逆透视后边线数组
|
||||
uint16_t far_l_x = START_X + (uint16_t)((float)pts_far_inv_r[i][1] * horizontal_zoom_rate);
|
||||
uint16_t far_l_y = START_Y + (uint16_t)((float)pts_far_inv_r[i][0] * vertical_zoom_rate);
|
||||
uint16_t far_r_x = START_X + (uint16_t)((float)pts_far_inv_l[i][1] * horizontal_zoom_rate);
|
||||
uint16_t far_r_y = START_Y + (uint16_t)((float)pts_far_inv_l[i][0] * vertical_zoom_rate);
|
||||
//寻近线中线数组
|
||||
uint16_t mid_x_l = START_X + (uint16_t)(mid_left[i][1] * horizontal_zoom_rate);
|
||||
uint16_t mix_y_l = START_Y + (uint16_t)(mid_left[i][0] * vertical_zoom_rate);
|
||||
uint16_t mid_x_r = START_X + (uint16_t)(mid_right[i][1] * horizontal_zoom_rate);
|
||||
uint16_t mix_y_r = START_Y + (uint16_t)(mid_right[i][0] * vertical_zoom_rate);
|
||||
// ips200_show_gray_image(START_X, START_Y, mt9v03x_image_copy[0], MT9V03X_W, MT9V03X_H, IMAGE_DISPLAY_WIDTH, IMAGE_DISPLAY_HEIGHT, 0);
|
||||
// ips200_draw_frame(START_X - 3, START_Y - 3, START_X + IMAGE_DISPLAY_WIDTH + 2, START_Y + IMAGE_DISPLAY_HEIGHT + 2, 2, RGB565_BLUE);
|
||||
// // 确认边线数组在显示前不会清空
|
||||
// for (uint i = 0; i < PT_MAXLEN; i++) {
|
||||
// //寻近线逆透视后边线数组
|
||||
// uint16_t l_x = START_X + (uint16_t)((float)pts_inv_r[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t l_y = START_Y + (uint16_t)((float)pts_inv_r[i][0] * vertical_zoom_rate);
|
||||
// uint16_t r_x = START_X + (uint16_t)((float)pts_inv_l[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t r_y = START_Y + (uint16_t)((float)pts_inv_l[i][0] * vertical_zoom_rate);
|
||||
// //寻远线逆透视后边线数组
|
||||
// uint16_t far_l_x = START_X + (uint16_t)((float)pts_far_inv_r[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t far_l_y = START_Y + (uint16_t)((float)pts_far_inv_r[i][0] * vertical_zoom_rate);
|
||||
// uint16_t far_r_x = START_X + (uint16_t)((float)pts_far_inv_l[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t far_r_y = START_Y + (uint16_t)((float)pts_far_inv_l[i][0] * vertical_zoom_rate);
|
||||
// //寻近线中线数组
|
||||
// uint16_t mid_x_l = START_X + (uint16_t)(mid_left[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t mix_y_l = START_Y + (uint16_t)(mid_left[i][0] * vertical_zoom_rate);
|
||||
// uint16_t mid_x_r = START_X + (uint16_t)(mid_right[i][1] * horizontal_zoom_rate);
|
||||
// uint16_t mix_y_r = START_Y + (uint16_t)(mid_right[i][0] * vertical_zoom_rate);
|
||||
|
||||
//近线数组显示
|
||||
ips200_draw_rect(l_x, l_y, l_x + 2, l_y, RGB565_RED);
|
||||
ips200_draw_rect(r_x - 2, r_y, r_x, r_y, RGB565_BLUE);
|
||||
// //近线数组显示
|
||||
// ips200_draw_rect(l_x, l_y, l_x + 2, l_y, RGB565_RED);
|
||||
// ips200_draw_rect(r_x - 2, r_y, r_x, r_y, RGB565_BLUE);
|
||||
|
||||
//远线数组显示
|
||||
//ips200_draw_rect(far_l_x, far_l_y, far_l_x + 2, far_l_y, RGB565_RED);
|
||||
//ips200_draw_rect(far_r_x - 2, far_r_y, far_r_x, far_r_y, RGB565_BLUE);
|
||||
// //远线数组显示
|
||||
// //ips200_draw_rect(far_l_x, far_l_y, far_l_x + 2, far_l_y, RGB565_RED);
|
||||
// //ips200_draw_rect(far_r_x - 2, far_r_y, far_r_x, far_r_y, RGB565_BLUE);
|
||||
|
||||
//中线数组显示
|
||||
ips200_draw_rect(mid_x_l, mix_y_l, mid_x_l + 2, mix_y_l, RGB565_BLACK);
|
||||
ips200_draw_rect(mid_x_r, mix_y_r, mid_x_r + 2, mix_y_r, RGB565_BLUE);
|
||||
// //中线数组显示
|
||||
// ips200_draw_rect(mid_x_l, mix_y_l, mid_x_l + 2, mix_y_l, RGB565_BLACK);
|
||||
// ips200_draw_rect(mid_x_r, mix_y_r, mid_x_r + 2, mix_y_r, RGB565_BLUE);
|
||||
|
||||
// ips200_draw_point(START_X + (uint16_t)((float)pts_right[i][1] * horizontal_zoom_rate), START_Y + (uint16_t)((float)pts_right[i][0] * vertical_zoom_rate), RGB565_GREEN);
|
||||
// ips200_draw_point(START_X + (uint16_t)((float)pts_right[i][1] * horizontal_zoom_rate) - 1, START_Y + (uint16_t)((float)pts_right[i][0] * vertical_zoom_rate), RGB565_GREEN);
|
||||
// ips200_draw_point(START_X + (uint16_t)((float)pts_left[i][1] * horizontal_zoom_rate), START_Y + (uint16_t)((float)pts_left[i][0] * vertical_zoom_rate), RGB565_YELLOW);
|
||||
// ips200_draw_point(START_X + (uint16_t)((float)pts_left[i][1] * horizontal_zoom_rate) + 1, START_Y + (uint16_t)((float)pts_left[i][0] * vertical_zoom_rate), RGB565_YELLOW);
|
||||
}
|
||||
#undef IMAGE_DISPLAY_WIDTH
|
||||
#undef START_X
|
||||
#undef START_Y
|
||||
}
|
||||
// // ips200_draw_point(START_X + (uint16_t)((float)pts_right[i][1] * horizontal_zoom_rate), START_Y + (uint16_t)((float)pts_right[i][0] * vertical_zoom_rate), RGB565_GREEN);
|
||||
// // ips200_draw_point(START_X + (uint16_t)((float)pts_right[i][1] * horizontal_zoom_rate) - 1, START_Y + (uint16_t)((float)pts_right[i][0] * vertical_zoom_rate), RGB565_GREEN);
|
||||
// // ips200_draw_point(START_X + (uint16_t)((float)pts_left[i][1] * horizontal_zoom_rate), START_Y + (uint16_t)((float)pts_left[i][0] * vertical_zoom_rate), RGB565_YELLOW);
|
||||
// // ips200_draw_point(START_X + (uint16_t)((float)pts_left[i][1] * horizontal_zoom_rate) + 1, START_Y + (uint16_t)((float)pts_left[i][0] * vertical_zoom_rate), RGB565_YELLOW);
|
||||
// }
|
||||
// #undef IMAGE_DISPLAY_WIDTH
|
||||
// #undef START_X
|
||||
// #undef START_Y
|
||||
// }
|
||||
|
||||
uint16_t rgb_gradient(uint16_t i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user