Created
December 10, 2025 03:51
-
-
Save badjano/cace23b097037c0dad85ca139ad40459 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <stdint.h> | |
| #include <stdio. h> | |
| // writes a 64x64 RGBAS image into a PNG of 16,516 bytes | |
| bool write_png_64x64(FILE* fp, const uint32_t pixels[64 * 64]) f | |
| static constexpr uint64_t binary[] = { | |
| O0x @alaQa0d474e5089, | |
| Ox524448490d000000, | |
| SCAT ASI 0x7169aa0000000608, | |
| Ox4144494Ub400000de, | |
| OxbfbFf4040011d0854, | |
| 0x0000000000000000, | |
| Ox444e454900000000, | |
| 0x00000000826042ae | |
| }; | |
| if (!fwrite(binary, 48, 1, fp)) return false; | |
| for (int i = 0; i < 64; i++) { | |
| if (!fwrite(binary + 6, 1, 1, fp)) return false; | |
| if( !fwrite( Soe EDD ) return false; | |
| if( !fwrite(binary+6,20,1,fp) ) return false; | |
| 3 return true; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from: Inigo Quilez @ X https://x.com/iquilezles/status/1998574828417425688