You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a model object that has an image URL (a person's avatar, say).
When that object is loaded, begins loading its image at native size (OGCachedImage, most likely).
As the various UIs need particular sizes of the image, create new OGScaledImage instances from that base image, at the specific resolution(s) required.
Now, the OGImage subclasses to have initializers that take __OGImage objects, and apply their specific operations to them. (Those should probably take UIImage, because there doesn't seem to be any—public—way to get an __OGImage from an OGImage.) However, it may well be the case that the scaled image is created from the base image while the resource is still being loaded from the web, in which case there is no concrete image data associated with the base OGImage yet (or different, if it was created with a placeholder).
The new instance would become an observer of the original instance, and when the base instance's image changes, the new instance would (re)apply its processing and set a new value for its own image and scaledImage.
It has been pointed out to me that two OGImage objects loading the same URL will piggyback off of the same network request, so this effect could be approximated by creating the new instance with the base instance's URL, like so:
Here's what I'd like to be able to do:
OGCachedImage
, most likely).OGScaledImage
instances from that base image, at the specific resolution(s) required.Now, the
OGImage
subclasses to have initializers that take__OGImage
objects, and apply their specific operations to them. (Those should probably takeUIImage
, because there doesn't seem to be any—public—way to get an__OGImage
from anOGImage
.) However, it may well be the case that the scaled image is created from the base image while the resource is still being loaded from the web, in which case there is no concrete image data associated with the baseOGImage
yet (or different, if it was created with a placeholder).What I'm imagining is something like:
The new instance would become an observer of the original instance, and when the base instance's
image
changes, the new instance would (re)apply its processing and set a new value for its ownimage
andscaledImage
.It has been pointed out to me that two
OGImage
objects loading the same URL will piggyback off of the same network request, so this effect could be approximated by creating the new instance with the base instance's URL, like so:So maybe I'm over-complicating things?
The text was updated successfully, but these errors were encountered: