PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/test/png_test.c

http://ftk.googlecode.com/
C | 18 lines | 15 code | 3 blank | 0 comment | 2 complexity | 6e60f4f62f073a029dcecb84a1d0f3eb MD5 | raw file
 1#include "ftk.h"
 2#include "ftk_image_png_decoder.h"
 3
 4int main(int argc, char* argv[])
 5{
 6	FtkBitmap* bitmap = NULL;
 7	const char* filename = argv[1];
 8	ftk_set_allocator(ftk_allocator_default_create());
 9	FtkImageDecoder* thiz = ftk_image_png_decoder_create();
10	
11	assert(ftk_image_decoder_match(thiz, filename) == RET_OK);
12	assert((bitmap = ftk_image_decoder_decode(thiz, filename)) != NULL);
13	printf("w=%d h=%d\n", ftk_bitmap_width(bitmap), ftk_bitmap_height(bitmap));
14	ftk_bitmap_unref(bitmap);
15	ftk_image_decoder_destroy(thiz);
16
17	return 0;
18}