Methods Summary |
---|
public void | fieldPortValueUpdated(java.lang.String name, android.filterfw.core.FilterContext context)
// Clear image (to trigger reload) in case parameters have been changed
if (name.equals("bitmap") || name.equals("target")) {
if (mImageFrame != null) {
mImageFrame.release();
mImageFrame = null;
}
}
|
public void | loadImage(android.filterfw.core.FilterContext filterContext)
// Create frame with bitmap
mTarget = FrameFormat.readTargetString(mTargetString);
FrameFormat outputFormat = ImageFormat.create(mBitmap.getWidth(),
mBitmap.getHeight(),
ImageFormat.COLORSPACE_RGBA,
mTarget);
mImageFrame = filterContext.getFrameManager().newFrame(outputFormat);
mImageFrame.setBitmap(mBitmap);
mImageFrame.setTimestamp(Frame.TIMESTAMP_UNKNOWN);
// Free up space used by bitmap
if (mRecycleBitmap) {
mBitmap.recycle();
}
mBitmap = null;
|
public void | process(android.filterfw.core.FilterContext context)
if (mImageFrame == null) {
loadImage(context);
}
pushOutput("image", mImageFrame);
if (!mRepeatFrame) {
closeOutputPort("image");
}
|
public void | setupPorts()
// Setup output format
FrameFormat outputFormat = ImageFormat.create(ImageFormat.COLORSPACE_RGBA,
FrameFormat.TARGET_UNSPECIFIED);
// Add output port
addOutputPort("image", outputFormat);
|
public void | tearDown(android.filterfw.core.FilterContext env)
if (mImageFrame != null) {
mImageFrame.release();
mImageFrame = null;
}
|