Android
android.hardware
public class

android.hardware.Camera.Parameters

java.lang.Object
android.hardware.Camera.Parameters

Handles the parameters for pictures created by a Camera service.

Summary

Public Methods

          String  flatten()
Creates a single string with all the parameters set in this Parameters object.
          String  get(String key)
Returns the value of a String parameter.
          int  getInt(String key)
Returns the value of an integer parameter.
          int  getPictureFormat()
Returns the image format for pictures.
          Camera.Size  getPictureSize()
Returns the dimension setting for pictures.
          int  getPreviewFormat()
Returns the image format for preview pictures.
          int  getPreviewFrameRate()
Returns the setting for the rate at which preview frames are received.
          Camera.Size  getPreviewSize()
Returns the dimensions setting for preview pictures.
          void  remove(String key)
          void  set(String key, int value)
Sets an integer parameter.
          void  set(String key, String value)
Sets a String parameter.
          void  setPictureFormat(int pixel_format)
Sets the image format for pictures.
          void  setPictureSize(int width, int height)
Sets the dimensions for pictures.
          void  setPreviewFormat(int pixel_format)
Sets the image format for preview pictures.
          void  setPreviewFrameRate(int fps)
Sets the rate at which preview frames are received.
          void  setPreviewSize(int width, int height)
Sets the dimensions for preview pictures.
          void  unflatten(String flattened)
Takes a flattened string of parameters and adds each one to this Parameters object.
Methods inherited from class java.lang.Object

Details

Public Methods

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

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

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

public int getPictureFormat()

Returns the image format for pictures.

Returns

  • the PixelFormat int representing the picture format

public Camera.Size getPictureSize()

Returns the dimension setting for pictures.

Returns

  • a Size object with the height and width setting for pictures

public int getPreviewFormat()

Returns the image format for preview pictures.

Returns

  • the PixelFormat int representing the preview picture format

public int getPreviewFrameRate()

Returns the setting for the rate at which preview frames are received.

Returns

  • the frame rate setting (frames per second)

public Camera.Size getPreviewSize()

Returns the dimensions setting for preview pictures.

Returns

  • a Size object with the height and width setting for the preview picture

public void remove(String key)

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

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

public void setPictureFormat(int pixel_format)

Sets the image format for pictures.

Parameters

pixel_format the desired picture format (PixelFormat.YCbCr_422_SP, PixelFormat.RGB_565, or PixelFormat.JPEG)

See Also

public void setPictureSize(int width, int height)

Sets the dimensions for pictures.

Parameters

width the width for pictures, in pixels
height the height for pictures, in pixels

public void setPreviewFormat(int pixel_format)

Sets the image format for preview pictures.

Parameters

pixel_format the desired preview picture format (PixelFormat.YCbCr_422_SP, PixelFormat.RGB_565, or PixelFormat.JPEG)

See Also

public void setPreviewFrameRate(int fps)

Sets the rate at which preview frames are received.

Parameters

fps the frame rate (frames per second)

public void setPreviewSize(int width, int height)

Sets the dimensions for preview pictures.

Parameters

width the width of the pictures, in pixels
height the height of the pictures, in pixels

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
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48