BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
9605a6b7
Commit
9605a6b7
authored
Feb 27, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image draw: minor optimization
parent
6f304736
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
lv_draw_vbasic.c
lv_draw/lv_draw_vbasic.c
+9
-3
No files found.
lv_draw/lv_draw_vbasic.c
View file @
9605a6b7
...
@@ -370,6 +370,8 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
...
@@ -370,6 +370,8 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
else
{
else
{
lv_color_t
chroma_key_color
=
LV_COLOR_TRANSP
;
lv_color_t
chroma_key_color
=
LV_COLOR_TRANSP
;
lv_coord_t
col
;
lv_coord_t
col
;
lv_color_t
last_img_px
=
LV_COLOR_BLACK
;
lv_color_t
recolored_px
=
lv_color_mix
(
recolor
,
last_img_px
,
recolor_opa
);
for
(
row
=
masked_a
.
y1
;
row
<=
masked_a
.
y2
;
row
++
)
{
for
(
row
=
masked_a
.
y1
;
row
<=
masked_a
.
y2
;
row
++
)
{
for
(
col
=
0
;
col
<
map_useful_w
;
col
++
)
{
for
(
col
=
0
;
col
<
map_useful_w
;
col
++
)
{
lv_opa_t
opa_result
=
opa
;
lv_opa_t
opa_result
=
opa
;
...
@@ -381,13 +383,17 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
...
@@ -381,13 +383,17 @@ void lv_vmap(const lv_area_t * cords_p, const lv_area_t * mask_p,
/*Calculate with the pixel level alpha*/
/*Calculate with the pixel level alpha*/
if
(
alpha_byte
)
{
if
(
alpha_byte
)
{
lv_opa_t
px_opa
=
(
*
(((
uint8_t
*
)
px_color
)
+
LV_IMG_PX_SIZE_ALPHA_BYTE
-
1
));
lv_opa_t
px_opa
=
(
*
(((
uint8_t
*
)
px_color
)
+
LV_IMG_PX_SIZE_ALPHA_BYTE
-
1
));
if
(
px_opa
!=
LV_OPA_COVER
)
opa_result
=
(
uint32_t
)((
uint32_t
)
px_opa
*
opa_result
)
>>
8
;
if
(
px_opa
==
LV_OPA_TRANSP
)
continue
;
else
if
(
px_opa
!=
LV_OPA_COVER
)
opa_result
=
(
uint32_t
)((
uint32_t
)
px_opa
*
opa_result
)
>>
8
;
}
}
/*Re-color the pixel if required*/
/*Re-color the pixel if required*/
if
(
recolor_opa
!=
LV_OPA_TRANSP
)
{
if
(
recolor_opa
!=
LV_OPA_TRANSP
)
{
lv_color_t
recolored_px
=
lv_color_mix
(
recolor
,
*
px_color
,
recolor_opa
);
if
(
last_img_px
.
full
!=
px_color
->
full
)
{
/*Minor acceleration: calculate only for new colors (save the last)*/
last_img_px
=
*
px_color
;
recolored_px
=
lv_color_mix
(
recolor
,
last_img_px
,
recolor_opa
);
}
if
(
opa_result
==
LV_OPA_COVER
)
vdb_buf_tmp
[
col
].
full
=
recolored_px
.
full
;
if
(
opa_result
==
LV_OPA_COVER
)
vdb_buf_tmp
[
col
].
full
=
recolored_px
.
full
;
else
vdb_buf_tmp
[
col
]
=
lv_color_mix
(
recolored_px
,
vdb_buf_tmp
[
col
],
opa_result
);
else
vdb_buf_tmp
[
col
]
=
lv_color_mix
(
recolored_px
,
vdb_buf_tmp
[
col
],
opa_result
);
...
...
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