Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lichtstream_teensy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Geisler
lichtstream_teensy
Commits
83602e0f
Commit
83602e0f
authored
5 years ago
by
dronus
Browse files
Options
Downloads
Patches
Plain Diff
slower fades
parent
4c1a9d97
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sender.c
+7
-4
7 additions, 4 deletions
sender.c
with
7 additions
and
4 deletions
sender.c
+
7
−
4
View file @
83602e0f
...
...
@@ -60,9 +60,12 @@ int fade(int b, int a, int t)
int
gb
=
(
b
>>
8
)
&
0xFF
;
int
bb
=
(
b
>>
16
)
&
0xFF
;
int
rc
=
(
ra
*
t
+
rb
*
(
255
-
t
))
/
256
;
int
gc
=
(
ga
*
t
+
gb
*
(
255
-
t
))
/
256
;
int
bc
=
(
ba
*
t
+
bb
*
(
255
-
t
))
/
256
;
// int rc=(ra*t+rb*(255-t))/256;
// int gc=(ga*t+gb*(255-t))/256;
// int bc=(ba*t+bb*(255-t))/256;
int
rc
=
(
ra
*
t
+
rb
*
(
255
-
t
))
/
512
;
int
gc
=
(
ga
*
t
+
gb
*
(
255
-
t
))
/
512
;
int
bc
=
(
ba
*
t
+
bb
*
(
255
-
t
))
/
512
;
return
(
bc
<<
0
)
+
(
rc
<<
8
)
+
(
gc
<<
16
);
...
...
@@ -77,7 +80,7 @@ int main() {
fprintf
(
stderr
,
"Sender input size: %i
\n
"
,
(
int
)
read
);
// do a fade
for
(
int
t
=
0
;
t
<
256
;
t
+=
1
)
for
(
int
t
=
0
;
t
<
=
256
;
t
+=
1
)
{
for
(
int
i
=
0
;
i
<
sizeof
(
image
)
/
4
;
i
++
)
image
[
i
]
=
fade
(
image_old
[
i
],
image_new
[
i
],
t
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment