Description
Sets the next access priority for specified frames
-
Return Type
-
None
-
Syntax
-
object.SetNextAccessPriority [BasePriority], [FramesSelector], [DeltaEndPriority]
The SetNextAccessPriority Method syntax has these parts: |
| object | An expression evaluating to an object of type McImage. | | BasePriority | Optional. A Double value. The McFrame.NextAccessPriority value to be given to the first frame in the sequence of given by the FramesSelector argument. This value is 110.0 by default, which is higher than the default NextAccessPriority given to any frame after it is accessed.
| | FramesSelector | Optional. A Variant value. An optional selector for the frames to be set. If missing or Empty then if UseActiveFrameRange is True, the frames are those in the ActiveFrameRange and if UseActiveFrameRange is False, only the ActiveFrame is set. If the argument is given, then if it is a scalar -1, all frames in the image are set in order from first to last. The selector may be an array of VARIANT, in which case the contents of each VARIANT are added to the list of frames. Each VARIANT may be a single scalar index value (if negative, then all frames are added), or it may be a single scalar LONGRANGE giving Start and End frame indices, or it may be an array of index values or an array of LONGRANGE index ranges. In addition, it may be an McFrame object instance or an array of them; each of these McFrame instances must one of the frames in this McImage's frame list (see the Frame property). Finally, the FramesSelector argument may be an McFrames collection (or an array of them) with a ParentImage the same as this one. In this case the entire contents of the McFrames collection(s) is added the list of frames to set.
| | DeltaEndPriority | Optional. A Double value. The offset from the BasePriority that is the the McFrame.NextAccessPriority value to be given to the last frame in the sequence of given by the FramesSelector argument. This value is -5.0 by default, so that for the default BasePriority value of 110, the last frame is given a priority of 105. Note that if you are planning to traverse the frames in reverse order (as in playing a sequence backwards), then the appropriate value for DeltaEndPriority will usually be a positve value (e.g., +5).
| Remarks
McFrame.NextAccessPriority is the measure used to determine which frames are likely to be needed again soon. This information helps choose the memory to be spooled out to disk when image memory usage approaches the allowed limits.
When operations are being performed on multiple frames of a multi-frame image, you will want to keep frames likely to be needed next in memory to the extent possible. When UseActiveFrameRange is True, most image operations will loop through the frames in the ActiveFrameRange, performing the operation on each frame in turn. Thus before performing the operation, you want all ActiveFrameRange frames to have a priority higher than the default of 100 (given whenever a frame was last accessed), and you want frames earlier in the sequence to have a higher priority than frames later in the sequence. After each frame is operated on, then the NextAccessPriority for that frame can be set to a lower value (See example).
The default parameters for this method support the above scenario by assigning a NextAccessPriority of 110 to the first frame in the ActiveFrameRange (or to the ActiveFrame if UserActiveFrameRange is False) and then successively lower priorities to other frames until the last frame is given a NextAccessPriority of 105. It is the callers responsibility to set the NextAccessPriority after it has been operated on.
|