當前位置: 首頁>>代碼示例>>Java>>正文


Java Parameters.getSupportedSceneModes方法代碼示例

本文整理匯總了Java中android.hardware.Camera.Parameters.getSupportedSceneModes方法的典型用法代碼示例。如果您正苦於以下問題:Java Parameters.getSupportedSceneModes方法的具體用法?Java Parameters.getSupportedSceneModes怎麽用?Java Parameters.getSupportedSceneModes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.hardware.Camera.Parameters的用法示例。


在下文中一共展示了Parameters.getSupportedSceneModes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setSceneMode

import android.hardware.Camera.Parameters; //導入方法依賴的package包/類
@UiThread
private Parameters setSceneMode(Camera camera, Parameters params) {
	List<String> sceneModes = params.getSupportedSceneModes();
	if (sceneModes == null) return params;
	if (LOG.isLoggable(INFO)) LOG.info("Scene modes: " + sceneModes);
	if (sceneModes.contains(SCENE_MODE_BARCODE)) {
		params.setSceneMode(SCENE_MODE_BARCODE);
		camera.setParameters(params);
		return camera.getParameters();
	}
	return params;
}
 
開發者ID:rafjordao,項目名稱:Nird2,代碼行數:13,代碼來源:CameraView.java

示例2: setCamera

import android.hardware.Camera.Parameters; //導入方法依賴的package包/類
public void setCamera(Camera camera) {
     mCamera = camera;
     if (mCamera != null) {
      Parameters parameters = mCamera.getParameters();
         mSupportedPreviewSizes = parameters.getSupportedPreviewSizes();
List<Integer> formatsList = parameters.getSupportedPreviewFormats();	//get supported preview formats
if(formatsList.contains(ImageFormat.NV21)) {	// formatsList is always not null.
	parameters.setPreviewFormat(ImageFormat.NV21);		//set preview format is NV21,default is NV21 (yuv420sp)
}

  	//  Set Focus mode depending on what is supported. MODE_AUTO is 
  	//  preferred mode.
// need not to test supported mode coz it has been tested in main activity.
  	if (msnFocusMode == 2)	{
  		parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_INFINITY );
  	} else if (msnFocusMode == 1)	{
  		parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_FIXED );
  	} else	{
  		// set to auto focus by default
  		parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_AUTO);
  	}

  	/*if ((parameters.getMaxExposureCompensation() != 0 || parameters.getMinExposureCompensation() != 0)
      		&& ActivitySettings.msnPhotoTakenFrom == 1)	{	// screen mode.
      	parameters.setExposureCompensation(parameters.getMaxExposureCompensation());
      } */
  	parameters.setExposureCompensation(0);	// exposure is not adjusted. Seems that screen mode does not bring much benefit.
      

List<String> scenesList = parameters.getSupportedSceneModes();
if (scenesList != null && scenesList.contains(Camera.Parameters.SCENE_MODE_STEADYPHOTO)) {
	parameters.setSceneMode(Camera.Parameters.SCENE_MODE_STEADYPHOTO);	// this may crash in some devices.
}
boolean bSuccessful = setCameraParams(mCamera, parameters);

      requestLayout();
     } 
 }
 
開發者ID:woshiwpa,項目名稱:SmartMath,代碼行數:39,代碼來源:CameraPreview.java

示例3: isCameraHdrSupported

import android.hardware.Camera.Parameters; //導入方法依賴的package包/類
public static boolean isCameraHdrSupported(Parameters params) {
    List<String> supported = params.getSupportedSceneModes();
    return (supported != null) && supported.contains(SCENE_MODE_HDR);
}
 
開發者ID:asm-products,項目名稱:nexus-camera,代碼行數:5,代碼來源:CameraUtil.java


注:本文中的android.hardware.Camera.Parameters.getSupportedSceneModes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。