| synopsis || arguments || prev || next |
void add( kdu_sampled_range range)
Java: void Add( Kdu_sampled_range range)
[Declared in "../apps/compressed_io/kdu_client_window.h"]
Add a new (possibly sub-sampled) range of indices to those already in the set. The function may simply add this range onto the end of the list of ranges, but it might also find a more efficient way to represent the indices with the same, or a smaller number of ranges. If the new range fills in a hole, for example, the number of distinct ranges in the list might be reduced. The function is not required to find the most efficient representation for the set of indices represented by all calls to this function since the last call to init, since finding the most efficient representation is a non-trivial problem, and probably not worth the effort.
The function adjusts the to members of the various ranges to ensure that they take the smallest possible values which are consistent with the set of indices represented by the range. This means that the to member will actually be equal to the last index in the range, unless the from member is negative; see the introduction to kdu_range_set object for a discussion of the special interpretation given to ranges with negative from indices.