ios - Why [UIImage imageWithData:] supports PVRTC format? -
i find out in ios 8.3 sdk (i didn't test other versions), can use [uiimage imagewithdata:] load pvrtc format directly?
it isn't supposed that, right? can't find documentation or discussion it, don't know if can rely on it...
but work in both simulators , real devices.
here codes of test, test project doesn't include opengles.framework.
nsdata *data = the_content_of_a_pvr_file; nsstring *tempdir = nstemporarydirectory(); [data writetofile:[tempdir stringbyappendingpathcomponent:@"temp.pvr"] atomically:yes]; uiimage *tempimage = [uiimage imagewithdata:data]; [uiimagepngrepresentation(tempimage) writetofile:[tempdir stringbyappendingpathcomponent:@"temp.png"] atomically:yes];
the 2 saved files shared here: http://d.pr/f/17ugq
you can check pvr file in hex editor, coresponds specifications of pvrtc format version 2, pixel format in pvrtc4.
any idea?
Comments
Post a Comment