diff options
author | Zhijun He <zhijunhe@google.com> | 2014-07-09 01:38:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-07-07 17:47:39 +0000 |
commit | 261bba65ee32c608b0f8ca4e8a1dd950cbf7caa0 (patch) | |
tree | 4e7cf466cff82b0ac4220822e0ca990407b3b3aa | |
parent | fe6b75f0d85f0c7a2aeca6f0addc168fa8d9d774 (diff) | |
parent | 450e01c27173d2e5051c73e59d5f6386dca5fa93 (diff) | |
download | android_system_media-261bba65ee32c608b0f8ca4e8a1dd950cbf7caa0.tar.gz android_system_media-261bba65ee32c608b0f8ca4e8a1dd950cbf7caa0.tar.bz2 android_system_media-261bba65ee32c608b0f8ca4e8a1dd950cbf7caa0.zip |
Merge "camera_metadata: Add aberration correction control"
-rw-r--r-- | camera/docs/docs.html | 244 | ||||
-rw-r--r-- | camera/docs/metadata_properties.xml | 69 | ||||
-rw-r--r-- | camera/include/system/camera_metadata_tags.h | 11 | ||||
-rw-r--r-- | camera/src/camera_metadata_tag_info.c | 27 |
4 files changed, 351 insertions, 0 deletions
diff --git a/camera/docs/docs.html b/camera/docs/docs.html index 39113649..405346ac 100644 --- a/camera/docs/docs.html +++ b/camera/docs/docs.html @@ -119,6 +119,8 @@ ><a href="#controls_android.colorCorrection.transform">android.colorCorrection.transform</a></li> <li ><a href="#controls_android.colorCorrection.gains">android.colorCorrection.gains</a></li> + <li + ><a href="#controls_android.colorCorrection.aberrationCorrectionMode">android.colorCorrection.aberrationCorrectionMode</a></li> </ul> </li> <li> @@ -130,6 +132,15 @@ ><a href="#dynamic_android.colorCorrection.transform">android.colorCorrection.transform</a></li> <li ><a href="#dynamic_android.colorCorrection.gains">android.colorCorrection.gains</a></li> + <li + ><a href="#dynamic_android.colorCorrection.aberrationCorrectionMode">android.colorCorrection.aberrationCorrectionMode</a></li> + </ul> + </li> + <li> + <span class="toc_kind_header">static</span> + <ul class="toc_section"> + <li + ><a href="#static_android.colorCorrection.availableAberrationCorrectionModes">android.colorCorrection.availableAberrationCorrectionModes</a></li> </ul> </li> </ul> <!-- toc_section --> @@ -1309,6 +1320,77 @@ channels,<wbr/> it must use the <code>G_<wbr/>even</code> value,<wbr/> and write <tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr> <!-- end of entry --> + + <tr class="entry" id="controls_android.colorCorrection.aberrationCorrectionMode"> + <td class="entry_name + " rowspan="3"> + android.<wbr/>color<wbr/>Correction.<wbr/>aberration<wbr/>Correction<wbr/>Mode + </td> + <td class="entry_type"> + <span class="entry_type_name entry_type_name_enum">byte</span> + + <span class="entry_type_visibility"> [public]</span> + + + + + <ul class="entry_type_enum"> + <li> + <span class="entry_type_enum_name">OFF</span> + <span class="entry_type_enum_notes"><p>No aberration correction is applied.<wbr/></p></span> + </li> + <li> + <span class="entry_type_enum_name">FAST</span> + <span class="entry_type_enum_notes"><p>Aberration correction will not slow down capture rate +relative to sensor raw output.<wbr/></p></span> + </li> + <li> + <span class="entry_type_enum_name">HIGH_QUALITY</span> + <span class="entry_type_enum_notes"><p>Aberration correction operates at improved quality but reduced +capture rate (relative to sensor raw output).<wbr/></p></span> + </li> + </ul> + + </td> <!-- entry_type --> + + <td class="entry_description"> + <p>Mode of operation for the chromatic aberration correction algorithm.<wbr/></p> + </td> + + <td class="entry_units"> + </td> + + <td class="entry_range"> + </td> + + <td class="entry_tags"> + </td> + + </tr> + <tr class="entries_header"> + <th class="th_details" colspan="5">Details</th> + </tr> + <tr class="entry_cont"> + <td class="entry_details" colspan="5"> + <p>This must be set to a valid mode from +<a href="#static_android.colorCorrection.availableAberrationCorrectionModes">android.<wbr/>color<wbr/>Correction.<wbr/>available<wbr/>Aberration<wbr/>Correction<wbr/>Modes</a>.<wbr/></p> +<p>Chromatic (color) aberration is caused by the fact that different wavelengths of light +can not focus on the same point after exiting from the lens.<wbr/> This metadata defines +the high level control of chromatic aberration correction algorithm,<wbr/> which aims to +minimize the chromatic artifacts that may occur along the object boundaries in an +image.<wbr/></p> +<p>FAST/<wbr/>HIGH_<wbr/>QUALITY both mean that camera device determined aberration +correction will be applied.<wbr/> HIGH_<wbr/>QUALITY mode indicates that the camera device will +use the highest-quality aberration correction algorithms,<wbr/> even if it slows down +capture rate.<wbr/> FAST means the camera device will not slow down capture rate when +applying aberration correction.<wbr/></p> + </td> + </tr> + + + <tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr> + <!-- end of entry --> + <!-- end of kind --> @@ -1579,6 +1661,162 @@ channels,<wbr/> it must use the <code>G_<wbr/>even</code> value,<wbr/> and write <tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr> <!-- end of entry --> + + <tr class="entry" id="dynamic_android.colorCorrection.aberrationCorrectionMode"> + <td class="entry_name + " rowspan="3"> + android.<wbr/>color<wbr/>Correction.<wbr/>aberration<wbr/>Correction<wbr/>Mode + </td> + <td class="entry_type"> + <span class="entry_type_name entry_type_name_enum">byte</span> + + <span class="entry_type_visibility"> [public]</span> + + + + + <ul class="entry_type_enum"> + <li> + <span class="entry_type_enum_name">OFF</span> + <span class="entry_type_enum_notes"><p>No aberration correction is applied.<wbr/></p></span> + </li> + <li> + <span class="entry_type_enum_name">FAST</span> + <span class="entry_type_enum_notes"><p>Aberration correction will not slow down capture rate +relative to sensor raw output.<wbr/></p></span> + </li> + <li> + <span class="entry_type_enum_name">HIGH_QUALITY</span> + <span class="entry_type_enum_notes"><p>Aberration correction operates at improved quality but reduced +capture rate (relative to sensor raw output).<wbr/></p></span> + </li> + </ul> + + </td> <!-- entry_type --> + + <td class="entry_description"> + <p>Mode of operation for the chromatic aberration correction algorithm.<wbr/></p> + </td> + + <td class="entry_units"> + </td> + + <td class="entry_range"> + </td> + + <td class="entry_tags"> + </td> + + </tr> + <tr class="entries_header"> + <th class="th_details" colspan="5">Details</th> + </tr> + <tr class="entry_cont"> + <td class="entry_details" colspan="5"> + <p>This must be set to a valid mode from +<a href="#static_android.colorCorrection.availableAberrationCorrectionModes">android.<wbr/>color<wbr/>Correction.<wbr/>available<wbr/>Aberration<wbr/>Correction<wbr/>Modes</a>.<wbr/></p> +<p>Chromatic (color) aberration is caused by the fact that different wavelengths of light +can not focus on the same point after exiting from the lens.<wbr/> This metadata defines +the high level control of chromatic aberration correction algorithm,<wbr/> which aims to +minimize the chromatic artifacts that may occur along the object boundaries in an +image.<wbr/></p> +<p>FAST/<wbr/>HIGH_<wbr/>QUALITY both mean that camera device determined aberration +correction will be applied.<wbr/> HIGH_<wbr/>QUALITY mode indicates that the camera device will +use the highest-quality aberration correction algorithms,<wbr/> even if it slows down +capture rate.<wbr/> FAST means the camera device will not slow down capture rate when +applying aberration correction.<wbr/></p> + </td> + </tr> + + + <tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr> + <!-- end of entry --> + + + + <!-- end of kind --> + </tbody> + <tr><td colspan="6" class="kind">static</td></tr> + + <thead class="entries_header"> + <tr> + <th class="th_name">Property Name</th> + <th class="th_type">Type</th> + <th class="th_description">Description</th> + <th class="th_units">Units</th> + <th class="th_range">Range</th> + <th class="th_tags">Tags</th> + </tr> + </thead> + + <tbody> + + + + + + + + + + + <tr class="entry" id="static_android.colorCorrection.availableAberrationCorrectionModes"> + <td class="entry_name + " rowspan="3"> + android.<wbr/>color<wbr/>Correction.<wbr/>available<wbr/>Aberration<wbr/>Correction<wbr/>Modes + </td> + <td class="entry_type"> + <span class="entry_type_name">byte</span> + <span class="entry_type_container">x</span> + + <span class="entry_type_array"> + n + </span> + <span class="entry_type_visibility"> [public as enumList]</span> + + + + <div class="entry_type_notes">list of enums</div> + + + </td> <!-- entry_type --> + + <td class="entry_description"> + <p>The set of aberration correction modes supported by this camera device.<wbr/></p> + </td> + + <td class="entry_units"> + </td> + + <td class="entry_range"> + <p>The subset of aberration correction mode from those specified in +<a href="#controls_android.colorCorrection.aberrationCorrectionMode">android.<wbr/>color<wbr/>Correction.<wbr/>aberration<wbr/>Correction<wbr/>Mode</a>.<wbr/></p> + </td> + + <td class="entry_tags"> + <ul class="entry_tags"> + <li><a href="#tag_V1">V1</a></li> + </ul> + </td> + + </tr> + <tr class="entries_header"> + <th class="th_details" colspan="5">Details</th> + </tr> + <tr class="entry_cont"> + <td class="entry_details" colspan="5"> + <p>This metadata lists the valid modes for <a href="#controls_android.colorCorrection.aberrationCorrectionMode">android.<wbr/>color<wbr/>Correction.<wbr/>aberration<wbr/>Correction<wbr/>Mode</a>.<wbr/> +If no aberration correction modes are available for a device,<wbr/> this list will solely include +OFF mode.<wbr/></p> +<p>For FULL capability device (<a href="#static_android.info.supportedHardwareLevel">android.<wbr/>info.<wbr/>supported<wbr/>Hardware<wbr/>Level</a> <code>==</code> FULL),<wbr/> OFF must be +included.<wbr/></p> + </td> + </tr> + + + <tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr> + <!-- end of entry --> + <!-- end of kind --> @@ -12838,6 +13076,11 @@ stages.<wbr/> This means the following controls are guaranteed to be supported:< <li><a href="#static_android.lens.info.shadingMapSize">android.<wbr/>lens.<wbr/>info.<wbr/>shading<wbr/>Map<wbr/>Size</a></li> </ul> </li> +<li>Manual aberration correction control (if aberration correction is supported)<ul> +<li><a href="#controls_android.colorCorrection.aberrationCorrectionMode">android.<wbr/>color<wbr/>Correction.<wbr/>aberration<wbr/>Correction<wbr/>Mode</a></li> +<li><a href="#static_android.colorCorrection.availableAberrationCorrectionModes">android.<wbr/>color<wbr/>Correction.<wbr/>available<wbr/>Aberration<wbr/>Correction<wbr/>Modes</a></li> +</ul> +</li> </ul> <p>If auto white balance is enabled,<wbr/> then the camera device will accurately report the values applied by AWB in the result.<wbr/></p> @@ -22096,6 +22339,7 @@ to know when sensor settings have been applied.<wbr/></p> New features for first camera 2 release (API1) <ul class="tags_entries"> + <li><a href="#static_android.colorCorrection.availableAberrationCorrectionModes">android.colorCorrection.availableAberrationCorrectionModes</a> (static)</li> <li><a href="#static_android.control.availableHighSpeedVideoConfigurations">android.control.availableHighSpeedVideoConfigurations</a> (static)</li> <li><a href="#controls_android.edge.mode">android.edge.mode</a> (controls)</li> <li><a href="#static_android.edge.availableEdgeModes">android.edge.availableEdgeModes</a> (static)</li> diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml index 2374e0cf..3dd4b61b 100644 --- a/camera/docs/metadata_properties.xml +++ b/camera/docs/metadata_properties.xml @@ -260,6 +260,46 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata `G_odd` equal to `G_even` in the output result metadata. </hal_details> </entry> + <entry name="aberrationCorrectionMode" type="byte" visibility="public" enum="true"> + <enum> + <value>OFF + <notes> + No aberration correction is applied. + </notes> + </value> + <value>FAST + <notes> + Aberration correction will not slow down capture rate + relative to sensor raw output. + </notes> + </value> + <value>HIGH_QUALITY + <notes> + Aberration correction operates at improved quality but reduced + capture rate (relative to sensor raw output). + </notes> + </value> + </enum> + <description> + Mode of operation for the chromatic aberration correction algorithm. + </description> + <details> + This must be set to a valid mode from + android.colorCorrection.availableAberrationCorrectionModes. + + Chromatic (color) aberration is caused by the fact that different wavelengths of light + can not focus on the same point after exiting from the lens. This metadata defines + the high level control of chromatic aberration correction algorithm, which aims to + minimize the chromatic artifacts that may occur along the object boundaries in an + image. + + FAST/HIGH_QUALITY both mean that camera device determined aberration + correction will be applied. HIGH_QUALITY mode indicates that the camera device will + use the highest-quality aberration correction algorithms, even if it slows down + capture rate. FAST means the camera device will not slow down capture rate when + applying aberration correction. + </details> + </entry> </controls> <dynamic> <clone entry="android.colorCorrection.mode" kind="controls"> @@ -268,7 +308,33 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata </clone> <clone entry="android.colorCorrection.gains" kind="controls"> </clone> + <clone entry="android.colorCorrection.aberrationCorrectionMode" kind="controls"> + </clone> </dynamic> + <static> + <entry name="availableAberrationCorrectionModes" type="byte" visibility="public" + type_notes="list of enums" container="array" typedef="enumList"> + <array> + <size>n</size> + </array> + <description> + The set of aberration correction modes supported by this camera device. + </description> + <range> + The subset of aberration correction mode from those specified in + android.colorCorrection.aberrationCorrectionMode. + </range> + <details> + This metadata lists the valid modes for android.colorCorrection.aberrationCorrectionMode. + If no aberration correction modes are available for a device, this list will solely include + OFF mode. + + For FULL capability device (android.info.supportedHardwareLevel `==` FULL), OFF must be + included. + </details> + <tag id="V1" /> + </entry> + </static> </section> <section name="control"> <controls> @@ -3559,6 +3625,9 @@ xsi:schemaLocation="http://schemas.android.com/service/camera/metadata/ metadata * android.statistics.lensShadingMapMode * android.statistics.lensShadingMap * android.lens.info.shadingMapSize + * Manual aberration correction control (if aberration correction is supported) + * android.colorCorrection.aberrationCorrectionMode + * android.colorCorrection.availableAberrationCorrectionModes If auto white balance is enabled, then the camera device will accurately report the values applied by AWB in the result. diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h index abd8e46d..8170ef7f 100644 --- a/camera/include/system/camera_metadata_tags.h +++ b/camera/include/system/camera_metadata_tags.h @@ -107,6 +107,10 @@ typedef enum camera_metadata_tag { ANDROID_COLOR_CORRECTION_START, ANDROID_COLOR_CORRECTION_TRANSFORM, // rational[] | public ANDROID_COLOR_CORRECTION_GAINS, // float[] | public + ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE, + // enum | public + ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES, + // byte[] | public ANDROID_COLOR_CORRECTION_END, ANDROID_CONTROL_AE_ANTIBANDING_MODE = // enum | public @@ -385,6 +389,13 @@ typedef enum camera_metadata_enum_android_color_correction_mode { ANDROID_COLOR_CORRECTION_MODE_HIGH_QUALITY, } camera_metadata_enum_android_color_correction_mode_t; +// ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE +typedef enum camera_metadata_enum_android_color_correction_aberration_correction_mode { + ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_OFF, + ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST, + ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY, +} camera_metadata_enum_android_color_correction_aberration_correction_mode_t; + // ANDROID_CONTROL_AE_ANTIBANDING_MODE typedef enum camera_metadata_enum_android_control_ae_antibanding_mode { diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c index 055886d4..63ce6f07 100644 --- a/camera/src/camera_metadata_tag_info.c +++ b/camera/src/camera_metadata_tag_info.c @@ -117,6 +117,11 @@ static tag_info_t android_color_correction[ANDROID_COLOR_CORRECTION_END - }, [ ANDROID_COLOR_CORRECTION_GAINS - ANDROID_COLOR_CORRECTION_START ] = { "gains", TYPE_FLOAT }, + [ ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE - ANDROID_COLOR_CORRECTION_START ] = + { "aberrationCorrectionMode", TYPE_BYTE }, + [ ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES - ANDROID_COLOR_CORRECTION_START ] = + { "availableAberrationCorrectionModes", + TYPE_BYTE }, }; static tag_info_t android_control[ANDROID_CONTROL_END - @@ -664,6 +669,28 @@ int camera_metadata_enum_snprint(uint32_t tag, case ANDROID_COLOR_CORRECTION_GAINS: { break; } + case ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE: { + switch (value) { + case ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_OFF: + msg = "OFF"; + ret = 0; + break; + case ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST: + msg = "FAST"; + ret = 0; + break; + case ANDROID_COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY: + msg = "HIGH_QUALITY"; + ret = 0; + break; + default: + msg = "error: enum value out of range"; + } + break; + } + case ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES: { + break; + } case ANDROID_CONTROL_AE_ANTIBANDING_MODE: { switch (value) { |