AGSDynamicLayer image format

576
1
09-10-2013 12:31 PM
PatrickHartling
New Contributor III
Is there any restriction on the data format that a subclass of AGSDynamicLayer can supply through the -setImageData:forEnvelope: method? I have been creating the NSData object using UIImagePNGRepresentation(), but that function is proving to be too slow for what I am trying to achieve. I do not see a way to supply a mask representing the alpha channel to AGSDynamicLayer when the NSData object is made by UIImageJPEGRepresentation(). That leaves me considering TIFF, but it will take me a bit of time to incorporate libtiff into my project. If TIFF data will not work with AGSDynamicLayer, then I will concentrate on finding some other way to improve performance.
0 Kudos
1 Reply
PatrickHartling
New Contributor III
I tried using the Image I/O framework to produce TIFFs rather than diving into adding libtiff to the application. I saved the TIFF images to disk and loaded them in Preview as a way to gauge the correctness of my TIFF generation code. The imagery never shows up in my layer, though, and I take that to mean that there is no SkImageDecoder implementation for TIFF.

Should I be able to send the source bitmap instead of encoding that bitmap as a PNG? I am rendering everything using Core Graphics, creating a UIImage from the bitmap context, and then converting that to PNG data to pass to -setImageData:forEnvelope:. If I could just pull the data buffer from the bitmap context and hand that off as NSData, that would remove a costly step from my pipeline.
0 Kudos