Commit b80dc200 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the dimension of the img_pattern_data buffer.

Solved a bug in the computation of the image region to show.
parent 6d3ac527
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro" #error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro"
#endif #endif
extern unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_WIDTH][IMG_MAX_IMAGE_HEIGHT][3]; extern unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_HEIGHT][IMG_MAX_IMAGE_WIDTH][3];
void img_patterns_init(TMemory *memory,unsigned short int ram_base_address); void img_patterns_init(TMemory *memory,unsigned short int ram_base_address);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "ram.h" #include "ram.h"
// private variables // private variables
unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_WIDTH][IMG_MAX_IMAGE_HEIGHT][3]={{{{0}}}}; unsigned char img_pattern_data[IMG_MAX_NUM_IMAGES][IMG_MAX_IMAGE_HEIGHT][IMG_MAX_IMAGE_WIDTH][3]={{{{0}}}};
// private functions // private functions
void img_patterns_compute_range(unsigned short int area_min,unsigned short int area_max,short int pattern_start,unsigned short int max_size,unsigned short int *buff_start, unsigned short int *buff_end,unsigned char *img_start) void img_patterns_compute_range(unsigned short int area_min,unsigned short int area_max,short int pattern_start,unsigned short int max_size,unsigned short int *buff_start, unsigned short int *buff_end,unsigned char *img_start)
...@@ -36,7 +36,7 @@ void img_patterns_compute_range(unsigned short int area_min,unsigned short int a ...@@ -36,7 +36,7 @@ void img_patterns_compute_range(unsigned short int area_min,unsigned short int a
if(*buff_start+cp_size>area_max) if(*buff_start+cp_size>area_max)
{ {
*buff_end=area_max; *buff_end=area_max;
cp_size-=area_max; cp_size-=(*buff_start+cp_size-area_max);
} }
else else
*buff_end=*buff_start+cp_size; *buff_end=*buff_start+cp_size;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment