将图像转换为像素数组

时间:2016-02-21 07:52:38

标签: c++ image-processing arduino screen pixels

我试图在Arduino LED屏幕上显示电池图标。为此我需要该图标的像素级数组(矩阵)。有没有办法或工具我可以上传图像然后它给我的图像的像素表示?

1 个答案:

答案 0 :(得分:2)

假设您知道如何在LCD屏幕中设置单个像素并拥有Linux shell访问权限,我可以考虑在Arduino源代码中对图像进行硬编码。虽然这种方法不太实用,但它确实可行且有趣。所以,让我们做吧!

假设您要显示名为6的此图标Nuclear icon

使用ImageMagick package中的nuclear.png工具,您可以通过此命令获取一个文本文件,其中列出了图像中的每个像素:

convert

上面的命令输出下面的文件convert nuclear.png nuclear.txt

nuclear.txt

您可以很容易地看到,除第一行外,每一行都显示一个像素坐标,后跟相应的RGBA颜色值。您可以在official documentation

中获取有关此格式的更多信息

通过在# ImageMagick pixel enumeration: 16,16,255,rgba 0,0: (255,255,255,0) #FFFFFF00 rgba(255,255,255,0) 1,0: (6,6,6,0.556863) #0606068E rgba(6,6,6,0.556863) 2,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 3,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 4,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 5,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 6,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 7,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 8,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 9,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 10,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 11,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 12,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 13,0: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 14,0: (6,6,6,0.556863) #0606068E rgba(6,6,6,0.556863) 15,0: (255,255,255,0) #FFFFFF00 rgba(255,255,255,0) 0,1: (6,6,6,0.556863) #0606068E rgba(6,6,6,0.556863) 1,1: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 2,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 3,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 4,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 5,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 6,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 7,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 8,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 9,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 10,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 11,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 12,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 13,1: (26,26,26,1) #1A1A1A rgba(26,26,26,1) 14,1: (6,6,6,0.94902) #060606F2 rgba(6,6,6,0.94902) 15,1: (6,6,6,0.556863) #0606068E rgba(6,6,6,0.556863) 0,2: (5,5,5,0.94902) #050505F2 rgba(5,5,5,0.94902) 1,2: (25,25,25,1) #191919 rgba(25,25,25,1) 2,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 3,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 4,2: (17,17,15,1) #11110F rgba(17,17,15,1) 5,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 6,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 7,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 8,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 9,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 10,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 11,2: (17,17,15,1) #11110F rgba(17,17,15,1) 12,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 13,2: (15,15,15,1) #0F0F0F rgba(15,15,15,1) 14,2: (25,25,25,1) #191919 rgba(25,25,25,1) 15,2: (5,5,5,0.94902) #050505F2 rgba(5,5,5,0.94902) 0,3: (5,5,5,0.94902) #050505F2 rgba(5,5,5,0.94902) 1,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 2,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 3,3: (30,26,14,1) #1E1A0E rgba(30,26,14,1) 4,3: (181,133,13,1) #B5850D rgba(181,133,13,1) 5,3: (32,29,14,1) #201D0E rgba(32,29,14,1) 6,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 7,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 8,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 9,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 10,3: (30,26,14,1) #1E1A0E rgba(30,26,14,1) 11,3: (171,125,13,1) #AB7D0D rgba(171,125,13,1) 12,3: (26,23,14,1) #1A170E rgba(26,23,14,1) 13,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 14,3: (14,14,14,1) #0E0E0E rgba(14,14,14,1) 15,3: (5,5,5,0.94902) #050505F2 rgba(5,5,5,0.94902) 0,4: (4,4,4,0.94902) #040404F2 rgba(4,4,4,0.94902) 1,4: (13,13,13,1) #0D0D0D rgba(13,13,13,1) 2,4: (19,18,13,1) #13120D rgba(19,18,13,1) 3,4: (184,134,13,1) #B8860D rgba(184,134,13,1) 4,4: (226,163,13,1) #E2A30D rgba(226,163,13,1) 5,4: (163,119,13,1) #A3770D rgba(163,119,13,1) 6,4: (14,14,13,1) #0E0E0D rgba(14,14,13,1) 7,4: (13,13,13,1) #0D0D0D rgba(13,13,13,1) 8,4: (13,13,13,1) #0D0D0D rgba(13,13,13,1) 9,4: (14,14,13,1) #0E0E0D rgba(14,14,13,1) 10,4: (151,112,13,1) #97700D rgba(151,112,13,1) 11,4: (226,163,13,1) #E2A30D rgba(226,163,13,1) 12,4: (170,124,13,1) #AA7C0D rgba(170,124,13,1) 13,4: (16,16,13,1) #10100D rgba(16,16,13,1) 14,4: (13,13,13,1) #0D0D0D rgba(13,13,13,1) 15,4: (4,4,4,0.94902) #040404F2 rgba(4,4,4,0.94902) 0,5: (4,4,4,0.94902) #040404F2 rgba(4,4,4,0.94902) 1,5: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 2,5: (84,65,13,1) #54410D rgba(84,65,13,1) 3,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 4,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 5,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 6,5: (72,56,12,1) #48380C rgba(72,56,12,1) 7,5: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 8,5: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 9,5: (65,51,12,1) #41330C rgba(65,51,12,1) 10,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 11,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 12,5: (226,163,13,1) #E2A30D rgba(226,163,13,1) 13,5: (72,56,12,1) #48380C rgba(72,56,12,1) 14,5: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 15,5: (4,4,4,0.94902) #040404F2 rgba(4,4,4,0.94902) 0,6: (3,3,3,0.94902) #030303F2 rgba(3,3,3,0.94902) 1,6: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 2,6: (184,133,13,1) #B8850D rgba(184,133,13,1) 3,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 4,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 5,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 6,6: (101,74,8,1) #654A08 rgba(101,74,8,1) 7,6: (5,4,2,1) #050402 rgba(5,4,2,1) 8,6: (4,4,3,1) #040403 rgba(4,4,3,1) 9,6: (115,85,8,1) #735508 rgba(115,85,8,1) 10,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 11,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 12,6: (226,163,13,1) #E2A30D rgba(226,163,13,1) 13,6: (164,121,12,1) #A4790C rgba(164,121,12,1) 14,6: (12,12,12,1) #0C0C0C rgba(12,12,12,1) 15,6: (3,3,3,0.94902) #030303F2 rgba(3,3,3,0.94902) 0,7: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 1,7: (13,12,10,1) #0D0C0A rgba(13,12,10,1) 2,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 3,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 4,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 5,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 6,7: (7,6,2,1) #070602 rgba(7,6,2,1) 7,7: (188,136,11,1) #BC880B rgba(188,136,11,1) 8,7: (179,128,11,1) #B3800B rgba(179,128,11,1) 9,7: (7,6,2,1) #070602 rgba(7,6,2,1) 10,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 11,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 12,7: (226,163,13,1) #E2A30D rgba(226,163,13,1) 13,7: (218,156,13,1) #DA9C0D rgba(218,156,13,1) 14,7: (10,10,10,1) #0A0A0A rgba(10,10,10,1) 15,7: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 0,8: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 1,8: (9,9,9,1) #090909 rgba(9,9,9,1) 2,8: (9,9,9,1) #090909 rgba(9,9,9,1) 3,8: (9,9,9,1) #090909 rgba(9,9,9,1) 4,8: (9,9,9,1) #090909 rgba(9,9,9,1) 5,8: (9,9,9,1) #090909 rgba(9,9,9,1) 6,8: (3,3,2,1) #030302 rgba(3,3,2,1) 7,8: (188,136,11,1) #BC880B rgba(188,136,11,1) 8,8: (184,133,11,1) #B8850B rgba(184,133,11,1) 9,8: (4,3,2,1) #040302 rgba(4,3,2,1) 10,8: (9,9,9,1) #090909 rgba(9,9,9,1) 11,8: (9,9,9,1) #090909 rgba(9,9,9,1) 12,8: (9,9,9,1) #090909 rgba(9,9,9,1) 13,8: (9,9,9,1) #090909 rgba(9,9,9,1) 14,8: (9,9,9,1) #090909 rgba(9,9,9,1) 15,8: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 0,9: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 1,9: (8,8,8,1) #080808 rgba(8,8,8,1) 2,9: (8,8,8,1) #080808 rgba(8,8,8,1) 3,9: (8,8,8,1) #080808 rgba(8,8,8,1) 4,9: (8,8,8,1) #080808 rgba(8,8,8,1) 5,9: (8,8,8,1) #080808 rgba(8,8,8,1) 6,9: (7,6,5,1) #070605 rgba(7,6,5,1) 7,9: (5,4,2,1) #050402 rgba(5,4,2,1) 8,9: (5,4,2,1) #050402 rgba(5,4,2,1) 9,9: (7,7,6,1) #070706 rgba(7,7,6,1) 10,9: (8,8,8,1) #080808 rgba(8,8,8,1) 11,9: (8,8,8,1) #080808 rgba(8,8,8,1) 12,9: (8,8,8,1) #080808 rgba(8,8,8,1) 13,9: (8,8,8,1) #080808 rgba(8,8,8,1) 14,9: (8,8,8,1) #080808 rgba(8,8,8,1) 15,9: (2,2,2,0.94902) #020202F2 rgba(2,2,2,0.94902) 0,10: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 1,10: (8,8,8,1) #080808 rgba(8,8,8,1) 2,10: (8,8,8,1) #080808 rgba(8,8,8,1) 3,10: (8,8,8,1) #080808 rgba(8,8,8,1) 4,10: (8,8,8,1) #080808 rgba(8,8,8,1) 5,10: (8,8,8,1) #080808 rgba(8,8,8,1) 6,10: (73,56,10,1) #49380A rgba(73,56,10,1) 7,10: (226,163,13,1) #E2A30D rgba(226,163,13,1) 8,10: (226,163,13,1) #E2A30D rgba(226,163,13,1) 9,10: (79,60,10,1) #4F3C0A rgba(79,60,10,1) 10,10: (8,8,8,1) #080808 rgba(8,8,8,1) 11,10: (8,8,8,1) #080808 rgba(8,8,8,1) 12,10: (8,8,8,1) #080808 rgba(8,8,8,1) 13,10: (8,8,8,1) #080808 rgba(8,8,8,1) 14,10: (8,8,8,1) #080808 rgba(8,8,8,1) 15,10: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 0,11: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 1,11: (7,7,7,1) #070707 rgba(7,7,7,1) 2,11: (7,7,7,1) #070707 rgba(7,7,7,1) 3,11: (7,7,7,1) #070707 rgba(7,7,7,1) 4,11: (7,7,7,1) #070707 rgba(7,7,7,1) 5,11: (12,11,7,1) #0C0B07 rgba(12,11,7,1) 6,11: (208,149,12,1) #D0950C rgba(208,149,12,1) 7,11: (226,163,13,1) #E2A30D rgba(226,163,13,1) 8,11: (226,163,13,1) #E2A30D rgba(226,163,13,1) 9,11: (216,156,13,1) #D89C0D rgba(216,156,13,1) 10,11: (17,15,8,1) #110F08 rgba(17,15,8,1) 11,11: (7,7,7,1) #070707 rgba(7,7,7,1) 12,11: (7,7,7,1) #070707 rgba(7,7,7,1) 13,11: (7,7,7,1) #070707 rgba(7,7,7,1) 14,11: (7,7,7,1) #070707 rgba(7,7,7,1) 15,11: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 0,12: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 1,12: (6,6,6,1) #060606 rgba(6,6,6,1) 2,12: (6,6,6,1) #060606 rgba(6,6,6,1) 3,12: (6,6,6,1) #060606 rgba(6,6,6,1) 4,12: (6,6,6,1) #060606 rgba(6,6,6,1) 5,12: (84,64,9,1) #544009 rgba(84,64,9,1) 6,12: (226,163,13,1) #E2A30D rgba(226,163,13,1) 7,12: (226,163,13,1) #E2A30D rgba(226,163,13,1) 8,12: (226,163,13,1) #E2A30D rgba(226,163,13,1) 9,12: (226,163,13,1) #E2A30D rgba(226,163,13,1) 10,12: (108,80,10,1) #6C500A rgba(108,80,10,1) 11,12: (6,6,6,1) #060606 rgba(6,6,6,1) 12,12: (6,6,6,1) #060606 rgba(6,6,6,1) 13,12: (6,6,6,1) #060606 rgba(6,6,6,1) 14,12: (6,6,6,1) #060606 rgba(6,6,6,1) 15,12: (1,1,1,0.94902) #010101F2 rgba(1,1,1,0.94902) 0,13: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 1,13: (6,6,6,1) #060606 rgba(6,6,6,1) 2,13: (6,6,6,1) #060606 rgba(6,6,6,1) 3,13: (6,6,6,1) #060606 rgba(6,6,6,1) 4,13: (6,6,6,1) #060606 rgba(6,6,6,1) 5,13: (70,53,9,1) #463509 rgba(70,53,9,1) 6,13: (179,130,12,1) #B3820C rgba(179,130,12,1) 7,13: (226,163,13,1) #E2A30D rgba(226,163,13,1) 8,13: (226,163,13,1) #E2A30D rgba(226,163,13,1) 9,13: (175,127,12,1) #AF7F0C rgba(175,127,12,1) 10,13: (63,48,8,1) #3F3008 rgba(63,48,8,1) 11,13: (6,6,6,1) #060606 rgba(6,6,6,1) 12,13: (6,6,6,1) #060606 rgba(6,6,6,1) 13,13: (6,6,6,1) #060606 rgba(6,6,6,1) 14,13: (6,6,6,1) #060606 rgba(6,6,6,1) 15,13: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 0,14: (0,0,0,0.556863) #0000008E rgba(0,0,0,0.556863) 1,14: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 2,14: (5,5,5,1) #050505 rgba(5,5,5,1) 3,14: (5,5,5,1) #050505 rgba(5,5,5,1) 4,14: (5,5,5,1) #050505 rgba(5,5,5,1) 5,14: (5,5,5,1) #050505 rgba(5,5,5,1) 6,14: (5,5,5,1) #050505 rgba(5,5,5,1) 7,14: (5,5,5,1) #050505 rgba(5,5,5,1) 8,14: (5,5,5,1) #050505 rgba(5,5,5,1) 9,14: (5,5,5,1) #050505 rgba(5,5,5,1) 10,14: (5,5,5,1) #050505 rgba(5,5,5,1) 11,14: (5,5,5,1) #050505 rgba(5,5,5,1) 12,14: (5,5,5,1) #050505 rgba(5,5,5,1) 13,14: (5,5,5,1) #050505 rgba(5,5,5,1) 14,14: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 15,14: (0,0,0,0.556863) #0000008E rgba(0,0,0,0.556863) 0,15: (255,255,255,0) #FFFFFF00 rgba(255,255,255,0) 1,15: (0,0,0,0.556863) #0000008E rgba(0,0,0,0.556863) 2,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 3,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 4,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 5,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 6,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 7,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 8,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 9,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 10,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 11,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 12,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 13,15: (0,0,0,0.94902) #000000F2 rgba(0,0,0,0.94902) 14,15: (0,0,0,0.556863) #0000008E rgba(0,0,0,0.556863) 15,15: (255,255,255,0) #FFFFFF00 rgba(255,255,255,0) 上使用一些管道shell命令,我们可以在nuclear.txt中生成一个硬编码的整数数组:

nuclear.cpp

(echo "int pixels[] = {"; \ tail -n +2 nuclear.txt | tr -cs '0-9.\n' ' ' | \ while read x y r g b junk; do echo " $x,$y,$r,$g,$b,";done; \ echo "-1};") > nuclear.cpp 内容:

nuclear.cpp

请注意,int pixels[] = { 0,0,255,255,255, 1,0,43,43,43, 2,0,43,43,43, 3,0,43,43,43, 4,0,43,43,43, 5,0,43,43,43, 6,0,43,43,43, 7,0,43,43,43, 8,0,43,43,43, 9,0,43,43,43, 10,0,43,43,43, 11,0,43,43,43, 12,0,43,43,43, 13,0,43,43,43, 14,0,43,43,43, 15,0,255,255,255, 0,1,42,42,42, 1,1,42,42,42, 2,1,90,90,90, 3,1,90,90,90, 4,1,90,90,90, 5,1,90,90,90, 6,1,90,90,90, 7,1,90,90,90, 8,1,90,90,90, 9,1,90,90,90, 10,1,90,90,90, 11,1,90,90,90, 12,1,90,90,90, 13,1,90,90,90, 14,1,42,42,42, 15,1,42,42,42, 0,2,40,40,40, 1,2,89,89,89, 2,2,69,69,69, 3,2,69,69,69, 4,2,74,73,69, 5,2,69,69,69, 6,2,69,69,69, 7,2,69,69,69, 8,2,69,69,69, 9,2,69,69,69, 10,2,69,69,69, 11,2,73,72,69, 12,2,69,69,69, 13,2,69,69,69, 14,2,89,89,89, 15,2,40,40,40, 0,3,37,37,37, 1,3,67,67,67, 2,3,67,67,67, 3,3,96,90,66, 4,3,219,191,64, 5,3,100,94,66, 6,3,67,67,67, 7,3,67,67,67, 8,3,67,67,67, 9,3,67,67,67, 10,3,96,90,66, 11,3,214,186,64, 12,3,90,85,66, 13,3,67,67,67, 14,3,67,67,67, 15,3,37,37,37, 0,4,35,35,35, 1,4,65,65,65, 2,4,77,75,65, 3,4,221,192,63, 4,4,242,209,63, 5,4,209,182,63, 6,4,67,67,65, 7,4,65,65,65, 8,4,65,65,65, 9,4,67,67,65, 10,4,202,177,63, 11,4,242,209,63, 12,4,213,185,63, 13,4,71,70,65, 14,4,65,65,65, 15,4,35,35,35, 0,5,32,32,32, 1,5,62,62,62, 2,5,155,138,63, 3,5,242,209,63, 4,5,242,209,63, 5,5,242,209,63, 6,5,145,129,62, 7,5,62,62,62, 8,5,62,62,62, 9,5,138,124,62, 10,5,242,209,63, 11,5,242,209,63, 12,5,242,209,63, 13,5,145,129,62, 14,5,62,62,62, 15,5,32,32,32, 0,6,28,28,28, 1,6,60,60,60, 2,6,221,191,63, 3,6,242,209,63, 4,6,242,209,63, 5,6,242,209,63, 6,6,169,147,49, 7,6,37,34,25, 8,6,34,33,26, 9,6,179,156,51, 10,6,242,209,63, 11,6,242,209,63, 12,6,242,209,63, 13,6,210,183,62, 14,6,60,60,60, 15,6,28,28,28, 0,7,25,25,25, 1,7,64,62,57, 2,7,242,209,63, 3,7,242,209,63, 4,7,242,209,63, 5,7,242,209,63, 6,7,46,42,21, 7,7,223,193,59, 8,7,218,188,58, 9,7,46,41,22, 10,7,242,209,63, 11,7,242,209,63, 12,7,242,209,63, 13,7,238,205,63, 14,7,57,57,57, 15,7,25,25,25, 0,8,22,22,22, 1,8,54,54,54, 2,8,54,54,54, 3,8,54,54,54, 4,8,54,54,54, 5,8,54,54,54, 6,8,29,27,20, 7,8,223,193,59, 8,8,221,191,58, 9,8,32,30,22, 10,8,54,54,54, 11,8,54,54,54, 12,8,54,54,54, 13,8,54,54,54, 14,8,54,54,54, 15,8,22,22,22, 0,9,18,18,18, 1,9,51,51,51, 2,9,51,51,51, 3,9,51,51,51, 4,9,51,51,51, 5,9,51,51,51, 6,9,45,44,40, 7,9,38,35,20, 8,9,37,34,20, 9,9,47,45,41, 10,9,51,51,51, 11,9,51,51,51, 12,9,51,51,51, 13,9,51,51,51, 14,9,51,51,51, 15,9,18,18,18, 0,10,15,15,15, 1,10,48,48,48, 2,10,48,48,48, 3,10,48,48,48, 4,10,48,48,48, 5,10,48,48,48, 6,10,146,129,56, 7,10,242,209,63, 8,10,242,209,63, 9,10,151,133,56, 10,10,48,48,48, 11,10,48,48,48, 12,10,48,48,48, 13,10,48,48,48, 14,10,48,48,48, 15,10,15,15,15, 0,11,12,12,12, 1,11,46,46,46, 2,11,46,46,46, 3,11,46,46,46, 4,11,46,46,46, 5,11,62,59,47, 6,11,233,201,62, 7,11,242,209,63, 8,11,242,209,63, 9,11,237,205,63, 10,11,74,69,48, 11,11,46,46,46, 12,11,46,46,46, 13,11,46,46,46, 14,11,46,46,46, 15,11,12,12,12, 0,12,9,9,9, 1,12,43,43,43, 2,12,43,43,43, 3,12,43,43,43, 4,12,43,43,43, 5,12,155,137,54, 6,12,242,209,63, 7,12,242,209,63, 8,12,242,209,63, 9,12,242,209,63, 10,12,174,152,56, 11,12,43,43,43, 12,12,43,43,43, 13,12,43,43,43, 14,12,43,43,43, 15,12,9,9,9, 0,13,6,6,6, 1,13,41,41,41, 2,13,41,41,41, 3,13,41,41,41, 4,13,43,42,41, 5,13,143,126,52, 6,13,218,189,60, 7,13,242,209,63, 8,13,242,209,63, 9,13,216,187,60, 10,13,136,120,51, 11,13,43,43,41, 12,13,41,41,41, 13,13,41,41,41, 14,13,41,41,41, 15,13,6,6,6, 0,14,4,4,4, 1,14,4,4,4, 2,14,39,39,39, 3,14,39,39,39, 4,14,39,39,39, 5,14,39,39,39, 6,14,39,39,39, 7,14,39,39,39, 8,14,39,39,39, 9,14,39,39,39, 10,14,39,39,39, 11,14,39,39,39, 12,14,39,39,39, 13,14,39,39,39, 14,14,4,4,4, 15,14,4,4,4, 0,15,255,255,255, 1,15,2,2,2, 2,15,2,2,2, 3,15,2,2,2, 4,15,2,2,2, 5,15,2,2,2, 6,15,2,2,2, 7,15,2,2,2, 8,15,2,2,2, 9,15,2,2,2, 10,15,2,2,2, 11,15,2,2,2, 12,15,2,2,2, 13,15,2,2,2, 14,15,2,2,2, 15,15,255,255,255, -1}; 数组的每一行格式为pixels,故意包含最后一个元素row,col,r,g,b。将此数组粘贴到源代码中后,您可以使用下面的代码段来迭代像素并使用自定义函数在屏幕上显示它们:

-1

就是这样!