Methods Summary |
---|
protected void | assertFrameMutable()
if (isReadOnly()) {
throw new RuntimeException("Attempting to modify read-only frame!");
}
|
protected static android.graphics.Bitmap | convertBitmapToRGBA(android.graphics.Bitmap bitmap)
if (bitmap.getConfig() == Bitmap.Config.ARGB_8888) {
return bitmap;
} else {
Bitmap result = bitmap.copy(Bitmap.Config.ARGB_8888, false);
if (result == null) {
throw new RuntimeException("Error converting bitmap to RGBA!");
} else if (result.getRowBytes() != result.getWidth() * 4) {
throw new RuntimeException("Unsupported row byte count in bitmap!");
}
return result;
}
|
final int | decRefCount()
--mRefCount;
return mRefCount;
|
public long | getBindingId()
return mBindingId;
|
public int | getBindingType()
return mBindingType;
|
public abstract android.graphics.Bitmap | getBitmap()
|
public int | getCapacity()
return getFormat().getSize();
|
public abstract java.nio.ByteBuffer | getData()
|
public abstract float[] | getFloats()
|
public android.filterfw.core.FrameFormat | getFormat()
return mFormat;
|
public android.filterfw.core.FrameManager | getFrameManager()
return mFrameManager;
|
public abstract int[] | getInts()
|
public abstract java.lang.Object | getObjectValue()
|
public int | getRefCount()
return mRefCount;
|
public long | getTimestamp()
return mTimestamp;
|
protected abstract boolean | hasNativeAllocation()
|
final int | incRefCount()
++mRefCount;
return mRefCount;
|
public boolean | isReadOnly()
return mReadOnly;
|
final boolean | isReusable()
return mReusable;
|
final void | markReadOnly()
mReadOnly = true;
|
protected void | onFrameFetch()Called when a frame is fetched from an internal store such as a cache.
|
protected void | onFrameStore()Called just before a frame is stored, such as when storing to a cache or context.
|
public android.filterfw.core.Frame | release()
if (mFrameManager != null) {
return mFrameManager.releaseFrame(this);
} else {
return this;
}
|
protected abstract void | releaseNativeAllocation()
|
protected boolean | requestResize(int[] newDimensions)
return false;
|
protected void | reset(android.filterfw.core.FrameFormat newFormat)
mFormat = newFormat.mutableCopy();
mReadOnly = false;
mRefCount = 1;
|
public android.filterfw.core.Frame | retain()
if (mFrameManager != null) {
return mFrameManager.retainFrame(this);
} else {
return this;
}
|
public abstract void | setBitmap(android.graphics.Bitmap bitmap)
|
public abstract void | setData(java.nio.ByteBuffer buffer, int offset, int length)
|
public void | setData(java.nio.ByteBuffer buffer)
setData(buffer, 0, buffer.limit());
|
public void | setData(byte[] bytes, int offset, int length)
setData(ByteBuffer.wrap(bytes, offset, length));
|
public void | setDataFromFrame(android.filterfw.core.Frame frame)
setData(frame.getData());
|
public abstract void | setFloats(float[] floats)
|
protected void | setFormat(android.filterfw.core.FrameFormat format)
mFormat = format.mutableCopy();
|
protected void | setGenericObjectValue(java.lang.Object value)
throw new RuntimeException(
"Cannot set object value of unsupported type: " + value.getClass());
|
public abstract void | setInts(int[] ints)
|
public void | setObjectValue(java.lang.Object object)
assertFrameMutable();
// Attempt to set the value using a specific setter (which may be more optimized), and
// fall back to the setGenericObjectValue(...) in case of no match.
if (object instanceof int[]) {
setInts((int[])object);
} else if (object instanceof float[]) {
setFloats((float[])object);
} else if (object instanceof ByteBuffer) {
setData((ByteBuffer)object);
} else if (object instanceof Bitmap) {
setBitmap((Bitmap)object);
} else {
setGenericObjectValue(object);
}
|
protected void | setReusable(boolean reusable)
mReusable = reusable;
|
public void | setTimestamp(long timestamp)
mTimestamp = timestamp;
|