Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
406fb3cb
Commit
406fb3cb
authored
8 years ago
by
Oleg Korsak
Committed by
Damien George
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests/extmod/framebuf4: Add tests for GS4_HMSB framebuf format.
parent
fd99690f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/extmod/framebuf4.py
+54
-0
54 additions, 0 deletions
tests/extmod/framebuf4.py
tests/extmod/framebuf4.py.exp
+112
-0
112 additions, 0 deletions
tests/extmod/framebuf4.py.exp
with
166 additions
and
0 deletions
tests/extmod/framebuf4.py
0 → 100644
+
54
−
0
View file @
406fb3cb
try
:
import
framebuf
except
ImportError
:
print
(
"
SKIP
"
)
import
sys
sys
.
exit
()
def
printbuf
():
print
(
"
--8<--
"
)
for
y
in
range
(
h
):
print
(
buf
[
y
*
w
//
2
:(
y
+
1
)
*
w
//
2
])
print
(
"
-->8--
"
)
w
=
16
h
=
8
buf
=
bytearray
(
w
*
h
//
2
)
fbuf
=
framebuf
.
FrameBuffer
(
buf
,
w
,
h
,
framebuf
.
GS4_HMSB
)
# fill
fbuf
.
fill
(
0x0f
)
printbuf
()
fbuf
.
fill
(
0xa0
)
printbuf
()
# put pixel
fbuf
.
pixel
(
0
,
0
,
0x01
)
printbuf
()
fbuf
.
pixel
(
w
-
1
,
0
,
0x02
)
printbuf
()
fbuf
.
pixel
(
w
-
1
,
h
-
1
,
0x03
)
printbuf
()
fbuf
.
pixel
(
0
,
h
-
1
,
0x04
)
printbuf
()
# get pixel
print
(
fbuf
.
pixel
(
0
,
0
),
fbuf
.
pixel
(
w
-
1
,
0
),
fbuf
.
pixel
(
w
-
1
,
h
-
1
),
fbuf
.
pixel
(
0
,
h
-
1
))
print
(
fbuf
.
pixel
(
1
,
0
),
fbuf
.
pixel
(
w
-
2
,
0
),
fbuf
.
pixel
(
w
-
2
,
h
-
1
),
fbuf
.
pixel
(
1
,
h
-
1
))
# fill rect
fbuf
.
fill_rect
(
0
,
0
,
w
,
h
,
0x0f
)
printbuf
()
fbuf
.
fill_rect
(
0
,
0
,
w
,
h
,
0xf0
)
fbuf
.
fill_rect
(
1
,
0
,
w
//
2
+
1
,
1
,
0xf1
)
printbuf
()
fbuf
.
fill_rect
(
1
,
0
,
w
//
2
+
1
,
1
,
0x10
)
fbuf
.
fill_rect
(
1
,
0
,
w
//
2
,
1
,
0xf1
)
printbuf
()
fbuf
.
fill_rect
(
1
,
0
,
w
//
2
,
1
,
0x10
)
fbuf
.
fill_rect
(
0
,
h
-
4
,
w
//
2
+
1
,
4
,
0xaf
)
printbuf
()
fbuf
.
fill_rect
(
0
,
h
-
4
,
w
//
2
+
1
,
4
,
0xb0
)
fbuf
.
fill_rect
(
0
,
h
-
4
,
w
//
2
,
4
,
0xaf
)
printbuf
()
fbuf
.
fill_rect
(
0
,
h
-
4
,
w
//
2
,
4
,
0xb0
)
This diff is collapsed.
Click to expand it.
tests/extmod/framebuf4.py.exp
0 → 100644
+
112
−
0
View file @
406fb3cb
--8<--
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
-->8--
--8<--
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x10\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x10\x00\x00\x00\x00\x00\x00\x02')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x10\x00\x00\x00\x00\x00\x00\x02')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x03')
-->8--
--8<--
bytearray(b'\x10\x00\x00\x00\x00\x00\x00\x02')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'@\x00\x00\x00\x00\x00\x00\x03')
-->8--
1 2 3 4
0 0 0 0
--8<--
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
bytearray(b'\xff\xff\xff\xff\xff\xff\xff\xff')
-->8--
--8<--
bytearray(b'\x01\x11\x11\x11\x11\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x01\x11\x11\x11\x10\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\xf0\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\xf0\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\xf0\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\xf0\x00\x00\x00')
-->8--
--8<--
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\x00\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\x00\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\x00\x00\x00\x00')
bytearray(b'\xff\xff\xff\xff\x00\x00\x00\x00')
-->8--
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