当前位置: 首页>>代码示例>>Java>>正文


Java CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN属性代码示例

本文整理汇总了Java中android.hardware.camera2.CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN属性的典型用法代码示例。如果您正苦于以下问题:Java CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN属性的具体用法?Java CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN怎么用?Java CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.hardware.camera2.CaptureResult的用法示例。


在下文中一共展示了CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stateFromCamera2State

/**
 * Convert reported camera2 AF state to OneCamera AutoFocusState.
 */
public static OneCamera.AutoFocusState stateFromCamera2State(int state) {
    switch (state) {
        case CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN:
            return OneCamera.AutoFocusState.ACTIVE_SCAN;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_SCAN:
            return OneCamera.AutoFocusState.PASSIVE_SCAN;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED:
            return OneCamera.AutoFocusState.PASSIVE_FOCUSED;
        case CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED:
            return OneCamera.AutoFocusState.ACTIVE_FOCUSED;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED:
            return OneCamera.AutoFocusState.PASSIVE_UNFOCUSED;
        case CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
            return OneCamera.AutoFocusState.ACTIVE_UNFOCUSED;
        default:
            return OneCamera.AutoFocusState.INACTIVE;
    }
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:21,代码来源:AutoFocusHelper.java

示例2: controlAFStateToString

/**
 * Utility function: converts CaptureResult.CONTROL_AF_STATE to String.
 */
private static String controlAFStateToString(int controlAFState) {
    switch (controlAFState) {
        case CaptureResult.CONTROL_AF_STATE_INACTIVE:
            return "inactive";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_SCAN:
            return "passive_scan";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED:
            return "passive_focused";
        case CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN:
            return "active_scan";
        case CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED:
            return "focus_locked";
        case CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
            return "not_focus_locked";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED:
            return "passive_unfocused";
        default:
            return "unknown";
    }
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:23,代码来源:AutoFocusHelper.java


注:本文中的android.hardware.camera2.CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。