Android Camera.Area - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Camera.Area class.

This code example shows how to use the following methods:
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeFocusAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mFocusArea == null) {
            mFocusArea = new ArrayList<Object>();
            mFocusArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        calculateTapArea(focusWidth, focusHeight, 1f, x, y, previewWidth, previewHeight,
                ((Area) mFocusArea.get(0)).rect);
    } 
 
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeMeteringAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Object>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
6
CodeRank
This code example shows how to use the following methods:
        int previewHeight = mPreviewFrame.getHeight();
        if (mFocusArea == null) {
            mFocusArea = new ArrayList<Area>();
            mFocusArea.add(new Area(new Rect(), 1));
            mMeteringArea = new ArrayList<Area>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        // AE area is bigger because exposure is sensitive and 
        // easy to over- or underexposure if area is too small. 
        calculateTapArea(focusWidth, focusHeight, 1f, x, y, previewWidth, previewHeight,
                mFocusArea.get(0).rect);
        calculateTapArea(focusWidth, focusHeight, 1.5f, x, y, previewWidth, previewHeight,
                mMeteringArea.get(0).rect);
 
        // Use margin to set the focus indicator to the touched area. 
        RelativeLayout.LayoutParams p =
                (RelativeLayout.LayoutParams) mFocusIndicatorRotateLayout.getLayoutParams();
        int left = Util.clamp(x - focusWidth / 2, 0, previewWidth - focusWidth);
6
CodeRank
This code example shows how to use the following methods:
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeFocusAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mFocusArea == null) {
            mFocusArea = new ArrayList<Object>();
            mFocusArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        calculateTapArea(focusWidth, focusHeight, 1f, x, y, previewWidth, previewHeight,
                ((Area) mFocusArea.get(0)).rect);
    } 
 
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeMeteringAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Object>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
6
CodeRank
This code example shows how to use the following methods:
        int y = Math.round(e.getY());
        int previewWidth = mPreviewFrame.getWidth();
        int previewHeight = mPreviewFrame.getHeight();
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Area>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        if (CameraSettings.TB_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth, mTouchHeight * 2, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else if (CameraSettings.SS_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth * 2, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else { 
            calculateTapArea(mTouchWidth, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } 
        // Set the metering area. 
4
CodeRank
This code example shows how to use the following methods:
        int y = Math.round(e.getY());
        int previewWidth = mPreviewFrame.getWidth();
        int previewHeight = mPreviewFrame.getHeight();
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Area>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        if (CameraSettings.TB_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth, mTouchHeight * 2, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else if (CameraSettings.SS_FULL_S3D_LAYOUT.equals(mPreviewLayout)) {
            calculateTapArea(mTouchWidth * 2, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } else { 
            calculateTapArea(mTouchWidth, mTouchHeight, 1, x, y, previewWidth, previewHeight,
                    mMeteringArea.get(0).rect);
        } 
        // Set the metering area. 
4
CodeRank
This code example shows how to use the following methods:
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeFocusAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mFocusArea == null) {
            mFocusArea = new ArrayList<Object>();
            mFocusArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        calculateTapArea(focusWidth, focusHeight, 1f, x, y, previewWidth, previewHeight,
                ((Area) mFocusArea.get(0)).rect);
    } 
 
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeMeteringAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Object>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
4
CodeRank
This code example shows how to use the following methods:
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeFocusAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mFocusArea == null) {
            mFocusArea = new ArrayList<Object>();
            mFocusArea.add(new Area(new Rect(), 1));
        } 
 
        // Convert the coordinates to driver format. 
        calculateTapArea(focusWidth, focusHeight, 1f, x, y, previewWidth, previewHeight,
                ((Area) mFocusArea.get(0)).rect);
    } 
 
    @TargetApi(ApiHelper.VERSION_CODES.ICE_CREAM_SANDWICH) 
    private void initializeMeteringAreas(int focusWidth, int focusHeight,
            int x, int y, int previewWidth, int previewHeight) {
        if (mMeteringArea == null) {
            mMeteringArea = new ArrayList<Object>();
            mMeteringArea.add(new Area(new Rect(), 1));
        } 
4
CodeRank
See Code Examples for Android Camera.Area Methods: