Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 15 of file decode_png_main.cpp.
15 {
16 if (argc != 2) {
18 return 1;
19 }
20
22 if (!input || !input->isValid()) {
24 return 1;
25 }
26
29 if (!codec) {
30 printf(
"Cannot decode file %s as a PNG\n",
argv[1]);
32 return 1;
33 }
34
36 printf(
"Image is %d by %d pixels.\n",
info.width(),
info.height());
37
38 return 0;
39}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static std::unique_ptr< SkFILEStream > Make(const char path[])
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1