Stay organized with collections
Save and categorize content based on your preferences.
CameraProfile
open class CameraProfile
The CameraProfile class is used to retrieve the pre-defined still image capture (jpeg) quality levels (0-100) used for low, medium, and high quality settings in the Camera application.
Summary
Constants |
static Int |
|
static Int |
Define three quality levels for JPEG image encoding.
|
static Int |
|
Public methods |
open static Int |
Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the first back-facing camera on the device.
|
open static Int |
Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera.
|
Constants
QUALITY_HIGH
static val QUALITY_HIGH: Int
Value: 2
QUALITY_LOW
static val QUALITY_LOW: Int
Define three quality levels for JPEG image encoding.
Value: 0
QUALITY_MEDIUM
static val QUALITY_MEDIUM: Int
Value: 1
Public constructors
CameraProfile
CameraProfile()
Public methods
getJpegEncodingQualityParameter
open static fun getJpegEncodingQualityParameter(quality: Int): Int
Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the first back-facing camera on the device. If the device has no back-facing camera, this returns 0.
Parameters |
quality |
Int: The target quality level |
getJpegEncodingQualityParameter
open static fun getJpegEncodingQualityParameter(
cameraId: Int,
quality: Int
): Int
Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera.
Parameters |
cameraId |
Int: The id of the camera |
quality |
Int: The target quality level |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CameraProfile\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCameraProfile\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/CameraProfile \"View this page in Java\") \n\n```\nopen class CameraProfile\n```\n\n|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.CameraProfile](#) |\n\nThe CameraProfile class is used to retrieve the pre-defined still image capture (jpeg) quality levels (0-100) used for low, medium, and high quality settings in the Camera application.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [QUALITY_HIGH](#QUALITY_HIGH:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [QUALITY_LOW](#QUALITY_LOW:kotlin.Int) Define three quality levels for JPEG image encoding. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [QUALITY_MEDIUM](#QUALITY_MEDIUM:kotlin.Int) \u003cbr /\u003e |\n\n| Public constructors ||\n|----------------------------------------------|---|\n| [CameraProfile](#CameraProfile())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getJpegEncodingQualityParameter](#getJpegEncodingQualityParameter(kotlin.Int))`(`quality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the first back-facing camera on the device. |\n| open static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getJpegEncodingQualityParameter](#getJpegEncodingQualityParameter(kotlin.Int,%20kotlin.Int))`(`cameraId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `quality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera. |\n\nConstants\n---------\n\n### QUALITY_HIGH\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val QUALITY_HIGH: Int\n``` \n\n Value: 2\n\n### QUALITY_LOW\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val QUALITY_LOW: Int\n```\n\nDefine three quality levels for JPEG image encoding. \n\n Value: 0\n\n### QUALITY_MEDIUM\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val QUALITY_MEDIUM: Int\n``` \n\n Value: 1\n\nPublic constructors\n-------------------\n\n### CameraProfile\n\n```\nCameraProfile()\n```\n\nPublic methods\n--------------\n\n### getJpegEncodingQualityParameter\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun getJpegEncodingQualityParameter(quality: Int): Int\n```\n\nReturns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the first back-facing camera on the device. If the device has no back-facing camera, this returns 0.\n\n| Parameters ||\n|-----------|------------------------------------------------------------------------------------------------------|\n| `quality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The target quality level |\n\n### getJpegEncodingQualityParameter\n\nAdded in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun getJpegEncodingQualityParameter(\n cameraId: Int, \n quality: Int\n): Int\n```\n\nReturns a pre-defined still image capture (jpeg) quality level used for the given quality level in the Camera application for the specified camera.\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------------|\n| `cameraId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The id of the camera |\n| `quality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The target quality level |"]]