-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "arrayToBMP.h" | ||
|
||
int main() | ||
{ | ||
// The path we will save to. Would also work with "bar" instead of "bar.bmp". | ||
const char* path = ".\\foo\\bar.bmp"; | ||
|
||
// Define some colors with the getColor function. | ||
rgb24_t crimson = arrayToBMP::getColor(220, 20, 60); | ||
rgb24_t magenta = arrayToBMP::getColor(255, 0, 255); | ||
|
||
// Define some colors without getColor | ||
rgb24_t coral = 0xFF7F50; | ||
rgb24_t cadetBlue = 0x5F9EA0; | ||
|
||
// Our color-array we want to save. Every value is a pixel in the BMP | ||
rgb24_t pixels[] = { crimson, coral, magenta, | ||
crimson, cadetBlue, magenta, | ||
crimson, magenta, magenta }; | ||
|
||
size_t pixelsWidth = 3; // Width of our pixel-array. | ||
size_t pixelsHeight = 3; // Height of our pixel-array. | ||
|
||
// Save the array as BMP. | ||
arrayToBMP::ArrayToBMP(pixels, pixelsWidth, pixelsHeight, path); | ||
|
||
return 0; | ||
} |