|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.DataMatrix
public class DataMatrix
Module holding N-dimensional data matrix.
Field Summary | |
---|---|
protected int[] |
accel
Accelerators: submatrix sizes (accel[i] = Prod_{j=i..N} dim[j]). |
protected static java.lang.String |
CATEGORY
Object category. |
protected byte[] |
dataByte
The data array itself (byte format). |
protected double[] |
dataDouble
The data array itself (byte format). |
protected float[] |
dataFloat
The data array itself (byte format). |
protected int[] |
dataInt
The data array itself (byte format). |
protected long[] |
dataLong
The data array itself (byte format). |
protected short[] |
dataShort
The data array itself (byte format). |
protected int[] |
dim
Actual dimension sizes (dim.length == dims). |
protected int |
dims
Actual number of sample-array dimensions. |
protected double[] |
geometry
Sample-array geometry (1 double for one dimension = uniform distance between samples). |
protected java.lang.Object |
map
Data mapping (used together with integer data matrix). |
static RegPiece |
reg
Static registration instance for this class. |
protected int |
sampleType
Actual sample type. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected int |
totalSize
Total 1D packed array size (equal to accel[0] ). |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.SampleData |
---|
FREQUENCY, SAMPLE_BYTE, SAMPLE_COMPLEX, SAMPLE_DOUBLE, SAMPLE_FLOAT, SAMPLE_INT, SAMPLE_LONG, SAMPLE_RGBA, SAMPLE_SHORT, SAMPLE_TYPE |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
DataMatrix()
|
Method Summary | |
---|---|
protected int |
countIndex(int[] ind)
Computes item index of ind[0] .. ind[dims-2] (w/o the last - fastest - index). |
protected java.lang.Object |
dataArray()
Returns internal packed 1D array of the apropriate type. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
protected java.lang.Class<?> |
getComponentClass(java.lang.Object array)
Determines array's component type (returns null if there is a problem). |
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 |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
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). |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected int dims
protected int[] dim
protected int[] accel
protected int totalSize
accel[0]
).
protected int sampleType
map
!= null
, the actual data array has to be SampleData.SAMPLE_INT
.
protected double[] geometry
protected byte[] dataByte
protected short[] dataShort
protected int[] dataInt
protected long[] dataLong
protected float[] dataFloat
protected double[] dataDouble
protected java.lang.Object map
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public DataMatrix()
Method Detail |
---|
protected java.lang.Object dataArray()
protected java.lang.Class<?> getComponentClass(java.lang.Object array)
protected final int countIndex(int[] ind)
public void resetData(int type, boolean mapped, int[] dim)
resetData
in interface SampleData
type
- Sample type (one of SAMPLE_*
constants).mapped
- Should the array contain mapped values?dim
- Dimensions of an array.SampleData.SAMPLE_BYTE
,
SampleData.SAMPLE_SHORT
,
SampleData.SAMPLE_INT
,
SampleData.SAMPLE_LONG
,
SampleData.SAMPLE_FLOAT
,
SampleData.SAMPLE_DOUBLE
,
SampleData.SAMPLE_COMPLEX
,
SampleData.SAMPLE_RGBA
public int getSampleType()
SAMPLE_*
constant).
getSampleType
in interface SampleData
SAMPLE_*
constant).getDataDim(int[])
,
SampleData.SAMPLE_BYTE
,
SampleData.SAMPLE_SHORT
,
SampleData.SAMPLE_INT
,
SampleData.SAMPLE_LONG
,
SampleData.SAMPLE_FLOAT
,
SampleData.SAMPLE_DOUBLE
,
SampleData.SAMPLE_COMPLEX
,
SampleData.SAMPLE_RGBA
public int getDataDim(int[] dim)
getDataDim
in interface SampleData
dim
- Pre-allocated array to hold individual dimensions' sizes.
getSampleType()
public void setSampleGeometry(double[] geom)
setSampleGeometry
in interface SampleData
geom
- Sample periods for all dimensions.getSampleGeometry(double[])
public void getSampleGeometry(double[] geom)
getSampleGeometry
in interface SampleData
geom
- Sample periods for all dimensions.setSampleGeometry(double[])
public void setSampleMapping(java.lang.Object map, int srcFrom, int srcTo, int dstFrom)
setSampleMapping
in interface SampleData
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[])
public java.lang.Object getSampleMapping(java.lang.Object map, int srcFrom, int srcTo, int[] bounds)
getSampleMapping
in interface SampleData
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)
public java.lang.Object getDataArray(int[] dim)
getDataArray
in interface SampleData
dim
- Returned dimensionality (array of individual dimension sizes). Can be null.
null
if the service is not
available.setDataArray(java.lang.Object, int, int[], int[])
public void setDataArray(java.lang.Object data, int srcFrom, int[] dstFrom, int[] dstTo)
setDataArray
in interface SampleData
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
).public int getSamplesGeneral(int[] from, int[] to, java.lang.Object data)
getSamplesGeneral
in interface SampleData
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result (packed 1D array).
public void setSamplesGeneral(int[] from, int[] to, java.lang.Object data)
setSamplesGeneral
in interface SampleData
from
- Starting index.to
- Index after the written data.data
- Data to be written - in 1D array (integer indices for mapped data arrays).public int getSamples(int[] from, int[] to, int[] data)
getSamples
in interface SampleData
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result.
public int getSamples(int[] from, int[] to, long[] data)
getSamples
in interface SampleData
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result.
public int getSamples(int[] from, int[] to, double[] data)
getSamples
in interface SampleData
from
- Starting index.to
- Index after retrieved data.data
- Pre-allocated array to hold the result (complex uses double-sized array).
public void setSamples(int[] from, int[] to, int[] data)
setSamples
in interface SampleData
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array).public void setSamples(int[] from, int[] to, long[] data)
setSamples
in interface SampleData
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array).public void setSamples(int[] from, int[] to, double[] data)
setSamples
in interface SampleData
from
- Starting index.to
- Index after written data.data
- Data to be written (1D array). Complex uses double-sized array.public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |