-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
24 lines (19 loc) · 728 Bytes
/
main.cpp
File metadata and controls
24 lines (19 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "image.h"
#define LOG(x) std::cout << x << std::endl
int main() {
using namespace vivid;
using namespace util;
Image image("res/cartoon_goat.png");
LOG("Size: " << image.getWidth() << "x" << image.getHeight());
LOG("Color format: " << image.getFormat().colorFormat);
LOG("Bit depth: " << image.getFormat().bitDepth);
LOG("Compression method: " << image.getFormat().compressionMethod);
LOG("Filter method: " << image.getFormat().filterMethod);
LOG("Interlace method: " << image.getFormat().interlaceMethod);
//const PixelRGBA* pixels = (PixelRGBA*) image.getData();
unsigned int x = 0;
unsigned int y = 120;
PixelRGBA pixel = image.getPixel(x, y);
std::printf("%08X\n", pixel.color());
return 0;
}