This template class is a general purpose scalar-sequence manager
![]() | A: The following are the constructors and destructors.
| ||||||||||||||
![]() | B: The following are methods used when constructing a sequence.
| ||||||||||||||
![]() | C: The following are methods for manipulating a previusly
|
This template class is a general purpose scalar-sequence manager. It was written, really, because I wanted to make lists of unsigned integers to be used for specifying frame sequences of movie loops. This idea was stolen . . ahem . . borrowed from D. Brainard's MatLab interface to D.G. Pelli's VideoToolbox library.After creating the class I have predefined a sequence manager for each scalar type:
// An 8-bit signed integer sequence manager. typedef iml_sequenceI then useiml_byte_sequence; // An 8-bit unsigned integer sequence manager. typedef iml_sequence iml_ubyte_sequence; // A 16-bit signed integer sequence manager. typedef iml_sequence iml_sint_sequence; // A 16-bit unsigned integer sequence manager. // This is the one we use to create the alias for // our image frame index manager. typedef iml_sequence iml_usint_sequence; // A 32-bit signed integer sequence manager. typedef iml_sequence iml_lint_sequence; // A 32-bit unsigned integer sequence manager. typedef iml_sequence iml_ulint_sequence; // A 32-bit floating point sequence manager. typedef iml_sequence iml_float_sequence; // A 64-bit floating point sequence manager. typedef iml_sequence iml_double_sequence; typedef iml_usint_sequence iml_imageframe_sequence;as the type for an image frame sequence.
iml_sequence(IML_USINT Len)
void operator=(iml_sequence
Type IML_REF operator[](IML_USINT I)
Type IML_REF operator()(IML_USINT I)
IML_USINT length(void)
0 1 2 3 4 5a call rotate(2) produces the new sequence
2 3 4 5 0 1
void shuffle(IML_USINT Times = 1)
for length() times do
create a pair of random integers between 0 and length()-1
swap those entries in the sequence
The default is to shuffle just once, but it is possible to to shuffle
the sequence an arbitrary number of times. A zero parameter value leaves
the sequence unchanged.
generated by doc++