![]() | InDesign SDK 20.5 |
#include <IImageCacheMgr.h>

Public Member Functions | |
| virtual ErrorCode | Add (const UIDRef &imageRef, IImageCache *cache, bool8 purgeFirst=kFalse, uint32 selector=kRasterImage)=0 |
| virtual uint32 | Purge (const UIDRef &imageRef, IImageCache *cache)=0 |
| virtual uint32 | Purge (const UIDRef &imageRef, const PMReal &resolution, uint32 selector=kWildCard)=0 |
| virtual uint32 | Purge (const UIDRef &imageRef, uint32 selector=kWildCard)=0 |
| virtual uint32 | Purge (const IDataBase *db, uint32 selector=kWildCard)=0 |
| virtual uint32 | GetSize (void) const =0 |
| virtual bool16 | GetClosestMatchResolution (const UIDRef &imageRef, PMReal &resolution, uint32 selector=kRasterImage, uint32 *selectorFound=nil) const =0 |
| virtual IImageCache * | QueryClosestResolution (const UIDRef &imageRef, const PMReal &resolution, uint32 selector=kRasterImage, uint32 *selectorFound=nil)=0 |
| virtual IImageCache * | QueryPreviousResolution (const UIDRef &imageRef, const IImageCache ¤tCache, uint32 selector=kRasterImage, uint32 *selectorFound=nil)=0 |
| virtual IImageCache * | QueryNextResolution (const UIDRef &imageRef, const IImageCache ¤tCache, uint32 selector=kRasterImage, uint32 *selectorFound=nil)=0 |
| virtual IImageCache * | Resample (const UIDRef &imageRef, uint32 srcSelector, uint32 dstSelector, const PMReal &resToResampleFrom, const PMReal &resToResampleTo, IImageStreamManager::ResamplingType &sampleType, bool32 bForceNonVirtual=kFalse)=0 |
| virtual void | SetMaxSize (uint32 kiloBytes)=0 |
| virtual void | PurgeMemory (int32 level, bool16 inGrowZone)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
IImageCacheMgr Description: The IImageCacheMgr is used to store 1 or more in-memory raster images for a given page item. Image's are identified by a UIDRef, resolution and a 32-bit selector. The IImageCacheMgr makes it easy for the Draw method of an IShape implementation to store caches at various resolutions for its page item and easily retrieve them. One major benefit of the IImageCacheMgr is that it allows copies of page items to easily share caches. It also has the ability to serialize caches to temp files in low memory situations without forcing the client to reconstruct the cache from scratch.
| anonymous enum |
Selectors enumeration
| pure virtual |
Add Add a cache to the list along with information about the size of the cache and the amount of time needed to compute the cache. cache->AddRef() will be called. purgeFirst signals the IImageCacheMgr that it should remove this item first during a PurgeMemory() call.
| imageRef | - IN: the UIDRef of the page item. |
| cache | - IN: the cache to add. |
| purgeFirst | - IN: A hint to the memory management system that it is okay to purge this cache first as it is being used for a short term purpose. |
| selector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. |
| pure virtual |
Return the resolution of the IImageCache which would be returned via QueryClosestResolution(). This call avoids add-refing of the IImageCache and keeps it out of any LRU lists. Returns kTrue if an image is found.
| imageRef | - IN: the UIDRef of the page item. |
| resolution | - IN/OUT: On input, the desired resolution. On output, the actual resolution found. |
| selector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. |
| selectorFound | - OUT: Optional. If non-nil and a cache is found, the selector of the cache is returned. |
| pure virtual |
Get the total size of the image caches tracked by the IImageCacheMgr
| pure virtual |
Purge an image cache and call cache->Release().
| pure virtual |
Purge all caches matching the given imageRef, resolution and selector.
| pure virtual |
Purge all image caches associated with the given imageRef.
| pure virtual |
Purge all image caches associated with the given db.
| pure virtual |
Purge routine registered with the memory manager which uses heuristics to purge image caches.
| pure virtual |
Find the closest resolution which is greater than or equal to the requested resolution. If one cannot be found, then find the first resolution which is less than the requested resolution. If a cache for the given imageRef cannot be found, then nil is returned.
| imageRef | - IN: the UIDRef of the page item. |
| resolution | - IN: the desired resolution. |
| selector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. |
| selectorFound | - OUT: Optional. If non-nil and a cache is found, the selector of the cache is returned. |
| pure virtual |
Given an imageRef and an image cache, find the next largest resolution cache for the same image
| imageRef | - IN: the UIDRef of the page item. |
| currentCache | - IN: tells the IImageCacheMgr to look relative to this cache. |
| selector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. |
| selectorFound | - OUT: Optional. If non-nil and a cache is found, the selector of the cache is returned. |
| pure virtual |
Given an imageRef and an image cache, find the next smallest resolution cache for the same image
| imageRef | - IN: the UIDRef of the page item. |
| currentCache | - IN: tells the IImageCacheMgr to look relative to this cache. |
| selector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. |
| selectorFound | - OUT: Optional. If non-nil and a cache is found, the selector of the cache is returned. |
| pure virtual |
Resample an existing cache to create a lower resolution cache.
| imageRef | - IN: the UIDRef of the page item. |
| srcSelector | - IN: Another key. This key allows the client to store different types of caches. For example, you may have a color managed version, an uncalibrated version, a drop shadow mask and an alpha mask all at the same resolution for a given page item. The srcSelector is used to help identify the source image from which we will resample. |
| dstSelector | - IN: The resulting cache will be added to the ImageCacheMgr using dstSelector as a key. Typically, the dstSelector is the same as the srcSelector. |
| resToResampleFrom | - IN: The source resolution. This parameter is used as another key for identifying the source image cache. |
| resToResampleTo | - IN: The destination resolution. |
| sampleType | - IN/OUT: On input, the desired resampling type. For non-virtual images, AGM does the resampling and they support 2 kinds: Bicubic and Dowsampling (averaging). Therefore, on if AGM is used to resample the image and Subsampling is chosen, Downsampling will be used instead (which is of higher quality than Subsampling but slower). On return, therefore, this parameter will be set to the actual sampling method used. |
| bForceNonVirtual | - IN: If the source image is virtual, the typical result of downsampling is another virtual image which will downsample from the original EVERY time it is drawn. If this cache is going to be used to draw to the screen and will be drawn multiple times, then assuming you have enough memory, it is more optimal to convert the image to a non-virtual image. If after conversion the application gets low on memory, the ImageCacheMgr will serialize the image to disk. |
| pure virtual |
OBSOLETE Set a maximum amount of memory which can be used by IImageCaches in kilobytes.