Created
July 28, 2019 13:03
-
-
Save anastasiia-kornilova/b692ce0afa196e15f80d217d2da45bba to your computer and use it in GitHub Desktop.
"Show" method examples.
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
//rgb32 | |
var photo = getPhoto(); | |
brick.display().show(photo, 160, 120, "rgb32"); | |
script.wait(5000); | |
//rgb888 | |
pic = [] | |
photo = getPhoto(); | |
l = photo.length; | |
for (i = 0; i < l; i++) { | |
var p = photo[i]; | |
pic.push((p&0xff0000)>>16); | |
pic.push((p&0xff00)>>8); | |
pic.push((p&0xff)); | |
} | |
brick.display().show(pic, 160, 120, "rgb888"); | |
script.wait(5000); | |
//grayscale8 | |
pic = [] | |
photo = getPhoto(); | |
l = photo.length; | |
for (i = 0; i < l; i++) { | |
var p = photo[i]; | |
pic.push(((p&0xff0000)>>18) + ((p&0xff00)>>10) + ((p&0xff)>>2)); | |
} | |
brick.display().show(pic, 160, 120, "grayscale8"); | |
script.wait(5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment