|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SampleData
General sampled data file (D-dimensional array of scalars).
Field Summary | |
---|---|
static java.lang.String |
FREQUENCY
Property name: frequency (in Hz). |
static int |
SAMPLE_BYTE
8-bit signed integer value. |
static int |
SAMPLE_COMPLEX
Complex number (double[2] array - uses double-sized array). |
static int |
SAMPLE_DOUBLE
floating-point (double precision) value. |
static int |
SAMPLE_FLOAT
floating-point (single precision) value. |
static int |
SAMPLE_INT
32-bit signed integer value. |
static int |
SAMPLE_LONG
64-bit signed integer value. |
static int |
SAMPLE_RGBA
RGB color (packed into one integer). |
static int |
SAMPLE_SHORT
16-bit signed integer value. |
static java.lang.String |
SAMPLE_TYPE
Property name: sample type. |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Method Summary | |
---|---|
java.lang.Object |
getDataArray(int[] dim)
Returns the original data array. |
int |
getDataDim(int[] dim)
Returns actual array dimensions. |
void |
getSampleGeometry(double[] geom)
Gets the sample geometry (in regular sample matrix). |
java.lang.Object |
getSampleMapping(java.lang.Object map,
int srcFrom,
int srcTo,
int[] bounds)
Retrieves the whole sample mapping (for mapped arrays only). |
int |
getSamples(int[] from,
int[] to,
double[] data)
Reads the given sample segment (float formats: float, double, complex). |
int |
getSamples(int[] from,
int[] to,
int[] data)
Reads the given sample segment (integer formats: byte, short, int, RGBA). |
int |
getSamples(int[] from,
int[] to,
long[] data)
Reads the given sample segment (long format). |
int |
getSamplesGeneral(int[] from,
int[] to,
java.lang.Object data)
Reads the given sample segment (general data format). |
int |
getSampleType()
Returns actual sample type (SAMPLE_* constant). |
void |
resetData(int type,
boolean mapped,
int[] dim)
(Re-)initialize the data array. |
void |
setDataArray(java.lang.Object data,
int srcFrom,
int[] dstFrom,
int[] dstTo)
Sets data array in the raw (internal) format. |
void |
setSampleGeometry(double[] geom)
Sets the sample geometry (in regular sample matrix). |
void |
setSampleMapping(java.lang.Object map,
int srcFrom,
int srcTo,
int dstFrom)
Sets (partially) the new sample mapping (for mapped arrays only). |
void |
setSamples(int[] from,
int[] to,
double[] data)
Writes the given sample segment (float formats: float, double, complex). |
void |
setSamples(int[] from,
int[] to,
int[] data)
Writes the given sample segment (integer formats: byte, short, int, RGBA). |
void |
setSamples(int[] from,
int[] to,
long[] data)
Writes the given sample segment (long format). |
void |
setSamplesGeneral(int[] from,
int[] to,
java.lang.Object data)
Writes the given sample segment (general data format). |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Field Detail |
---|
static final int SAMPLE_BYTE
static final int SAMPLE_SHORT
static final int SAMPLE_INT
static final int SAMPLE_LONG
static final int SAMPLE_FLOAT
static final int SAMPLE_DOUBLE
static final int SAMPLE_COMPLEX
static final int SAMPLE_RGBA
static final java.lang.String SAMPLE_TYPE
static final java.lang.String FREQUENCY
Method Detail |
---|
void resetData(int type, boolean mapped, int[] dim)
type
- Sample type (one of SAMPLE_* constants).mapped
- Should the array contain mapped values?dim
- Dimensions of an array.SAMPLE_BYTE
,
SAMPLE_SHORT
,
SAMPLE_INT
,
SAMPLE_LONG
,
SAMPLE_FLOAT
,
SAMPLE_DOUBLE
,
SAMPLE_COMPLEX
,
SAMPLE_RGBA
int getSampleType()
getDataDim(int[])
,
SAMPLE_BYTE
,
SAMPLE_SHORT
,
SAMPLE_INT
,
SAMPLE_LONG
,
SAMPLE_FLOAT
,
SAMPLE_DOUBLE
,
SAMPLE_COMPLEX
,
SAMPLE_RGBA
int getDataDim(int[] dim)
dim
- Pre-allocated array to hold individual dimensions' sizes.
getSampleType()
void setSampleGeometry(double[] geom)
geom
- Sample periods for all dimensions.getSampleGeometry(double[])
void getSampleGeometry(double[] geom)
geom
- Sample periods for all dimensions.setSampleGeometry(double[])
void setSampleMapping(java.lang.Object map, int srcFrom, int srcTo, int dstFrom)
map
- Mapping array to be set (should be an array of the apropriate type).srcFrom
- First source index (map[from]).srcTo
- After the last source index.dstFrom
- First destination index.getSampleMapping(java.lang.Object, int, int, int[])
java.lang.Object getSampleMapping(java.lang.Object map, int srcFrom, int srcTo, int[] bounds)
map
- Optional pre-allocated mapping array to be filled.srcFrom
- First index to be retrieved.srcTo
- After the last index to be retrieved.bounds
- Retrieved index bounds (bounds[0] = the 1st mapped value
written in map[0], bounds[1] = index after the last value).setSampleMapping(java.lang.Object, int, int, int)
java.lang.Object getDataArray(int[] dim)
dim
- Returned dimensionality (array of individual dimension sizes). Can be null.
setDataArray(java.lang.Object, int, int[], int[])
void setDataArray(java.lang.Object data, int srcFrom, int[] dstFrom, int[] dstTo)
data
- Packed 1D source data array (of apropriate type - integer has to be used for mapped types).srcFrom
- Source index to begin from.dstFrom
- Start of the region to be set. Can be null (instead of [0,0,0,..]).dstTo
- End of the region to be set. Can be null (instead of dim).int getSamplesGeneral(int[] from, int[] to, java.lang.Object data)
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result (packed 1D array).
void setSamplesGeneral(int[] from, int[] to, java.lang.Object data)
from
- Starting index.to
- Index after the written data.data
- Data to be written - in 1D array (integer indices for mapped data arrays).int getSamples(int[] from, int[] to, int[] data)
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result.
int getSamples(int[] from, int[] to, long[] data)
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result.
int getSamples(int[] from, int[] to, double[] data)
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result (complex uses double-sized array).
void setSamples(int[] from, int[] to, int[] data)
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array).void setSamples(int[] from, int[] to, long[] data)
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array).void setSamples(int[] from, int[] to, double[] data)
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array). Complex uses double-sized array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |