Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
humanoides
tools
stm32_libraries
Commits
b80dc200
Commit
b80dc200
authored
Oct 19, 2020
by
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
Changes
2
Show whitespace changes
Inline
Side-by-side
pattern_frame_buffer/include/image_patterns.h
View file @
b80dc200
...
...
@@ -18,7 +18,7 @@
#error "Please, specify the maximum image height with the IMG_MAX_IMAGE_HEIGHT macro"
#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
);
...
...
pattern_frame_buffer/src/image_patterns.c
View file @
b80dc200
...
...
@@ -5,7 +5,7 @@
#include "ram.h"
// 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
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
if
(
*
buff_start
+
cp_size
>
area_max
)
{
*
buff_end
=
area_max
;
cp_size
-=
area_max
;
cp_size
-=
(
*
buff_start
+
cp_size
-
area_max
)
;
}
else
*
buff_end
=*
buff_start
+
cp_size
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment