當前位置: 首頁>>代碼示例>>Java>>正文


Java CameraSource.CAMERA_FACING_FRONT屬性代碼示例

本文整理匯總了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();
}
 
開發者ID:googlesamples,項目名稱:android-vision,代碼行數:28,代碼來源:GooglyEyesActivity.java

示例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);
    }
}
 
開發者ID:Jugendhackt,項目名稱:SocialPaka,代碼行數:11,代碼來源:GraphicOverlay.java

示例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);
    }
}
 
開發者ID:dvdciri,項目名稱:DeepImagePreview-Project,代碼行數:11,代碼來源:GraphicOverlay.java

示例4: translateX

@Override public float translateX(float x) {
  if (facing == CameraSource.CAMERA_FACING_FRONT) {
    return getWidth() - scaleHorizontal(x);
  } else {
    return scaleHorizontal(x);
  }
}
 
開發者ID:square,項目名稱:kind-photo-bot,代碼行數:7,代碼來源:GraphicOverlay.java

示例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);
    }
}
 
開發者ID:tomatrocho,項目名稱:insapp-android,代碼行數:11,代碼來源:GraphicOverlay.java

示例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);
    }
}
 
開發者ID:VideonaTalentum,項目名稱:ProyectoAndroid,代碼行數:12,代碼來源:GraphicOverlay.java

示例7: isFrontFacing

@Override public boolean isFrontFacing() {
  return facing == CameraSource.CAMERA_FACING_FRONT;
}
 
開發者ID:square,項目名稱:kind-photo-bot,代碼行數:3,代碼來源:GraphicOverlay.java


注:本文中的com.google.android.gms.vision.CameraSource.CAMERA_FACING_FRONT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。