Android Open Source - FxCameraApp Camera Helper






From Project

Back to project page FxCameraApp.

License

The source code is released under:

MIT License

If you think the Android project FxCameraApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.af.experiments.FxCameraApp.camera;
/* w ww .j av a2 s . c  om*/
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.Camera;
import android.view.SurfaceHolder;

import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;

public interface CameraHelper {
    static final int DEFAULT_CAMERA_ID = 0;

    int getNumberOfCameras();

    int getCameraId();

    public static class CameraInfoCompat {
        public static final int CAMERA_FACING_BACK = 0;
        public static final int CAMERA_FACING_FRONT = 1;

        public int facing;

        public int orientation;

    }

    CameraInfoCompat getCameraInfo();

    boolean isFaceCamera();

    boolean isOpened();

    void openCamera(int cameraId);

    void nextCamera();

    void initializeFocusMode();

    void releaseCamera();

    void setErrorCallback(Camera.ErrorCallback cb);

    void setupOptimalPreviewSizeAndPictureSize(int measureWidth, int measureHeight, int maxSize);

    int getOptimalOrientation();

    int getOrientation();

    void setDisplayOrientation(int degrees);

    void setPreviewCallback(Camera.PreviewCallback cb);

    void setPreviewDisplay(SurfaceHolder holder) throws IOException;

    void setPreviewTexture(Object surfaceTexture) throws IOException;

    void startPreview();

    void onPreviewFrame(Camera.PreviewCallback cb);

    void stopPreview();

    void takePicture(Camera.PictureCallback callback);

    void takePicture(Camera.PictureCallback callback, boolean autoFocus);

    void cancelAutoFocus();

    boolean enableShutterSound(boolean enabled);

    LinkedHashMap<Camera.Size, Camera.Size> getSupportedPreviewSizeAndSupportedPictureSizeMap();

    List<Camera.Size> getSupportedPreviewSizes();

    List<Camera.Size> getSupportedPictureSizes();

    Camera.Size getPreviewSize();

    Camera.Size getPictureSize();

    void setPictureFormat(int format);

    String getAntibanding();

    String getColorEffect();

    String getFlashMode();

    String getFocusMode();

    String getSceneMode();

    String getWhiteBalance();

    List<String> getSupportedAntibanding();

    List<String> getSupportedColorEffects();

    List<String> getSupportedFlashModes();

    List<String> getSupportedFocusModes();

    List<String> getSupportedSceneModes();

    List<String> getSupportedWhiteBalance();

    List<String> getSupportedAntibanding(String... values);

    List<String> getSupportedColorEffects(String... values);

    List<String> getSupportedFlashModes(String... values);

    List<String> getSupportedFocusModes(String... values);

    List<String> getSupportedSceneModes(String... values);

    List<String> getSupportedWhiteBalance(String... values);

    void setAntibanding(String antibanding);

    void setColorEffect(String value);

    void setFlashMode(String value);

    void setFocusMode(String value);

    void setSceneMode(String value);

    void setWhiteBalance(String value);

    String switchAntibanding();

    String switchColorEffect();

    String switchFlashMode();

    String switchFocusMode();

    String switchSceneMode();

    String switchWhiteBalance();

    String switchAntibanding(String... values);

    String switchColorEffect(String... values);

    String switchFlashMode(String... values);

    String switchFocusMode(String... values);

    String switchSceneMode(String... values);

    String switchWhiteBalance(String... values);

    public boolean isExposureCompensationSupported();

    public int getMaxExposureCompensation();

    public int getMinExposureCompensation();

    public float getExposureCompensationStep();

    public int getExposureCompensation();

    public void setExposureCompensation(int value);

    public interface OnZoomChangeListener {
        void onZoomChange(int zoomValue, boolean stopped, CameraHelper camera);
    }

    boolean isZoomSupported();

    int getMaxZoom();

    List<Integer> getZoomRatios();

    int getZoom();

    void setZoom(int value);

    void setZoomChangeListener(OnZoomChangeListener listener);

    void startSmoothZoom(int value);

    void stopSmoothZoom();

    public interface FaceDetectionListener {
        void onFaceDetection(FaceCompat[] faces, CameraHelper camera);
    }

    public static class FaceCompat {
        public FaceCompat() {
        }


        public Rect rect;


        public int score;

        public int id = -1;
        public Point leftEye = null;

        public Point rightEye = null;

        public Point mouth = null;
    }


    public static class AreaCompat {

        public Rect rect;

        public int weight;

        public AreaCompat(final Rect rect, final int weight) {
            this.rect = rect;
            this.weight = weight;
        }

        @Override
        public boolean equals(final Object obj) {
            if (!(obj instanceof AreaCompat)) {
                return false;
            }
            AreaCompat a = (AreaCompat) obj;
            if (rect == null) {
                if (a.rect != null) return false;
            } else {
                if (!rect.equals(a.rect)) return false;
            }
            return weight == a.weight;
        }
    }

    int getMaxNumFocusAreas();

    List<AreaCompat> getFocusAreas();

    void setFocusAreas(AreaCompat... focusAreas);

    void setFocusAreas(List<AreaCompat> focusAreas);

    int getMaxNumMeteringAreas();

    List<AreaCompat> getMeteringAreas();

    void setMeteringAreas(AreaCompat... meteringAreas);

    void setMeteringAreas(List<AreaCompat> meteringAreas);

    boolean isAutoWhiteBalanceLockSupported();

    void setAutoWhiteBalanceLock(boolean toggle);

    boolean getAutoWhiteBalanceLock();

    boolean isAutoExposureLockSupported();

    void setAutoExposureLock(boolean toggle);

    boolean getAutoExposureLock();

    boolean isVideoSnapshotSupported();

    //////////////////////////////////////////////////////////////////////////
    // Video Stabilization

    boolean isVideoStabilizationSupported();

    void setVideoStabilization(boolean toggle);

    boolean getVideoStabilization();

}




Java Source Code List

com.af.experiments.FxCameraApp.FilterAdapter.java
com.af.experiments.FxCameraApp.MyActivity.java
com.af.experiments.FxCameraApp.Utils.BitmapFactoryUtils.java
com.af.experiments.FxCameraApp.Utils.ExifUtils.java
com.af.experiments.FxCameraApp.Utils.Fps.java
com.af.experiments.FxCameraApp.Utils.LogWriter.java
com.af.experiments.FxCameraApp.Utils.OpenGlUtils.java
com.af.experiments.FxCameraApp.View.CameraView.java
com.af.experiments.FxCameraApp.View.DefaultPreview.java
com.af.experiments.FxCameraApp.View.GlPreview.java
com.af.experiments.FxCameraApp.View.PreviewTexture.java
com.af.experiments.FxCameraApp.camera.CameraHelperBase.java
com.af.experiments.FxCameraApp.camera.CameraHelperCupcake.java
com.af.experiments.FxCameraApp.camera.CameraHelperDonut.java
com.af.experiments.FxCameraApp.camera.CameraHelperEclair.java
com.af.experiments.FxCameraApp.camera.CameraHelperFactory.java
com.af.experiments.FxCameraApp.camera.CameraHelperFroyo.java
com.af.experiments.FxCameraApp.camera.CameraHelperGingerbread.java
com.af.experiments.FxCameraApp.camera.CameraHelperHonycomb.java
com.af.experiments.FxCameraApp.camera.CameraHelperICS.java
com.af.experiments.FxCameraApp.camera.CameraHelper.java
com.af.experiments.FxCameraApp.display.DisplayHelperBase.java
com.af.experiments.FxCameraApp.display.DisplayHelperFactory.java
com.af.experiments.FxCameraApp.display.DisplayHelperFroyo.java
com.af.experiments.FxCameraApp.display.DisplayHelperHoneycombMR2.java
com.af.experiments.FxCameraApp.display.DisplayHelperHoneycomb.java
com.af.experiments.FxCameraApp.display.DisplayHelper.java
com.af.experiments.FxCameraApp.ogles.DefaultConfigChooser.java
com.af.experiments.FxCameraApp.ogles.DefaultContextFactory.java
com.af.experiments.FxCameraApp.ogles.DefaultWindowSurfaceFactory.java
com.af.experiments.FxCameraApp.ogles.EGLLogWrapper.java
com.af.experiments.FxCameraApp.ogles.GLES20ConfigChooser.java
com.af.experiments.FxCameraApp.ogles.GLES20ContextFactory.java
com.af.experiments.FxCameraApp.ogles.GlImageBitmapTexture.java
com.af.experiments.FxCameraApp.ogles.GlImageResourceTexture.java
com.af.experiments.FxCameraApp.ogles.GlImageTexture.java
com.af.experiments.FxCameraApp.ogles.GlPreviewTextureFactory.java
com.af.experiments.FxCameraApp.ogles.GlSurfaceTexture.java
com.af.experiments.FxCameraApp.ogles.GlTextureView.java
com.af.experiments.FxCameraApp.ogles.PixelBuffer.java
com.af.experiments.FxCameraApp.ogles.PreviewSurfaceHelperBase.java
com.af.experiments.FxCameraApp.ogles.PreviewSurfaceHelperFactory.java
com.af.experiments.FxCameraApp.ogles.PreviewSurfaceHelper.java
com.af.experiments.FxCameraApp.ogles.Texture.java
com.af.experiments.FxCameraApp.renderer.GLES20FramebufferObject.java
com.af.experiments.FxCameraApp.renderer.GlFrameBufferObjectRenderer.java
com.af.experiments.FxCameraApp.renderer.MainRenderer.java
com.af.experiments.FxCameraApp.shaders.GlBilateralShader.java
com.af.experiments.FxCameraApp.shaders.GlBoxBlurShader.java
com.af.experiments.FxCameraApp.shaders.GlBulgeDistortionShader.java
com.af.experiments.FxCameraApp.shaders.GlCGAColorspaceShader.java
com.af.experiments.FxCameraApp.shaders.GlColorInvertShader.java
com.af.experiments.FxCameraApp.shaders.GlColorMatrixShader.java
com.af.experiments.FxCameraApp.shaders.GlColorPackingShader.java
com.af.experiments.FxCameraApp.shaders.GlConvolutionShader.java
com.af.experiments.FxCameraApp.shaders.GlEmbossShader.java
com.af.experiments.FxCameraApp.shaders.GlFalseColorShader.java
com.af.experiments.FxCameraApp.shaders.GlFastBlurShader.java
com.af.experiments.FxCameraApp.shaders.GlGaussianBlurShader.java
com.af.experiments.FxCameraApp.shaders.GlGlassSphereShader.java
com.af.experiments.FxCameraApp.shaders.GlGrayScaleShader.java
com.af.experiments.FxCameraApp.shaders.GlHarrisCornerDetectionShader.java
com.af.experiments.FxCameraApp.shaders.GlHazeShader.java
com.af.experiments.FxCameraApp.shaders.GlMonochromeShader.java
com.af.experiments.FxCameraApp.shaders.GlNobleCornerDetectionShader.java
com.af.experiments.FxCameraApp.shaders.GlPerlinNoiseShader.java
com.af.experiments.FxCameraApp.shaders.GlPinchDistortionShader.java
com.af.experiments.FxCameraApp.shaders.GlPixellateShader.java
com.af.experiments.FxCameraApp.shaders.GlPolarPixellateShader.java
com.af.experiments.FxCameraApp.shaders.GlPolkaDotShader.java
com.af.experiments.FxCameraApp.shaders.GlPosterizeShader.java
com.af.experiments.FxCameraApp.shaders.GlPreviewShader.java
com.af.experiments.FxCameraApp.shaders.GlSepiaShader.java
com.af.experiments.FxCameraApp.shaders.GlShaderGroup.java
com.af.experiments.FxCameraApp.shaders.GlShader.java
com.af.experiments.FxCameraApp.shaders.GlSharpenShader.java
com.af.experiments.FxCameraApp.shaders.GlShiTomasiFeatureDetectionShader.java
com.af.experiments.FxCameraApp.shaders.GlSobelEdgeDetectionShader.java
com.af.experiments.FxCameraApp.shaders.GlSphereRefractionShader.java
com.af.experiments.FxCameraApp.shaders.GlStretchDistortionShader.java
com.af.experiments.FxCameraApp.shaders.GlThreex3ConvolutionShader.java
com.af.experiments.FxCameraApp.shaders.GlThreex3TextureSamplingShader.java
com.af.experiments.FxCameraApp.shaders.GlToneShader.java
com.af.experiments.FxCameraApp.shaders.GlTwoInputShader.java
com.af.experiments.FxCameraApp.shaders.GlVignetteShader.java
com.af.experiments.FxCameraApp.shaders.GlWeakPixelInclusionShader.java
com.af.experiments.FxCameraApp.shaders.GlWhiteBalanceShader.java
com.af.experiments.FxCameraApp.shaders.GlXRayShader.java
com.af.experiments.FxCameraApp.shaders.GlXYDerivativeShader.java
com.af.experiments.FxCameraApp.shaders.fx.GlLutShader.java