This commit is contained in:
Yunhorn 2023-10-01 15:51:29 +08:00
commit f78fd6a2d5
3 changed files with 647 additions and 0 deletions

568
ST7789/bmp.c Normal file
View File

@ -0,0 +1,568 @@
//
//
#include "bmp.h"
#include "st7789.h"
unsigned char work[4096] = {0};
unsigned int count = 0;
BMP_8 bmp8[][IMG_WIDTH];
void bmp24_to_rgb565(BMP_24 bmp24[][IMG_WIDTH],RGB565 rgb565[][IMG_WIDTH],uint16_t img[][IMG_WIDTH])
{
for (int i = 0; i < IMG_HEIGHT; i++) //BMP24->RGB565
{
for (int j = 0; j < IMG_WIDTH; j++)
{
rgb565[i][j].r_bit =bmp24[i][j].r_val>>3;
rgb565[i][j].g_bit = bmp24[i][j].g_val>>2;
rgb565[i][j].b_bit = bmp24[i][j].b_val>>3;
}
}
for (int i = 0; i < IMG_HEIGHT; i++)
{
for (int j = 0; j < IMG_WIDTH; j++)
{
img[i][j] =(rgb565[i][j].r_bit << 11 |rgb565[i][j].g_bit << 5 |rgb565[i][j].b_bit);
img[i][j] =( img[i][j] >> 8) | ((img[i][j] & 0xFF) << 8);
}
}
}
void bmp8_to_bmp1(BMP_8 bmp8[][IMG_WIDTH],uint8_t img[][IMG_WIDTH/8],uint8_t thre)
{
uint8_t after_thre[IMG_HEIGHT*IMG_WIDTH];
for(int i=0;i<IMG_HEIGHT;i++)
{
for(int j=0;j<IMG_WIDTH;j++)
{
after_thre[i*IMG_WIDTH+j]=bmp8[i][j].gray_val>=thre;
}
}
for(int i=0;i<IMG_HEIGHT*IMG_WIDTH;i+=8)
{
for(int j=0;j<8;j++)
{
**img= **img<<1|after_thre[i+j];
}
img++;
}
}
uint8_t temp_to_bmp8(BMP_8 bmp8[],const float temp_mat[],int size,float *max_temp,float *min_temp,uint8_t revese)
{
float low_threshold=1000;
float high_threshold=-1000;
int max_index=0;
for(int i=0;i<size;i++)
{
if(temp_mat[i]<low_threshold)
low_threshold=temp_mat[i];
if(temp_mat[i]>high_threshold)
high_threshold=temp_mat[i];
}
*max_temp=high_threshold;
*min_temp=low_threshold;
//温度异常退出重新获取
if(high_threshold>300||low_threshold<-40)
return 1;
uint8_t max_gray=0;
for(int i=0;i<size;i++)
{
if(!revese)
bmp8[i].gray_val=(int)(temp_mat[i]*255.0f/(high_threshold-low_threshold)+-1*low_threshold*255.0f/(high_threshold-low_threshold));
else
bmp8[i].gray_val=(int)(temp_mat[(i / IMG_INITIAL_WIDTH + 1) * IMG_INITIAL_WIDTH - i - 1+ (i / IMG_INITIAL_WIDTH ) * IMG_INITIAL_WIDTH]*255.0f/(high_threshold-low_threshold)+-1*low_threshold*255.0f/(high_threshold-low_threshold));
if(bmp8[i].gray_val>max_gray)
{
max_gray=bmp8[i].gray_val;
max_index=i;
}
}
max_index/IMG_INITIAL_WIDTH*IMG_HEIGHT+5;
int max_y=max_index/IMG_INITIAL_WIDTH*IMG_HEIGHT/IMG_INITIAL_HEIGHT+(240-IMG_HEIGHT)/2+IMG_HEIGHT/IMG_INITIAL_HEIGHT/2;
int max_x=(max_index%IMG_INITIAL_WIDTH)*IMG_WIDTH/IMG_INITIAL_WIDTH+(320-IMG_WIDTH)/2+IMG_WIDTH/IMG_INITIAL_WIDTH/2;
BSP_LCD_FillRect(max_x-6,max_y-1,12,2,BLACK);
BSP_LCD_FillRect(max_x-1,max_y-6,2,12,BLACK);
//ST7789_DrawFilledRectangle(max_x-6,max_y-1,12,2,BLACK);
//ST7789_DrawFilledRectangle(max_x-1,max_y-6,2,12,BLACK);
return 0;
}
//邻近插值法
void Resize_draw(BMP_8 bmp8[],uint8_t method)
{
BMP_24 input_bmp24[IMG_INITIAL_HEIGHT][IMG_INITIAL_WIDTH];
gray_to_rgb(bmp8,input_bmp24,method);
RGB565 TEMP_RGB565;
//SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize());
//ST7789_SetAddressWindow((320-IMG_WIDTH)/2, (240-IMG_HEIGHT)/2, IMG_WIDTH+(320-IMG_WIDTH)/2-1, IMG_HEIGHT+(240-IMG_HEIGHT)/2-1);
SetDisplayWindow((320-IMG_WIDTH)/2, (240-IMG_HEIGHT)/2, IMG_WIDTH+(320-IMG_WIDTH)/2-1, IMG_HEIGHT+(240-IMG_HEIGHT)/2-1);
ST7789_Select();
ST7789_DC_Set();
uint16_t data[IMG_WIDTH*IMG_HEIGHT/4];
for(int i=0;i<IMG_INITIAL_HEIGHT;i++)
{
for(int j=0;j<IMG_INITIAL_WIDTH;j++)
{
TEMP_RGB565.r_bit =input_bmp24[i][j].r_val>>3;
TEMP_RGB565.g_bit =input_bmp24[i][j].g_val>>2;
TEMP_RGB565.b_bit =input_bmp24[i][j].b_val>>3;
uint16_t color;
color =(TEMP_RGB565.r_bit << 11 |TEMP_RGB565.g_bit << 5 |TEMP_RGB565.b_bit);
color =( color >> 8) | ((color & 0xFF) << 8);
if(i%6==0)
{
for(int a=0;a<IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
else if((i+5)%6==0)
{
for(int a=IMG_WIDTH/IMG_INITIAL_WIDTH;a<2*IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
else if((i+4)%6==0)
{
for(int a=2*IMG_WIDTH/IMG_INITIAL_WIDTH;a<3*IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
else if((i+3)%6==0)
{
for(int a=3*IMG_WIDTH/IMG_INITIAL_WIDTH;a<4*IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
else if((i+2)%6==0)
{
for(int a=4*IMG_WIDTH/IMG_INITIAL_WIDTH;a<5*IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
else if((i+1)%6==0)
{
for(int a=5*IMG_WIDTH/IMG_INITIAL_WIDTH;a<6*IMG_WIDTH/IMG_INITIAL_WIDTH;a++)
{
for(int b=0;b<IMG_WIDTH/IMG_INITIAL_WIDTH;b++)
data[a*IMG_WIDTH+j*IMG_WIDTH/IMG_INITIAL_WIDTH+b]=color;
}
}
}
if(!((i+1)%6))
{
HAL_SPI_Transmit(hspi, (uint8_t *)data, sizeof(uint16_t) * IMG_WIDTH*IMG_HEIGHT/4, HAL_MAX_DELAY);
}
}
ST7789_UnSelect();
}
// 双线性插值
uint8_t Besize_draw(BMP_8 input_bmp8[],uint8_t method,uint8_t ifsavefile)
{//注释的是自己的插值现在使用dsp库中提供的
// BMP_8 bmp8[IMG_INITIAL_HEIGHT][IMG_INITIAL_WIDTH];
BMP_8 temp;
BMP_24 temp_24;
RGB565 TEMP_RGB565;
uint16_t color[1];
char filename[20];
int i, j;
int w = IMG_INITIAL_WIDTH;
int h = IMG_INITIAL_HEIGHT;
int iw = IMG_WIDTH;
int ih = IMG_HEIGHT;
float dx=((float)IMG_INITIAL_WIDTH-2.0f)*1.0f/(IMG_WIDTH-1);
float dy=((float)IMG_INITIAL_HEIGHT-2.0f)*1.0f/(IMG_HEIGHT-1);
// for(int a=0;a<IMG_INITIAL_HEIGHT;a++)
// {
// for(int b=0;b<IMG_INITIAL_WIDTH;b++)
// bmp8[a][b].gray_val=input_bmp8[a*IMG_INITIAL_WIDTH+b].gray_val;
// }
arm_bilinear_interp_instance_f32 bilinear_data;
bilinear_data.numCols=IMG_INITIAL_WIDTH;
bilinear_data.numRows=IMG_INITIAL_HEIGHT;
float data[IMG_INITIAL_WIDTH*IMG_INITIAL_HEIGHT];
for(int a=0;a<IMG_INITIAL_HEIGHT*IMG_INITIAL_WIDTH;a++)
{
data[a]=(float)input_bmp8[a].gray_val;
}
bilinear_data.pData=data;
//ST7789_SetAddressWindow((320-IMG_WIDTH)/2, (240-IMG_HEIGHT)/2, IMG_WIDTH+(320-IMG_WIDTH)/2-1, IMG_HEIGHT+(240-IMG_HEIGHT)/2-1);
SetDisplayWindow((320-IMG_WIDTH)/2, (240-IMG_HEIGHT)/2, IMG_WIDTH+(320-IMG_WIDTH)/2-1, IMG_HEIGHT+(240-IMG_HEIGHT)/2-1);
ST7789_Select();
ST7789_DC_Set();
uint16_t imgdata[IMG_WIDTH*IMG_HEIGHT/4];
uint32_t index=0;
for (j = 0; j < ih; j++)
{
// float fy = ((float)j + 0.5f) * dy - 0.5f;
float fy=(float)j * dy+1 ;
for (i = 0; i < iw; i++)
{
// float fx = ((float)i + 0.5f) * dx - 0.5f;
float fx = (float)i * dx+1 ;
temp.gray_val=(uint8_t)arm_bilinear_interp_f32(&bilinear_data,fx,fy);
// // 四邻域
// int Lx = (int)fx;
// int Rx = Lx + 1;
// int Ly = (int)fy;
// int Ry = Ly + 1;
// Lx = Lx > w - 2 ? w - 2 : Lx < 0 ? 0 : Lx;
// Rx = Rx > w - 1 ? w - 1 : Rx < 0 ? 0 : Rx;
// Ly = Ly > h - 2 ? h - 2 : Ly < 0 ? 0 : Ly;
// Ry = Ry > h - 1 ? h - 1 : Ry < 0 ? 0 : Ry;
// float u = (float)Rx - fx;
// float v = (float)Ry - fy;
// float r1=u*(float)bmp8[Ly][Lx].gray_val+(1-u)*(float)bmp8[Ly][Rx].gray_val;
// float r2=u*(float)bmp8[Ry][Lx].gray_val+(1-u)*(float)bmp8[Ry][Rx].gray_val;
// temp.gray_val=(uint8_t)(v * r1 + (1 - v) * r2);
bmp8_to_color(method,temp.gray_val,&temp_24);
TEMP_RGB565.r_bit =temp_24.r_val>>3;
TEMP_RGB565.g_bit =temp_24.g_val>>2;
TEMP_RGB565.b_bit =temp_24.b_val>>3;
color[0] =(TEMP_RGB565.r_bit << 11 |TEMP_RGB565.g_bit << 5 |TEMP_RGB565.b_bit);
color[0] =( color[0] >> 8) | ((color[0] & 0xFF) << 8);
if(index<IMG_WIDTH*(IMG_HEIGHT/4))
imgdata[index++]=color[0];
else
{
index=0;
imgdata[index++]=color[0];
}
}
if((j+1)%(IMG_HEIGHT/4)==0)
{
HAL_SPI_Transmit(hspi, (uint8_t*)imgdata, sizeof(uint16_t)*IMG_WIDTH*(IMG_HEIGHT/4), HAL_MAX_DELAY);
}
}
ST7789_UnSelect();
return 0;
}
void gray_to_rgb(BMP_8 bmp8[],BMP_24 bmp24[][IMG_INITIAL_WIDTH],uint8_t method)
{
for(int i=0;i<IMG_INITIAL_HEIGHT;i++)
{
for(int j=0;j<IMG_INITIAL_WIDTH;j++)
{
bmp8_to_color(method,bmp8[i*IMG_INITIAL_WIDTH+j].gray_val,&bmp24[i][j]);
}
}
}
void bmp8_to_color(uint8_t method,uint8_t gray_val,BMP_24*bmp24)
{
switch(method)
{
case GCM_Pseudo1:
bmp24->r_val=abs(0-gray_val);
bmp24->g_val=abs(127-gray_val);
bmp24->b_val=abs(255-gray_val);
break;
case GCM_Pseudo2:
if( (gray_val>=0) && (gray_val<=63) )
{
bmp24->r_val=0;
bmp24->g_val=0;
bmp24->b_val=(gray_val*255/64);
}
else if( (gray_val>=64) && (gray_val<=127) )
{
bmp24->r_val=0;
bmp24->g_val=((gray_val-64)*255/64);
bmp24->b_val=((127-gray_val)*255/64);
}
else if( (gray_val>=128) && (gray_val<=191) )
{
bmp24->r_val=((gray_val-128)*255/64);
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=192) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=((255-gray_val)*255/64);
bmp24->b_val=0;
}
break;
case GCM_Metal1:
if( (gray_val>=0) && (gray_val<=63) )
{
bmp24->r_val=0;
bmp24->g_val=0;
bmp24->b_val=(gray_val*255/64);
}
else if( (gray_val>=64) && (gray_val<=95) )
{
bmp24->r_val=((gray_val-63)*127/32);
bmp24->g_val=((gray_val-63)*127/32);
bmp24->b_val=255;
}
else if( (gray_val>=96) && (gray_val<=127) )
{
bmp24->r_val=((gray_val-95)*127/32)+128;
bmp24->g_val=((gray_val-95)*127/32)+128;
bmp24->b_val=((127-gray_val)*255/32);
}
else if( (gray_val>=128) && (gray_val<=191) )
{
bmp24->r_val=255;
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=192) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=255;
bmp24->b_val=((gray_val-192)*255/64);
}
break;
case GCM_Metal2:
bmp24->r_val=0; bmp24->b_val=0; bmp24->b_val=0;
if( (gray_val>=0) && (gray_val<=16) )
{
bmp24->r_val=0;
}
else if( (gray_val>=17) && (gray_val<=140) )
{
bmp24->r_val=((gray_val-16)*255/(140-16));
}
else if( (gray_val>=141) && (gray_val<=255) )
{
bmp24->r_val=255;
}
if( (gray_val>=0) && (gray_val<=101) )
{
bmp24->g_val=0;
}
else if( (gray_val>=102) && (gray_val<=218) )
{
bmp24->g_val=((gray_val-101)*255/(218-101));
}
else if( (gray_val>=219) && (gray_val<=255) )
{
bmp24->g_val=255;
}
if( (gray_val>=0) && (gray_val<=91) )
{
bmp24->b_val=28+((gray_val-0)*100/(91-0));
}
else if( (gray_val>=92) && (gray_val<=120) )
{
bmp24->b_val=((120-gray_val)*128/(120-91));
}
else if( (gray_val>=129) && (gray_val<=214) )
{
bmp24->b_val=0;
}
else if( (gray_val>=215) && (gray_val<=255) )
{
bmp24->b_val=((gray_val-214)*255/(255-214));
}
break;
case GCM_Rainbow1:
if( (gray_val>=0) && (gray_val<=31) )
{
bmp24->r_val=0;
bmp24->g_val=0;
bmp24->b_val=(gray_val*255/32);
}
else if( (gray_val>=32) && (gray_val<=63) )
{
bmp24->r_val=0;
bmp24->g_val=((gray_val-32)*255/32);
bmp24->b_val=255;
}
else if( (gray_val>=64) && (gray_val<=95) )
{
bmp24->r_val=0;
bmp24->g_val=255;
bmp24->b_val=((95-gray_val)*255/32);
}
else if( (gray_val>=96) && (gray_val<=127) )
{
bmp24->r_val=((gray_val-96)*255/32);
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=128) && (gray_val<=191) )
{
bmp24->r_val=255;
bmp24->g_val=((191-gray_val)*255/64);
bmp24->b_val=0;
}
else if( (gray_val>=192) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=((gray_val-192)*255/64);//0
bmp24->b_val=((gray_val-192)*255/64);
}
break;
case GCM_Rainbow2:
if( (gray_val>=0) && (gray_val<=63) )
{
bmp24->r_val=0;
bmp24->g_val=((gray_val-0)*255/64);
bmp24->b_val=255;
}
else if( (gray_val>=64) && (gray_val<=95) )
{
bmp24->r_val=0;
bmp24->g_val=255;
bmp24->b_val=((95-gray_val)*255/32);
}
else if( (gray_val>=96) && (gray_val<=127) )
{
bmp24->r_val=((gray_val-96)*255/32);
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=128) && (gray_val<=191) )
{
bmp24->r_val=255;
bmp24->g_val=((191-gray_val)*255/64);
bmp24->b_val=0;
}
else if( (gray_val>=192) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=((gray_val-192)*255/64);
bmp24->b_val=((gray_val-192)*255/64);
}
break;
case GCM_Rainbow3:
if( (gray_val>=0) && (gray_val<=51) )
{
bmp24->r_val=0;
bmp24->g_val=gray_val*5;
bmp24->b_val=255;
}
else if( (gray_val>=52) && (gray_val<=102) )
{
bmp24->r_val=0;
bmp24->g_val=255;
bmp24->b_val=255-(gray_val-51)*5;
}
else if( (gray_val>=103) && (gray_val<=153) )
{
bmp24->r_val=(gray_val-102)*5;
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=154) && (gray_val<=204) )
{
bmp24->r_val=255;
bmp24->g_val=(255-128*(gray_val-153)/51);
bmp24->b_val=0;
}
else if( (gray_val>=205) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=(127-127*(gray_val-204)/51);
bmp24->b_val=0;
}
break;
case GCM_Zhou:
if( (gray_val>=0) && (gray_val<=63) )
{
bmp24->r_val=0;
bmp24->g_val=((64-gray_val)*255/64);
bmp24->b_val=255;
}
else if( (gray_val>=64) && (gray_val<=127) )
{
bmp24->r_val=0;
bmp24->g_val=((gray_val-64)*255/64);
bmp24->b_val=((127-gray_val)*255/64);
}
else if( (gray_val>=128) && (gray_val<=191) )
{
bmp24->r_val=((gray_val-128)*255/64);
bmp24->g_val=255;
bmp24->b_val=0;
}
else if( (gray_val>=192) && (gray_val<=255) )
{
bmp24->r_val=255;
bmp24->g_val=((255-gray_val)*255/64);
bmp24->b_val=0;
}
break;
case GCM_Ning:
if ((gray_val>=0) && (gray_val<=63))
{
bmp24->r_val=0;
bmp24->g_val=254-4*gray_val;
bmp24->b_val=255;
}
else if ((gray_val>=64) && (gray_val<=127))
{
bmp24->r_val=0;
bmp24->g_val=4*gray_val-254;
bmp24->b_val=510-4*gray_val;
}
else if ((gray_val>=128) && (gray_val<=191))
{
bmp24->r_val=4*gray_val-510;
bmp24->g_val=255;
bmp24->b_val=0;
}
else if ((gray_val>=192) && (gray_val<=255))
{
bmp24->r_val=255;
bmp24->g_val=1022-4*gray_val;
bmp24->b_val=0;
}
break;
case GCM_Gray:
bmp24->r_val=gray_val;
bmp24->g_val=gray_val;
bmp24->b_val=gray_val;
break;
default:
break;
}
}
void draw_spectrum(uint8_t method)
{
uint16_t color;
for(int i=255;i>0;i-=2)
{
BMP_24 temp24;
RGB565 temp565;
bmp8_to_color(method,i,&temp24);
temp565.r_bit =temp24.r_val>>3;
temp565.g_bit =temp24.g_val>>2;
temp565.b_bit =temp24.b_val>>3;
color =(temp565.r_bit << 11 |temp565.g_bit << 5 |temp565.b_bit);
ST7789_DrawFilledRectangle(310,228-((int)((i/2)*1.6875))-2,8,2,color);
}
}

65
ST7789/bmp.h Normal file
View File

@ -0,0 +1,65 @@
#ifndef SD_TEST_BMP_H
#define SD_TEST_BMP_H
#include<stdio.h>
#include<stdint.h>
#include<string.h>
#include "st7789.h"
#include "math.h"
#include "stm32_hx8347d_lcd.h"
#include "arm_math.h"
#define abs(s) (s)>0?(s):-1*(s)
//#define IMG_WIDTH 288
#define IMG_WIDTH 240
#define IMG_HEIGHT 216
#define IMG_INITIAL_WIDTH 32
#define IMG_INITIAL_HEIGHT 24
#define savefile 0x01
#define notsavefile 0x00
#define GCM_Pseudo1 0x01
#define GCM_Pseudo2 0x02
#define GCM_Rainbow1 0x03
#define GCM_Rainbow2 0x04
#define GCM_Ning 0x05
#define GCM_Rainbow3 0x06
#define GCM_Zhou 0x07
#define GCM_Gray 0x08
#define GCM_Metal1 0x09
#define GCM_Metal2 0x0A
typedef struct RGBQUAD
{
uint8_t rgbBlue; //指定蓝色强度
uint8_t rgbGreen; //指定绿色强度
uint8_t rgbRed; //指定红色强度
uint8_t rgbReserved; //保留设置为0
} RGBQUAD;
typedef struct BMP_8
{
uint8_t gray_val;
}BMP_8;
typedef struct BMP_24
{
uint8_t r_val;
uint8_t g_val;
uint8_t b_val;
}BMP_24;
typedef struct RGB565
{
uint8_t r_bit;
uint8_t g_bit;
uint8_t b_bit;
}RGB565;
void bmp24_to_rgb565(BMP_24 bmp24[][IMG_WIDTH],RGB565 rgb565[][IMG_WIDTH],uint16_t img[][IMG_WIDTH]);
void bmp8_to_bmp1(BMP_8 bmp8[][IMG_WIDTH],uint8_t img[][IMG_WIDTH/8],uint8_t thre);
uint8_t temp_to_bmp8(BMP_8 bmp8[],const float temp_mat[],int size,float *max_temp,float *min_temp,uint8_t revese);
void Resize_draw(BMP_8 bmp8[],uint8_t method);
uint8_t Besize_draw(BMP_8 input_bmp8[],uint8_t method,uint8_t ifsavefile);
void gray_to_rgb(BMP_8 bmp8[],BMP_24 bmp24[][IMG_INITIAL_WIDTH],uint8_t method);
void bmp8_to_color(uint8_t method,uint8_t gray_val,BMP_24*bmp24);
void draw_spectrum(uint8_t method);
#endif //SD_TEST_BMP_H

View File

@ -39,7 +39,11 @@ int x, y, i, j;
// array for the 32 x 24 measured tempValues
static float tempValues[32*24];
volatile uint8_t zoneMask[32*24]={0x0}, edgeMask[32*24]={0x0};
<<<<<<< HEAD
void mlx90640_setCalibrationWaterTemp(void);
=======
void setCalibrationWaterTemp(void);
>>>>>>> 5e99684106096ccf79c571db54b302efc6a01d1a
void blackOutFilter(void);
static uint16_t TempToColor(float val);
static void setTempScale(void);
@ -90,10 +94,16 @@ static uint16_t TempToColor(float val)
// use the displays color mapping function to get 5-6-5 color palette (R=5 bits, G=6 bits, B-5 bits)
return BSP_LCD_GetColor565(red, green, blue);
}
<<<<<<< HEAD
void mlx90640_setCalibrationWaterTemp(void)
{
char tempbuf[128]="";
APP_LOG(TS_OFF,VLEVEL_L,"Start Calibration of Water, Put water in the center of FOV \r\n");
=======
void setCalibrationWaterTemp(void)
{
char tempbuf[128]="";
>>>>>>> 5e99684106096ccf79c571db54b302efc6a01d1a
readTempValues();
setTempScale();
calibrationWaterTemp = centerTemp;
@ -360,7 +370,11 @@ void mlx90640_display_process(void)
LCD_BL_OFF();
// BSP_LCD_DisplayOff();
}
<<<<<<< HEAD
APP_LOG(TS_OFF, VLEVEL_L, "Water Spill Spot Detected Count = %2d Level = %d of 600 \r\n", waterSpillSpotCount,waterSpillLevel);
=======
>>>>>>> 5e99684106096ccf79c571db54b302efc6a01d1a
if ((waterSpillSpotCount != lastWaterSpillSpotCount)&&(waterSpillSpotCount != 0)) {
APP_LOG(TS_OFF, VLEVEL_L, "Water Spill Spot Detected Count = %2d Level = %d of 600 \r\n", waterSpillSpotCount,waterSpillLevel);
lastWaterSpillSpotCount = waterSpillSpotCount;