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
An image format's style effectively determines the bit depth of the images stored in an image table. The following styles are currently available:
188
+
189
+
- 32-bit color plus an alpha component (default)
190
+
- 32-bit color, no alpha component
191
+
- 16-bit color, no alpha component
192
+
- 8-bit grayscale, no alpha component
193
+
194
+
If the source images lack transparency (e.g., JPEG images), then better Core Animation performance can be achieved by using 32-bit color with no alpha component. If the source images have little color detail, or if the image format's image size is relatively small, it may be sufficient to use 16-bit color with little or no perceptible loss of quality. This results in smaller image table files stored on disk.
195
+
186
196
#### Configuring the Image Cache
187
197
188
198
Once one or more image formats have been defined, they need to be assigned to the image cache. Aside from assigning the image cache's delegate, there is nothing further that can be configured on the image cache itself.
@@ -332,7 +342,26 @@ There are two ways to provide source images to the image cache.
332
342
```
333
343
334
344
> **Note**: Fast Image Cache does **not** persist source images. See [Source Image Persistence](#source-image-persistence) for more information.
335
-
345
+
346
+
### Cancelling Source Image Requests
347
+
348
+
If an image request is already in progress, it can be cancelled:
349
+
350
+
```objective-c
351
+
// We scrolled up far enough that the image we requested in no longer visible; cancel the request
When this happens, Fast Image Cache cleans up its internal bookkeeping, and any completion blocks from the corresponding image request will do nothing at this point. However, the image cache's delegate is still responsible for ensuring that any outstanding source image requests (e.g., network requests) are cancelled:
The advantage of classifying image formats into families is that the image cache's delegate can tell the image cache to process entity source images for **all** image formats in a family when **any** image format in that family is processed.
0 commit comments