本文整理匯總了Java中com.google.android.gms.vision.CameraSource.CAMERA_FACING_FRONT屬性的典型用法代碼示例。如果您正苦於以下問題:Java CameraSource.CAMERA_FACING_FRONT屬性的具體用法?Java CameraSource.CAMERA_FACING_FRONT怎麽用?Java CameraSource.CAMERA_FACING_FRONT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.android.gms.vision.CameraSource
的用法示例。
在下文中一共展示了CameraSource.CAMERA_FACING_FRONT屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCameraSource
/**
* Creates the face detector and the camera.
*/
private void createCameraSource() {
Context context = getApplicationContext();
FaceDetector detector = createFaceDetector(context);
int facing = CameraSource.CAMERA_FACING_FRONT;
if (!mIsFrontFacing) {
facing = CameraSource.CAMERA_FACING_BACK;
}
// The camera source is initialized to use either the front or rear facing camera. We use a
// relatively low resolution for the camera preview, since this is sufficient for this app
// and the face detector will run faster at lower camera resolutions.
//
// However, note that there is a speed/accuracy trade-off with respect to choosing the
// camera resolution. The face detector will run faster with lower camera resolutions,
// but may miss smaller faces, landmarks, or may not correctly detect eyes open/closed in
// comparison to using higher camera resolutions. If you have any of these issues, you may
// want to increase the resolution.
mCameraSource = new CameraSource.Builder(context, detector)
.setFacing(facing)
.setRequestedPreviewSize(320, 240)
.setRequestedFps(60.0f)
.setAutoFocusEnabled(true)
.build();
}
示例2: translateX
/**
* Adjusts the x coordinate from the preview's coordinate system to the view coordinate
* system.
*/
public float translateX(float x) {
if (mOverlay.mFacing == CameraSource.CAMERA_FACING_FRONT) {
return mOverlay.getWidth() - scaleX(x);
} else {
return scaleX(x);
}
}
示例3: translateX
/**
* Adjusts the x coordinate from the preview's coordinate system to the view coordinate
* system.
*/
public float translateX(float x) {
if (GraphicOverlay.sFacing == CameraSource.CAMERA_FACING_FRONT) {
return getWidth() - scaleX(x);
} else {
return scaleX(x);
}
}
示例4: translateX
@Override public float translateX(float x) {
if (facing == CameraSource.CAMERA_FACING_FRONT) {
return getWidth() - scaleHorizontal(x);
} else {
return scaleHorizontal(x);
}
}
示例5: translateX
/**
* Adjusts the x coordinate from the preview's coordinate system to the view coordinate
* system.
*/
public float translateX(float x) {
if (overlay.facing == CameraSource.CAMERA_FACING_FRONT) {
return overlay.getWidth() - scaleX(x);
} else {
return scaleX(x);
}
}
示例6: translateX
/**
* Adjusts the x coordinate from the preview's coordinate system to the view coordinate
* system.
*/
public float translateX(float x) {
if (mOverlay.mFacing == CameraSource.CAMERA_FACING_FRONT) {
return mOverlay.getWidth() - scaleX(x);
} else {
return scaleX(x);
}
}
示例7: isFrontFacing
@Override public boolean isFrontFacing() {
return facing == CameraSource.CAMERA_FACING_FRONT;
}