├── Images
├── 1
│ ├── 0001.png
│ ├── 0002.png
│ ├── 0003.png
│ ├── 0004.png
│ ├── 0005.png
│ ├── 0006.png
│ ├── 0007.png
│ └── 0008.png
├── 1.bmp
└── 2.bmp
├── SBSPlayer
└── LentiMobileTest.html
├── ShowBMP
└── ShowBMP.ino
├── Tools
└── Lenticular.html
└── readme.MD
/Images/1.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1.bmp
--------------------------------------------------------------------------------
/Images/1/0001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0001.png
--------------------------------------------------------------------------------
/Images/1/0002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0002.png
--------------------------------------------------------------------------------
/Images/1/0003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0003.png
--------------------------------------------------------------------------------
/Images/1/0004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0004.png
--------------------------------------------------------------------------------
/Images/1/0005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0005.png
--------------------------------------------------------------------------------
/Images/1/0006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0006.png
--------------------------------------------------------------------------------
/Images/1/0007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0007.png
--------------------------------------------------------------------------------
/Images/1/0008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/1/0008.png
--------------------------------------------------------------------------------
/Images/2.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bitluni/LenticularExperiments/01052e212b7afc862c2d055060808de3c12d4be9/Images/2.bmp
--------------------------------------------------------------------------------
/SBSPlayer/LentiMobileTest.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
20 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/ShowBMP/ShowBMP.ino:
--------------------------------------------------------------------------------
1 | // IMPORTANT: LCDWIKI_KBV LIBRARY MUST BE SPECIFICALLY
2 | // CONFIGURED FOR EITHER THE TFT SHIELD OR THE BREAKOUT BOARD.
3 |
4 | //This program is a demo of how to show a bmp picture from SD card.
5 |
6 | //Set the pins to the correct ones for your development shield or breakout board.
7 | //the 16bit mode only use in Mega.you must modify the mode in the file of lcd_mode.h
8 | //when using the BREAKOUT BOARD only and using these 16 data lines to the LCD,
9 | //pin usage as follow:
10 | // CS CD WR RD RST D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15
11 | //Arduino Mega 40 38 39 / 41 37 36 35 34 33 32 31 30 22 23 24 25 26 27 28 29
12 |
13 | //Remember to set the pins to suit your display module!
14 |
15 | /**********************************************************************************
16 | * @attention
17 | *
18 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
19 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
20 | * TIME. AS A RESULT, QD electronic SHALL NOT BE HELD LIABLE FOR ANY
21 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
22 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
23 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
24 | **********************************************************************************/
25 |
26 | #include
27 | #include
28 | #include //Core graphics library
29 | #include //Hardware-specific library
30 |
31 | //the definiens of 16bit mode as follow:
32 | //if the IC model is known or the modules is unreadable,you can use this constructed function
33 | LCDWIKI_KBV my_lcd(ILI9481,40,38,39,-1,41); //model,cs,cd,wr,rd,reset
34 |
35 | #define BLACK 0x0000
36 | #define BLUE 0x001F
37 | #define RED 0xF800
38 | #define GREEN 0x07E0
39 | #define CYAN 0x07FF
40 | #define MAGENTA 0xF81F
41 | #define YELLOW 0xFFE0
42 | #define WHITE 0xFFFF
43 |
44 | #define FILE_NUMBER 1
45 | #define FILE_NAME_SIZE_MAX 20
46 |
47 | uint32_t bmp_offset = 0;
48 | uint16_t s_width = my_lcd.Get_Display_Width();
49 | uint16_t s_heigh = my_lcd.Get_Display_Height();
50 | //int16_t PIXEL_NUMBER;
51 |
52 | char file_name[FILE_NUMBER][FILE_NAME_SIZE_MAX];
53 |
54 | uint16_t read_16(File fp)
55 | {
56 | uint8_t low;
57 | uint16_t high;
58 | low = fp.read();
59 | high = fp.read();
60 | return (high<<8)|low;
61 | }
62 |
63 | uint32_t read_32(File fp)
64 | {
65 | uint16_t low;
66 | uint32_t high;
67 | low = read_16(fp);
68 | high = read_16(fp);
69 | return (high<<8)|low;
70 | }
71 |
72 | bool analysis_bpm_header(File fp)
73 | {
74 | if(read_16(fp) != 0x4D42)
75 | {
76 | return false;
77 | }
78 | //get bpm size
79 | read_32(fp);
80 | //get creator information
81 | read_32(fp);
82 | //get offset information
83 | bmp_offset = read_32(fp);
84 | //get DIB infomation
85 | read_32(fp);
86 | //get width and heigh information
87 | uint32_t bpm_width = read_32(fp);
88 | uint32_t bpm_heigh = read_32(fp);
89 | if((bpm_width != s_width) || (bpm_heigh != s_heigh))
90 | {
91 | return false;
92 | }
93 | if(read_16(fp) != 1)
94 | {
95 | return false;
96 | }
97 | read_16(fp);
98 | if(read_32(fp) != 0)
99 | {
100 | return false;
101 | }
102 | return true;
103 | }
104 |
105 | void draw_bmp_picture(File fp)
106 | {
107 | uint8_t bpm_data[480 * 3] = {0};
108 | fp.seek(bmp_offset);
109 | for(int y = 0; y < 320; y++)
110 | {
111 | fp.read(bpm_data, 480 * 3);
112 | for(int x = 0; x < 480; x++)
113 | {
114 | int m = x * 3;
115 | my_lcd.Set_Draw_color(my_lcd.Color_To_565(bpm_data[m + 2], bpm_data[m + 1], bpm_data[m + 0]));
116 | my_lcd.Draw_Pixel(319 - y, x);
117 | }
118 | }
119 | }
120 |
121 | void setup()
122 | {
123 | Serial.begin(115200);
124 | if (!SD.begin(53))
125 | {
126 | Serial.println("fail");
127 | }
128 |
129 | my_lcd.Init_LCD();
130 | my_lcd.Fill_Screen(BLUE);
131 | File bmp_file = SD.open("2.bmp");
132 | analysis_bpm_header(bmp_file);
133 | draw_bmp_picture(bmp_file);
134 | bmp_file.close();
135 | }
136 |
137 | void loop()
138 | {
139 | static int i = 0;
140 | //my_lcd.Vert_Scroll(0, 479, i&7);
141 | delay(50);
142 | i++;
143 | }
144 |
--------------------------------------------------------------------------------
/Tools/Lenticular.html:
--------------------------------------------------------------------------------
1 |
12 |
13 | bitluni's lenticular image generator
14 |
524 |
627 |
628 |
629 | bitluni's lenticular converter
630 |
631 |
655 |
656 | Files
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 | check out bitluni's lab
665 |