Methods Summary |
---|
public android.graphics.Bitmap | getBitmap()
return (mObject instanceof Bitmap) ? (Bitmap)mObject : null;
|
public java.nio.ByteBuffer | getData()
return (mObject instanceof ByteBuffer) ? (ByteBuffer)mObject : null;
|
public float[] | getFloats()
return (mObject instanceof float[]) ? (float[])mObject : null;
|
public int[] | getInts()
return (mObject instanceof int[]) ? (int[])mObject : null;
|
public java.lang.Object | getObjectValue()
return mObject;
|
protected boolean | hasNativeAllocation()
return false;
|
private void | initWithFormat(android.filterfw.core.FrameFormat format)
final int count = format.getLength();
final int baseType = format.getBaseType();
switch (baseType) {
case FrameFormat.TYPE_BYTE:
mObject = new byte[count];
break;
case FrameFormat.TYPE_INT16:
mObject = new short[count];
break;
case FrameFormat.TYPE_INT32:
mObject = new int[count];
break;
case FrameFormat.TYPE_FLOAT:
mObject = new float[count];
break;
case FrameFormat.TYPE_DOUBLE:
mObject = new double[count];
break;
default:
mObject = null;
break;
}
|
protected void | releaseNativeAllocation()
|
public void | setBitmap(android.graphics.Bitmap bitmap)
assertFrameMutable();
setGenericObjectValue(bitmap);
|
public void | setData(java.nio.ByteBuffer buffer, int offset, int length)
assertFrameMutable();
setGenericObjectValue(ByteBuffer.wrap(buffer.array(), offset, length));
|
public void | setFloats(float[] floats)
assertFrameMutable();
setGenericObjectValue(floats);
|
private void | setFormatObjectClass(java.lang.Class objectClass)
MutableFrameFormat format = getFormat().mutableCopy();
format.setObjectClass(objectClass);
setFormat(format);
|
protected void | setGenericObjectValue(java.lang.Object object)
// Update the FrameFormat class
// TODO: Take this out! FrameFormats should not be modified and convenience formats used
// instead!
FrameFormat format = getFormat();
if (format.getObjectClass() == null) {
setFormatObjectClass(object.getClass());
} else if (!format.getObjectClass().isAssignableFrom(object.getClass())) {
throw new RuntimeException(
"Attempting to set object value of type '" + object.getClass() + "' on " +
"SimpleFrame of type '" + format.getObjectClass() + "'!");
}
// Set the object value
mObject = object;
|
public void | setInts(int[] ints)
assertFrameMutable();
setGenericObjectValue(ints);
|
public java.lang.String | toString()
return "SimpleFrame (" + getFormat() + ")";
|
static android.filterfw.core.SimpleFrame | wrapObject(java.lang.Object object, android.filterfw.core.FrameManager frameManager)
FrameFormat format = ObjectFormat.fromObject(object, FrameFormat.TARGET_SIMPLE);
SimpleFrame result = new SimpleFrame(format, frameManager);
result.setObjectValue(object);
return result;
|