Created
April 5, 2019 02:16
-
-
Save yamori813/12994b190c9c0921dd7c7a3e7ad98980 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def copylcd(c, sp) | |
for n in 1..64 do | |
rgba = c.getpix(0, n - 1, 128) | |
for i in 1..16 do | |
pat = 0 | |
for k in 1..8 do | |
if rgba[1 + (i - 1) * 4 * 8 + (k - 1) * 4] == 0xff | |
pat |= 1 << (8 - k) | |
end | |
end | |
sp.write pat.chr | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment