NAME
data_store -- store and retrieve image sequences
PROTOTYPE
unitptr data_store( char *pcFmt, int iNumRecs, int *piDim, unitptr uHost)
ARGUMENTS
- char *pcFmt
- format string f = float i = int b = byte m = mono c = color
- int iNumRecs
- number of data elements to store
- int *piDim
- dimension of data vectors
- unitptr uHost
- host unit of created unit
INTERFACE:
For each non-space char c=pcFmt[i] in pcFmt there will be an input and
a corresponding output field. Depending on the character c,
these will have the following types:
- c='f':
- a float field of dimension aiDim[i] (packed or
unpacked)
- c='m':
- a packed byte field of aiDim[i] pins for a monochrome
image
- c='M':
- a packed float field of aiDim[i] pins for a monochrome
image (internal storage only one byte per pixel)
- c='c':
- as 'm', but three fields for an rgb image.
- c='C':
- as 'M', but three fields for an rgb image.
- c='t':
- a field of type text.
Furthermore, there will be an additional control input and a counting
output:
- CTL_in[3]:
- control field. CTL_in[0] = increment of record nr
in loading mode, CTL_in[1] = lower limit, CTL_in[2]=
upper limit of internal buffer accessed.
- out[last]:
- nr of currently offered output record.
FORMAT STRING:
- tFmt:
- A string of letters from the set "fmct". Each "m" causes the
creation of one monochrome channel (one input and one matching
output field), each "c" the creation of three channels interpreted
as rgb-triple.
CONTROL MODES:
- NST_INIT
- set unit into loading mode, next exec starts at
first record.
- NST_RESET
- reset internal record counter to first record.
DESCRIPTION:
This unit can be in two modes of operation that are chosen with
the ctrl_unit function.
A call ctrl_unit(mode,u) with mode NST_INIT or
sets the unit into loading mode.
When set into loading mode, each of the next iNum exec_unit calls
will load a new data record into the internal data buffer and
increment the internal record counter (it value is available
at the last output field) by one.
When the buffer is full (after iNum exec_calls in loading mode),
the unit switches into retrieval mode, with the record pointer
immediately before the first record (or at CTL_in[1]-1, see
below).
In retrieval mode, the values (1,i,i) at the control field
CTL_in will cause the next exec_unit call to retrieve the
i-th record.
Otherwise, if CTL_in[1]!=CTL_in[2],
each exec_unit call will first increment
the internal record counter by the value CTL_in[0]
(using wraparound, when the highest
record number is reached) and copy the current
record and its record number to the output fields.
If CTL_in[0]=0, nothing will be done.
By specifiying a lower and an upper limit in CTL_in[1] and
CTL_in[2], the above operations (including the loading
operation) can be restricted to a subrange of the maximal
buffer size (if the specified range is not within the
maximal range, the intersection of both ranges is used).
This allows, e.g., to replace only a subset of the loaded
records with the loading mode. CTL_in[1]=i, CTL_in[2]=i+1
allows, e.g., to replace record i selectively.
SEE ALSO:
image_store
FILE
/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../foldersrc/nst_util.c