Android SKIA Image Decoding
HI,
I am currently studying how Android decode and image file. When I checked the code, it seems like it is calling the SKIA library. But, how do I know what are the image file format supported by android/skia basing on the source code?
I am not an expert in programming, so I am st开发者_如何学Pythonill trying to understand C++ and Java language.
I am now lost at SkImageDecoder* decoder = SkImageDecoder::Factory(stream);
inside the BitmapFactory.cpp (JNI file). SkImageDecoder::Factory(stream)
seems to be a template.
Anyone can explain me what is happening inside SKImageDecoder::Factory()
? Any feedback will be greatly appreciated.
Thanks,
artsylarIn skia/include/images/SkImageDecoder.h file, there is the image list decoding supported by Skia:
enum Format {
kUnknown_Format,
kBMP_Format,
kGIF_Format,
kICO_Format,
kJPEG_Format,
kPNG_Format,
kWBMP_Format,
kWEBP_Format,
kLastKnownFormat = kWEBP_Format
};
In SkImageDecoder::Factory(stream) function, it will new a decoder instance according to analyze the Stream's header.
By looking at the source codes of Android, I think the following image formats are supported. ICO (Windows ICON image format), BMP, JPEG, WBMP, GIF, and PNG.
Please correct me if I am wrong. Thank you.
PNG, JPEG, and GIF are the supported formats. The primary formats used on Android are PNG and JPEG.
精彩评论