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
0b6be3a0
Commit
0b6be3a0
authored
Mar 05, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bottom shadow: add blur
parent
69eb3a97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lv_draw.c
lv_draw/lv_draw.c
+14
-6
No files found.
lv_draw/lv_draw.c
View file @
0b6be3a0
...
@@ -1859,7 +1859,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1859,7 +1859,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
lv_opa_t
line_1d_blur
[
swidth
];
lv_opa_t
line_1d_blur
[
swidth
];
for
(
col
=
0
;
col
<
swidth
;
col
++
)
{
for
(
col
=
0
;
col
<
swidth
;
col
++
)
{
line_1d_blur
[
col
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
col
)
*
style
->
body
.
opa
)
/
(
swidth
);
line_1d_blur
[
col
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
col
)
*
style
->
body
.
opa
/
2
)
/
(
swidth
);
}
}
lv_point_t
point_l
;
lv_point_t
point_l
;
...
@@ -1875,22 +1875,30 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1875,22 +1875,30 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
ofs_r
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
ofs_r
.
y
=
coords
->
y2
-
radius
+
1
-
LV_ANTIALIAS
;
for
(
col
=
0
;
col
<=
radius
;
col
++
)
{
for
(
col
=
0
;
col
<=
radius
;
col
++
)
{
point_l
.
x
=
ofs_l
.
x
+
radius
-
col
-
radius
;
point_l
.
x
=
ofs_l
.
x
-
col
;
point_l
.
y
=
ofs_l
.
y
+
curve_x
[
col
];
point_l
.
y
=
ofs_l
.
y
+
curve_x
[
col
];
point_r
.
x
=
ofs_r
.
x
+
col
;
point_r
.
x
=
ofs_r
.
x
+
col
;
point_r
.
y
=
ofs_r
.
y
+
curve_x
[
col
];
point_r
.
y
=
ofs_r
.
y
+
curve_x
[
col
];
lv_opa_t
px_opa
;
int16_t
diff
=
col
==
0
?
0
:
curve_x
[
col
-
1
]
-
curve_x
[
col
];
uint16_t
d
;
uint16_t
d
;
for
(
d
=
0
;
d
<
swidth
;
d
++
)
{
for
(
d
=
0
;
d
<
swidth
;
d
++
)
{
px_fp
(
point_l
.
x
,
point_l
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
/*When stepping a pixel in y calculate the average with the pixel from the prev. column to make a blur */
if
(
diff
==
0
)
{
px_opa
=
line_1d_blur
[
d
];
}
else
{
px_opa
=
(
uint16_t
)((
uint16_t
)
line_1d_blur
[
d
]
+
line_1d_blur
[
d
-
diff
])
>>
1
;
}
px_fp
(
point_l
.
x
,
point_l
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
px_opa
);
point_l
.
y
++
;
point_l
.
y
++
;
/*Don't overdraw th pixel on the middle*/
/*Don't overdraw th
e
pixel on the middle*/
if
(
point_r
.
x
>
ofs_l
.
x
)
{
if
(
point_r
.
x
>
ofs_l
.
x
)
{
px_fp
(
point_r
.
x
,
point_r
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
line_1d_blur
[
d
]);
px_fp
(
point_r
.
x
,
point_r
.
y
,
mask
,
style
->
body
.
shadow
.
color
,
px_opa
);
point_r
.
y
++
;
}
}
point_r
.
y
++
;
}
}
}
}
...
...
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