FastCV Sample Application  1.7.1
com.qualcomm.fastcvdemo.base.GraphicalActivity Class Reference

Inherits Activity.

Inherited by com.qualcomm.fastcvdemo.apis.featureDetection.Corner, com.qualcomm.fastcvdemo.apis.imageProcessing.Filter, com.qualcomm.fastcvdemo.apis.imageProcessing.FilterCorr, com.qualcomm.fastcvdemo.apis.imageProcessing.ImageGradient, com.qualcomm.fastcvdemo.apis.imageProcessing.ImgDiff, com.qualcomm.fastcvdemo.apis.imageTransformation.Affine, com.qualcomm.fastcvdemo.apis.imageTransformation.Rotate, com.qualcomm.fastcvdemo.apis.imageTransformation.Scale, com.qualcomm.fastcvdemo.apis.imageTransformation.ScaleDownMN, and com.qualcomm.fastcvdemo.apis.imageTransformation.Warp.

Public Member Functions

void onCreate (Bundle savedInstanceState)
boolean onCreateOptionsMenu (Menu menu)
void setCallback ()
abstract void update (byte[] data, int w, int h)
abstract void cleanup ()
void requestRender ()

Protected Member Functions

void onResume ()
void bringControlsToFront ()
void onPause ()
void setupCamera ()
void startPreview ()
void stopPreview ()
abstract void initTitle ()

Protected Attributes

int mMainLayout = R.layout.main
Camera mCamera
GLSurfaceView mGLSurface = null
CameraSurface mCamSurface = null
ViewGroup mRootViewGroup = null
FastCVSampleRenderer mRenderer
TextView[] mText = new TextView[3]
ToggleButton tbtnStartStop
boolean mPreviewRunning = false
byte[] mPreviewBuffer = null
final int mBackgroundColor = 0xFF728FCE
final int mTextColor = 0xFFFFFFFF
float mProcessTime = 10
int mPreviewWidth
int mPreviewHeight
Handler mProfileHandler = new Handler()
long mProfilePeriod = 300
long startTime
FastCVUtil util = new FastCVUtil()
final Camera.PreviewCallback mCameraCallback
Runnable mUpdateTimeTask

Static Protected Attributes

static final String TAG = "FastCVDemo"
static int mDesiredWidth = 800
static int mDesiredHeight = 480
static String title = "FastCVDemo"

Detailed Description

The main activity for the FastCV FAST Corner sample app.


Member Function Documentation

Brings the controls to the foreground

void com.qualcomm.fastcvdemo.base.GraphicalActivity.onCreate ( Bundle  savedInstanceState) [inline]

Called when the activity is first created.

Suspends camera preview, cleans up the renderer

Request render for on demand rendering.

Sets the Camera preview callback


Field Documentation

Background color for text boxes.

Android camera object

final Camera.PreviewCallback com.qualcomm.fastcvdemo.base.GraphicalActivity.mCameraCallback [protected]
Initial value:
 
      new Camera.PreviewCallback()
   {
      
      public void onPreviewFrame( byte[] data, Camera c )
      {
         
         util.cameraFrameTick();

         
         update( data, mDesiredWidth, mDesiredHeight );
         
         
         mProcessTime = util.getFastCVProcessTime();

         if( c != null )
         {
            
            c.addCallbackBuffer( mPreviewBuffer );
            c.setPreviewCallbackWithBuffer( this );
         }
         
         
         requestRender();
      }
   }

Camera callback to retrieve camera frames.

Surface Holder for camera, Camera API requirement

Height to try and configure camera preview

Width to try and configure camera preview

GL Surface view to render camera and corners via GPU

Main layout

Buffer for camera driver to store preview data, created statically so that it doesn't need to be re-allocated each frame.

Actual height of camera preview image, can be different than desired if camera doesn't support desired width.

Flag indicates whether or not preview is running.

Actual width of camera preview image, can be different than desired if camera doesn't support desired width.

Filtered processing time

Handler for when to update profiling information.

How long to wait between profiling updates.

Java class associated with the camera and corner renderering

Root view group for all views associated with this activity

TextView [] com.qualcomm.fastcvdemo.base.GraphicalActivity.mText = new TextView[3] [protected]

Text boxes for on screen display of information

Text color for text boxes

Handler for FPS display. Want to do this periodically to not waste CPU.

Reimplemented in com.qualcomm.fastcvdemo.apis.featureDetection.Corner.

final String com.qualcomm.fastcvdemo.base.GraphicalActivity.TAG = "FastCVDemo" [static, protected]

Logging tag

Android UI button to switch between start and stop processing


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables