IT. Expert System.

Android Reference

Camera.Parameters


android.hardware

Class Camera.Parameters

    • Method Detail

      • dump

        public void dump()
        Deprecated.
        Writes the current Parameters to the log.
      • flatten

        public String flatten()
        Creates a single string with all the parameters set in this Parameters object.

        The unflatten(String) method does the reverse.

        Returns:
        a String with all values from this Parameters object, in semi-colon delimited key-value pairs
      • unflatten

        public void unflatten(String flattened)
        Takes a flattened string of parameters and adds each one to this Parameters object.

        The flatten() method does the reverse.

        Parameters:
        flattened - a String of parameters (key-value paired) that are semi-colon delimited
      • remove

        public void remove(String key)
      • set

        public void set(String key,
               String value)
        Sets a String parameter.
        Parameters:
        key - the key name for the parameter
        value - the String value of the parameter
      • set

        public void set(String key,
               int value)
        Sets an integer parameter.
        Parameters:
        key - the key name for the parameter
        value - the int value of the parameter
      • get

        public String get(String key)
        Returns the value of a String parameter.
        Parameters:
        key - the key name for the parameter
        Returns:
        the String value of the parameter
      • getInt

        public int getInt(String key)
        Returns the value of an integer parameter.
        Parameters:
        key - the key name for the parameter
        Returns:
        the int value of the parameter
      • setPreviewSize

        public void setPreviewSize(int width,
                          int height)
        Sets the dimensions for preview pictures. If the preview has already started, applications should stop the preview first before changing preview size. The sides of width and height are based on camera orientation. That is, the preview size is the size before it is rotated by display orientation. So applications need to consider the display orientation while setting preview size. For example, suppose the camera supports both 480x320 and 320x480 preview sizes. The application wants a 3:2 preview ratio. If the display orientation is set to 0 or 180, preview size should be set to 480x320. If the display orientation is set to 90 or 270, preview size should be set to 320x480. The display orientation should also be considered while setting picture size and thumbnail size.
        Parameters:
        width - the width of the pictures, in pixels
        height - the height of the pictures, in pixels
        See Also:
        Camera.setDisplayOrientation(int), Camera.getCameraInfo(int, CameraInfo), setPictureSize(int, int), setJpegThumbnailSize(int, int)
      • getPreviewSize

        public Camera.Size getPreviewSize()
        Returns the dimensions setting for preview pictures.
        Returns:
        a Size object with the width and height setting for the preview picture
      • getSupportedPreviewSizes

        public List<Camera.Size> getSupportedPreviewSizes()
        Gets the supported preview sizes.
        Returns:
        a list of Size object. This method will always return a list with at least one element.
      • getSupportedVideoSizes

        public List<Camera.Size> getSupportedVideoSizes()

        Gets the supported video frame sizes that can be used by MediaRecorder.

        If the returned list is not null, the returned list will contain at least one Size and one of the sizes in the returned list must be passed to MediaRecorder.setVideoSize() for camcorder application if camera is used as the video source. In this case, the size of the preview can be different from the resolution of the recorded video during video recording.

        Returns:
        a list of Size object if camera has separate preview and video output; otherwise, null is returned.
        See Also:
        getPreferredPreviewSizeForVideo()
      • getPreferredPreviewSizeForVideo

        public Camera.Size getPreferredPreviewSizeForVideo()
        Returns the preferred or recommended preview size (width and height) in pixels for video recording. Camcorder applications should set the preview size to a value that is not larger than the preferred preview size. In other words, the product of the width and height of the preview size should not be larger than that of the preferred preview size. In addition, we recommend to choose a preview size that has the same aspect ratio as the resolution of video to be recorded.
        Returns:
        the preferred preview size (width and height) in pixels for video recording if getSupportedVideoSizes() does not return null; otherwise, null is returned.
        See Also:
        getSupportedVideoSizes()
      • setJpegThumbnailSize

        public void setJpegThumbnailSize(int width,
                                int height)

        Sets the dimensions for EXIF thumbnail in Jpeg picture. If applications set both width and height to 0, EXIF will not contain thumbnail.

        Applications need to consider the display orientation. See setPreviewSize(int,int) for reference.

        Parameters:
        width - the width of the thumbnail, in pixels
        height - the height of the thumbnail, in pixels
        See Also:
        setPreviewSize(int,int)
      • getJpegThumbnailSize

        public Camera.Size getJpegThumbnailSize()
        Returns the dimensions for EXIF thumbnail in Jpeg picture.
        Returns:
        a Size object with the height and width setting for the EXIF thumbnails
      • getSupportedJpegThumbnailSizes

        public List<Camera.Size> getSupportedJpegThumbnailSizes()
        Gets the supported jpeg thumbnail sizes.
        Returns:
        a list of Size object. This method will always return a list with at least two elements. Size 0,0 (no thumbnail) is always supported.
      • setJpegThumbnailQuality

        public void setJpegThumbnailQuality(int quality)
        Sets the quality of the EXIF thumbnail in Jpeg picture.
        Parameters:
        quality - the JPEG quality of the EXIF thumbnail. The range is 1 to 100, with 100 being the best.
      • getJpegThumbnailQuality

        public int getJpegThumbnailQuality()
        Returns the quality setting for the EXIF thumbnail in Jpeg picture.
        Returns:
        the JPEG quality setting of the EXIF thumbnail.
      • setJpegQuality

        public void setJpegQuality(int quality)
        Sets Jpeg quality of captured picture.
        Parameters:
        quality - the JPEG quality of captured picture. The range is 1 to 100, with 100 being the best.
      • getJpegQuality

        public int getJpegQuality()
        Returns the quality setting for the JPEG picture.
        Returns:
        the JPEG picture quality setting.
      • setPreviewFrameRate

        @Deprecated
        public void setPreviewFrameRate(int fps)
        Deprecated. replaced by setPreviewFpsRange(int,int)
        Sets the rate at which preview frames are received. This is the target frame rate. The actual frame rate depends on the driver.
        Parameters:
        fps - the frame rate (frames per second)
      • getPreviewFrameRate

        @Deprecated
        public int getPreviewFrameRate()
        Deprecated. replaced by getPreviewFpsRange(int[])
        Returns the setting for the rate at which preview frames are received. This is the target frame rate. The actual frame rate depends on the driver.
        Returns:
        the frame rate setting (frames per second)
      • getSupportedPreviewFrameRates

        @Deprecated
        public List<Integer> getSupportedPreviewFrameRates()
        Deprecated. replaced by getSupportedPreviewFpsRange()
        Gets the supported preview frame rates.
        Returns:
        a list of supported preview frame rates. null if preview frame rate setting is not supported.
      • getSupportedPreviewFpsRange

        public List<int[]> getSupportedPreviewFpsRange()
        Gets the supported preview fps (frame-per-second) ranges. Each range contains a minimum fps and maximum fps. If minimum fps equals to maximum fps, the camera outputs frames in fixed frame rate. If not, the camera outputs frames in auto frame rate. The actual frame rate fluctuates between the minimum and the maximum. The values are multiplied by 1000 and represented in integers. For example, if frame rate is 26.623 frames per second, the value is 26623.
        Returns:
        a list of supported preview fps ranges. This method returns a list with at least one element. Every element is an int array of two values - minimum fps and maximum fps. The list is sorted from small to large (first by maximum fps and then minimum fps).
        See Also:
        PREVIEW_FPS_MIN_INDEX, PREVIEW_FPS_MAX_INDEX
      • setPreviewFormat

        public void setPreviewFormat(int pixel_format)
        Sets the image format for preview pictures.

        If this is never called, the default format will be ImageFormat.NV21, which uses the NV21 encoding format.

        Use getSupportedPreviewFormats() to get a list of the available preview formats.

        It is strongly recommended that either ImageFormat.NV21 or ImageFormat.YV12 is used, since they are supported by all camera devices.

        For YV12, the image buffer that is received is not necessarily tightly packed, as there may be padding at the end of each row of pixel data, as described in ImageFormat.YV12. For camera callback data, it can be assumed that the stride of the Y and UV data is the smallest possible that meets the alignment requirements. That is, if the preview size is width x height, then the following equations describe the buffer index for the beginning of row y for the Y plane and row c for the U and V planes: <pre> yStride = (int) ceil(width / 16.0) * 16; uvStride = (int) ceil( (yStride / 2) / 16.0) * 16; ySize = yStride * height; uvSize = uvStride * height / 2; yRowIndex = yStride * y; uRowIndex = ySize + uvSize + uvStride * c; vRowIndex = ySize + uvStride * c; size = ySize + uvSize * 2;</pre>

        Parameters:
        pixel_format - the desired preview picture format, defined by one of the ImageFormat constants. (E.g., ImageFormat.NV21 (default), or ImageFormat.YV12)
        See Also:
        ImageFormat, getSupportedPreviewFormats()
      • setPictureSize

        public void setPictureSize(int width,
                          int height)

        Sets the dimensions for pictures.

        Applications need to consider the display orientation. See setPreviewSize(int,int) for reference.

        Parameters:
        width - the width for pictures, in pixels
        height - the height for pictures, in pixels
        See Also:
        setPreviewSize(int,int)
      • getPictureSize

        public Camera.Size getPictureSize()
        Returns the dimension setting for pictures.
        Returns:
        a Size object with the height and width setting for pictures
      • getSupportedPictureSizes

        public List<Camera.Size> getSupportedPictureSizes()
        Gets the supported picture sizes.
        Returns:
        a list of supported picture sizes. This method will always return a list with at least one element.
      • setPictureFormat

        public void setPictureFormat(int pixel_format)
        Sets the image format for pictures.
        Parameters:
        pixel_format - the desired picture format (ImageFormat.NV21, ImageFormat.RGB_565, or ImageFormat.JPEG)
        See Also:
        ImageFormat
      • getPictureFormat

        public int getPictureFormat()
        Returns the image format for pictures.
        Returns:
        the picture format
        See Also:
        ImageFormat
      • getSupportedPictureFormats

        public List<Integer> getSupportedPictureFormats()
        Gets the supported picture formats.
        Returns:
        supported picture formats. This method will always return a list with at least one element.
        See Also:
        ImageFormat
      • setRotation

        public void setRotation(int rotation)
        Sets the clockwise rotation angle in degrees relative to the orientation of the camera. This affects the pictures returned from JPEG Camera.PictureCallback. The camera driver may set orientation in the EXIF header without rotating the picture. Or the driver may rotate the picture and the EXIF thumbnail. If the Jpeg picture is rotated, the orientation in the EXIF header will be missing or 1 (row #0 is top and column #0 is left side).

        If applications want to rotate the picture to match the orientation of what users see, apps should use OrientationEventListener and Camera.CameraInfo. The value from OrientationEventListener is relative to the natural orientation of the device. CameraInfo.orientation is the angle between camera orientation and natural device orientation. The sum of the two is the rotation angle for back-facing camera. The difference of the two is the rotation angle for front-facing camera. Note that the JPEG pictures of front-facing cameras are not mirrored as in preview display.

        For example, suppose the natural orientation of the device is portrait. The device is rotated 270 degrees clockwise, so the device orientation is 270. Suppose a back-facing camera sensor is mounted in landscape and the top side of the camera sensor is aligned with the right edge of the display in natural orientation. So the camera orientation is 90. The rotation should be set to 0 (270 + 90).

        The reference code is as follows.

         public void onOrientationChanged(int orientation) {
             if (orientation == ORIENTATION_UNKNOWN) return;
             android.hardware.Camera.CameraInfo info =
                    new android.hardware.Camera.CameraInfo();
             android.hardware.Camera.getCameraInfo(cameraId, info);
             orientation = (orientation + 45) / 90 * 90;
             int rotation = 0;
             if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
                 rotation = (info.orientation - orientation + 360) % 360;
             } else {  // back-facing camera
                 rotation = (info.orientation + orientation) % 360;
             }
             mParameters.setRotation(rotation);
         }
         
        Parameters:
        rotation - The rotation angle in degrees relative to the orientation of the camera. Rotation can only be 0, 90, 180 or 270.
        Throws:
        IllegalArgumentException - if rotation value is invalid.
        See Also:
        OrientationEventListener, Camera.getCameraInfo(int, CameraInfo)
      • setGpsLatitude

        public void setGpsLatitude(double latitude)
        Sets GPS latitude coordinate. This will be stored in JPEG EXIF header.
        Parameters:
        latitude - GPS latitude coordinate.
      • setGpsLongitude

        public void setGpsLongitude(double longitude)
        Sets GPS longitude coordinate. This will be stored in JPEG EXIF header.
        Parameters:
        longitude - GPS longitude coordinate.
      • setGpsAltitude

        public void setGpsAltitude(double altitude)
        Sets GPS altitude. This will be stored in JPEG EXIF header.
        Parameters:
        altitude - GPS altitude in meters.
      • setGpsTimestamp

        public void setGpsTimestamp(long timestamp)
        Sets GPS timestamp. This will be stored in JPEG EXIF header.
        Parameters:
        timestamp - GPS timestamp (UTC in seconds since January 1, 1970).
      • setGpsProcessingMethod

        public void setGpsProcessingMethod(String processing_method)
        Sets GPS processing method. It will store up to 32 characters in JPEG EXIF header.
        Parameters:
        processing_method - The processing method to get this location.
      • removeGpsData

        public void removeGpsData()
        Removes GPS latitude, longitude, altitude, and timestamp from the parameters.
      • setWhiteBalance

        public void setWhiteBalance(String value)
        Sets the white balance. Changing the setting will release the auto-white balance lock. It is recommended not to change white balance and AWB lock at the same time.
        Parameters:
        value - new white balance.
        See Also:
        getWhiteBalance(), setAutoWhiteBalanceLock(boolean)
      • getSupportedWhiteBalance

        public List<String> getSupportedWhiteBalance()
        Gets the supported white balance.
        Returns:
        a list of supported white balance. null if white balance setting is not supported.
        See Also:
        getWhiteBalance()
      • setColorEffect

        public void setColorEffect(String value)
        Sets the current color effect setting.
        Parameters:
        value - new color effect.
        See Also:
        getColorEffect()
      • getSupportedColorEffects

        public List<String> getSupportedColorEffects()
        Gets the supported color effects.
        Returns:
        a list of supported color effects. null if color effect setting is not supported.
        See Also:
        getColorEffect()
      • setAntibanding

        public void setAntibanding(String antibanding)
        Sets the antibanding.
        Parameters:
        antibanding - new antibanding value.
        See Also:
        getAntibanding()
      • getSupportedAntibanding

        public List<String> getSupportedAntibanding()
        Gets the supported antibanding values.
        Returns:
        a list of supported antibanding values. null if antibanding setting is not supported.
        See Also:
        getAntibanding()
      • setSceneMode

        public void setSceneMode(String value)
        Sets the scene mode. Changing scene mode may override other parameters (such as flash mode, focus mode, white balance). For example, suppose originally flash mode is on and supported flash modes are on/off. In night scene mode, both flash mode and supported flash mode may be changed to off. After setting scene mode, applications should call getParameters to know if some parameters are changed.
        Parameters:
        value - scene mode.
        See Also:
        getSceneMode()
      • getSupportedSceneModes

        public List<String> getSupportedSceneModes()
        Gets the supported scene modes.
        Returns:
        a list of supported scene modes. null if scene mode setting is not supported.
        See Also:
        getSceneMode()
      • setFlashMode

        public void setFlashMode(String value)
        Sets the flash mode.
        Parameters:
        value - flash mode.
        See Also:
        getFlashMode()
      • getSupportedFlashModes

        public List<String> getSupportedFlashModes()
        Gets the supported flash modes.
        Returns:
        a list of supported flash modes. null if flash mode setting is not supported.
        See Also:
        getFlashMode()
      • setFocusMode

        public void setFocusMode(String value)
        Sets the focus mode.
        Parameters:
        value - focus mode.
        See Also:
        getFocusMode()
      • getSupportedFocusModes

        public List<String> getSupportedFocusModes()
        Gets the supported focus modes.
        Returns:
        a list of supported focus modes. This method will always return a list with at least one element.
        See Also:
        getFocusMode()
      • getFocalLength

        public float getFocalLength()
        Gets the focal length (in millimeter) of the camera.
        Returns:
        the focal length. This method will always return a valid value.
      • getHorizontalViewAngle

        public float getHorizontalViewAngle()
        Gets the horizontal angle of view in degrees.
        Returns:
        horizontal angle of view. This method will always return a valid value.
      • getVerticalViewAngle

        public float getVerticalViewAngle()
        Gets the vertical angle of view in degrees.
        Returns:
        vertical angle of view. This method will always return a valid value.
      • setExposureCompensation

        public void setExposureCompensation(int value)
        Sets the exposure compensation index.
        Parameters:
        value - exposure compensation index. The valid value range is from getMinExposureCompensation() (inclusive) to getMaxExposureCompensation() (inclusive). 0 means exposure is not adjusted. Application should call getMinExposureCompensation and getMaxExposureCompensation to know if exposure compensation is supported.
      • getMaxExposureCompensation

        public int getMaxExposureCompensation()
        Gets the maximum exposure compensation index.
        Returns:
        maximum exposure compensation index (>=0). If both this method and getMinExposureCompensation() return 0, exposure compensation is not supported.
      • getMinExposureCompensation

        public int getMinExposureCompensation()
        Gets the minimum exposure compensation index.
        Returns:
        minimum exposure compensation index (<=0). if both this method and getMaxExposureCompensation() return 0, exposure compensation is not supported.
      • getExposureCompensationStep

        public float getExposureCompensationStep()
        Gets the exposure compensation step.
        Returns:
        exposure compensation step. Applications can get EV by multiplying the exposure compensation index and step. Ex: if exposure compensation index is -6 and step is 0.333333333, EV is -2.
      • setAutoExposureLock

        public void setAutoExposureLock(boolean toggle)

        Sets the auto-exposure lock state. Applications should check isAutoExposureLockSupported() before using this method.

        If set to true, the camera auto-exposure routine will immediately pause until the lock is set to false. Exposure compensation settings changes will still take effect while auto-exposure is locked.

        If auto-exposure is already locked, setting this to true again has no effect (the driver will not recalculate exposure values).

        Stopping preview with Camera.stopPreview(), or triggering still image capture with Camera.takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback), will not change the lock.

        Exposure compensation, auto-exposure lock, and auto-white balance lock can be used to capture an exposure-bracketed burst of images, for example.

        Auto-exposure state, including the lock state, will not be maintained after camera Camera.release() is called. Locking auto-exposure after Camera.open() but before the first call to Camera.startPreview() will not allow the auto-exposure routine to run at all, and may result in severely over- or under-exposed images.

        Parameters:
        toggle - new state of the auto-exposure lock. True means that auto-exposure is locked, false means that the auto-exposure routine is free to run normally.
        See Also:
        getAutoExposureLock()
      • isAutoExposureLockSupported

        public boolean isAutoExposureLockSupported()
        Returns true if auto-exposure locking is supported. Applications should call this before trying to lock auto-exposure. See setAutoExposureLock(boolean) for details about the lock.
        Returns:
        true if auto-exposure lock is supported.
        See Also:
        setAutoExposureLock(boolean)
      • setAutoWhiteBalanceLock

        public void setAutoWhiteBalanceLock(boolean toggle)

        Sets the auto-white balance lock state. Applications should check isAutoWhiteBalanceLockSupported() before using this method.

        If set to true, the camera auto-white balance routine will immediately pause until the lock is set to false.

        If auto-white balance is already locked, setting this to true again has no effect (the driver will not recalculate white balance values).

        Stopping preview with Camera.stopPreview(), or triggering still image capture with Camera.takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback), will not change the the lock.

        Changing the white balance mode with setWhiteBalance(java.lang.String) will release the auto-white balance lock if it is set.

        Exposure compensation, AE lock, and AWB lock can be used to capture an exposure-bracketed burst of images, for example. Auto-white balance state, including the lock state, will not be maintained after camera Camera.release() is called. Locking auto-white balance after Camera.open() but before the first call to Camera.startPreview() will not allow the auto-white balance routine to run at all, and may result in severely incorrect color in captured images.

        Parameters:
        toggle - new state of the auto-white balance lock. True means that auto-white balance is locked, false means that the auto-white balance routine is free to run normally.
        See Also:
        getAutoWhiteBalanceLock(), setWhiteBalance(String)
      • isAutoWhiteBalanceLockSupported

        public boolean isAutoWhiteBalanceLockSupported()
        Returns true if auto-white balance locking is supported. Applications should call this before trying to lock auto-white balance. See setAutoWhiteBalanceLock(boolean) for details about the lock.
        Returns:
        true if auto-white balance lock is supported.
        See Also:
        setAutoWhiteBalanceLock(boolean)
      • getZoom

        public int getZoom()
        Gets current zoom value. This also works when smooth zoom is in progress. Applications should check isZoomSupported() before using this method.
        Returns:
        the current zoom value. The range is 0 to getMaxZoom(). 0 means the camera is not zoomed.
      • setZoom

        public void setZoom(int value)
        Sets current zoom value. If the camera is zoomed (value > 0), the actual picture size may be smaller than picture size setting. Applications can check the actual picture size after picture is returned from Camera.PictureCallback. The preview size remains the same in zoom. Applications should check isZoomSupported() before using this method.
        Parameters:
        value - zoom value. The valid range is 0 to getMaxZoom().
      • isZoomSupported

        public boolean isZoomSupported()
        Returns true if zoom is supported. Applications should call this before using other zoom methods.
        Returns:
        true if zoom is supported.
      • getMaxZoom

        public int getMaxZoom()
        Gets the maximum zoom value allowed for snapshot. This is the maximum value that applications can set to setZoom(int). Applications should call isZoomSupported() before using this method. This value may change in different preview size. Applications should call this again after setting preview size.
        Returns:
        the maximum zoom value supported by the camera.
      • getZoomRatios

        public List<Integer> getZoomRatios()
        Gets the zoom ratios of all zoom values. Applications should check isZoomSupported() before using this method.
        Returns:
        the zoom ratios in 1/100 increments. Ex: a zoom of 3.2x is returned as 320. The number of elements is getMaxZoom() + 1. The list is sorted from small to large. The first element is always 100. The last element is the zoom ratio of the maximum zoom value.
      • isSmoothZoomSupported

        public boolean isSmoothZoomSupported()
        Returns true if smooth zoom is supported. Applications should call this before using other smooth zoom methods.
        Returns:
        true if smooth zoom is supported.
      • getFocusDistances

        public void getFocusDistances(float[] output)

        Gets the distances from the camera to where an object appears to be in focus. The object is sharpest at the optimal focus distance. The depth of field is the far focus distance minus near focus distance.

        Focus distances may change after calling Camera.autoFocus(AutoFocusCallback), Camera.cancelAutoFocus(), or Camera.startPreview(). Applications can call Camera.getParameters() and this method anytime to get the latest focus distances. If the focus mode is FOCUS_MODE_CONTINUOUS_VIDEO, focus distances may change from time to time.

        This method is intended to estimate the distance between the camera and the subject. After autofocus, the subject distance may be within near and far focus distance. However, the precision depends on the camera hardware, autofocus algorithm, the focus area, and the scene. The error can be large and it should be only used as a reference.

        Far focus distance >= optimal focus distance >= near focus distance. If the focus distance is infinity, the value will be Float.POSITIVE_INFINITY.

        Parameters:
        output - focus distances in meters. output must be a float array with three elements. Near focus distance, optimal focus distance, and far focus distance will be filled in the array.
        See Also:
        FOCUS_DISTANCE_NEAR_INDEX, FOCUS_DISTANCE_OPTIMAL_INDEX, FOCUS_DISTANCE_FAR_INDEX
      • getMaxNumFocusAreas

        public int getMaxNumFocusAreas()
        Gets the maximum number of focus areas supported. This is the maximum length of the list in setFocusAreas(List) and getFocusAreas().
        Returns:
        the maximum number of focus areas supported by the camera.
        See Also:
        getFocusAreas()
      • getFocusAreas

        public List<Camera.Area> getFocusAreas()

        Gets the current focus areas. Camera driver uses the areas to decide focus.

        Before using this API or setFocusAreas(List), apps should call getMaxNumFocusAreas() to know the maximum number of focus areas first. If the value is 0, focus area is not supported.

        Each focus area is a rectangle with specified weight. The direction is relative to the sensor orientation, that is, what the sensor sees. The direction is not affected by the rotation or mirroring of Camera.setDisplayOrientation(int). Coordinates of the rectangle range from -1000 to 1000. (-1000, -1000) is the upper left point. (1000, 1000) is the lower right point. The width and height of focus areas cannot be 0 or negative.

        The weight must range from 1 to 1000. The weight should be interpreted as a per-pixel weight - all pixels in the area have the specified weight. This means a small area with the same weight as a larger area will have less influence on the focusing than the larger area. Focus areas can partially overlap and the driver will add the weights in the overlap region.

        A special case of a null focus area list means the driver is free to select focus targets as it wants. For example, the driver may use more signals to select focus areas and change them dynamically. Apps can set the focus area list to null if they want the driver to completely control focusing.

        Focus areas are relative to the current field of view (getZoom()). No matter what the zoom level is, (-1000,-1000) represents the top of the currently visible camera frame. The focus area cannot be set to be outside the current field of view, even when using zoom.

        Focus area only has effect if the current focus mode is FOCUS_MODE_AUTO, FOCUS_MODE_MACRO, FOCUS_MODE_CONTINUOUS_VIDEO, or FOCUS_MODE_CONTINUOUS_PICTURE.

        Returns:
        a list of current focus areas
      • getMaxNumMeteringAreas

        public int getMaxNumMeteringAreas()
        Gets the maximum number of metering areas supported. This is the maximum length of the list in setMeteringAreas(List) and getMeteringAreas().
        Returns:
        the maximum number of metering areas supported by the camera.
        See Also:
        getMeteringAreas()
      • getMeteringAreas

        public List<Camera.Area> getMeteringAreas()

        Gets the current metering areas. Camera driver uses these areas to decide exposure.

        Before using this API or setMeteringAreas(List), apps should call getMaxNumMeteringAreas() to know the maximum number of metering areas first. If the value is 0, metering area is not supported.

        Each metering area is a rectangle with specified weight. The direction is relative to the sensor orientation, that is, what the sensor sees. The direction is not affected by the rotation or mirroring of Camera.setDisplayOrientation(int). Coordinates of the rectangle range from -1000 to 1000. (-1000, -1000) is the upper left point. (1000, 1000) is the lower right point. The width and height of metering areas cannot be 0 or negative.

        The weight must range from 1 to 1000, and represents a weight for every pixel in the area. This means that a large metering area with the same weight as a smaller area will have more effect in the metering result. Metering areas can partially overlap and the driver will add the weights in the overlap region.

        A special case of a null metering area list means the driver is free to meter as it chooses. For example, the driver may use more signals to select metering areas and change them dynamically. Apps can set the metering area list to null if they want the driver to completely control metering.

        Metering areas are relative to the current field of view (getZoom()). No matter what the zoom level is, (-1000,-1000) represents the top of the currently visible camera frame. The metering area cannot be set to be outside the current field of view, even when using zoom.

        No matter what metering areas are, the final exposure are compensated by setExposureCompensation(int).

        Returns:
        a list of current metering areas
      • getMaxNumDetectedFaces

        public int getMaxNumDetectedFaces()
        Gets the maximum number of detected faces supported. This is the maximum length of the list returned from Camera.FaceDetectionListener. If the return value is 0, face detection of the specified type is not supported.
        Returns:
        the maximum number of detected face supported by the camera.
        See Also:
        Camera.startFaceDetection()
      • setRecordingHint

        public void setRecordingHint(boolean hint)
        Sets recording mode hint. This tells the camera that the intent of the application is to record videos MediaRecorder.start(), not to take still pictures Camera.takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback, Camera.PictureCallback). Using this hint can allow MediaRecorder.start() to start faster or with fewer glitches on output. This should be called before starting preview for the best result, but can be changed while the preview is active. The default value is false. The app can still call takePicture() when the hint is true or call MediaRecorder.start() when the hint is false. But the performance may be worse.
        Parameters:
        hint - true if the apps intend to record videos using MediaRecorder.
      • isVideoSnapshotSupported

        public boolean isVideoSnapshotSupported()

        Returns true if video snapshot is supported. That is, applications can call Camera.takePicture(Camera.ShutterCallback, Camera.PictureCallback, Camera.PictureCallback, Camera.PictureCallback) during recording. Applications do not need to call Camera.startPreview() after taking a picture. The preview will be still active. Other than that, taking a picture during recording is identical to taking a picture normally. All settings and methods related to takePicture work identically. Ex: getPictureSize(), getSupportedPictureSizes(), setJpegQuality(int), setRotation(int), and etc. The picture will have an EXIF header. FLASH_MODE_AUTO and FLASH_MODE_ON also still work, but the video will record the flash.

        Applications can set shutter callback as null to avoid the shutter sound. It is also recommended to set raw picture and post view callbacks to null to avoid the interrupt of preview display.

        Field-of-view of the recorded video may be different from that of the captured pictures. The maximum size of a video snapshot may be smaller than that for regular still captures. If the current picture size is set higher than can be supported by video snapshot, the picture will be captured at the maximum supported size instead.

        Returns:
        true if video snapshot is supported.
      • setVideoStabilization

        public void setVideoStabilization(boolean toggle)

        Enables and disables video stabilization. Use isVideoStabilizationSupported() to determine if calling this method is valid.

        Video stabilization reduces the shaking due to the motion of the camera in both the preview stream and in recorded videos, including data received from the preview callback. It does not reduce motion blur in images captured with takePicture.

        Video stabilization can be enabled and disabled while preview or recording is active, but toggling it may cause a jump in the video stream that may be undesirable in a recorded video.

        Parameters:
        toggle - Set to true to enable video stabilization, and false to disable video stabilization.
        See Also:
        isVideoStabilizationSupported(), getVideoStabilization()


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1585 / 96487384. Delta: 0.07181 с