camera_metadata: Update android.tonemap.* definitions
Change-Id: Icdabd02d892018b104955146a4d94b5042ea59d8
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 16cc369..d037da4 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -12761,6 +12761,32 @@
</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>When switching to an application-defined contrast curve by setting
+<a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> to CONTRAST_<wbr/>CURVE,<wbr/> the curve is defined
+per-channel with a set of <code>(in,<wbr/> out)</code> points that specify the
+mapping from input high-bit-depth pixel value to the output
+low-bit-depth value.<wbr/> Since the actual pixel ranges of both input
+and output may change depending on the camera pipeline,<wbr/> the values
+are specified by normalized floating-point numbers.<wbr/></p>
+<p>More-complex color mapping operations such as 3D color look-up
+tables,<wbr/> selective chroma enhancement,<wbr/> or other non-linear color
+transforms will be disabled when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
+<p>When using either FAST or HIGH_<wbr/>QUALITY,<wbr/> the camera device will
+emit its own tonemap curve in <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a>,<wbr/>
+<a href="#controls_android.tonemap.curveGreen">android.<wbr/>tonemap.<wbr/>curve<wbr/>Green</a>,<wbr/> and <a href="#controls_android.tonemap.curveBlue">android.<wbr/>tonemap.<wbr/>curve<wbr/>Blue</a>.<wbr/>
+These values are always available,<wbr/> and as close as possible to the
+actually used nonlinear/<wbr/>nonglobal transforms.<wbr/></p>
+<p>If a request is sent with TRANSFORM_<wbr/>MATRIX with the camera device's
+provided curve in FAST or HIGH_<wbr/>QUALITY,<wbr/> the image's tonemap will be
+roughly the same.<wbr/></p>
+ </td>
+ </tr>
<tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr>
@@ -13161,8 +13187,9 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping blue input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the blue
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
@@ -13182,9 +13209,7 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the blue
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
+ <p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
</td>
</tr>
@@ -13211,8 +13236,9 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping green input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the green
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
@@ -13232,9 +13258,7 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the green
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
+ <p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
</td>
</tr>
@@ -13244,7 +13268,7 @@
<tr class="entry" id="controls_android.tonemap.curveRed">
- <td class="entry_name" rowspan="3">
+ <td class="entry_name" rowspan="5">
android.<wbr/>tonemap.<wbr/>curve<wbr/>Red
</td>
<td class="entry_type">
@@ -13261,15 +13285,17 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping red input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the red
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
</td>
<td class="entry_range">
- <p>0-1 on input and output coordinates.<wbr/></p>
+ <p>0-1 on both input and output coordinates,<wbr/> normalized
+as a floating-point value such that 0 == black and 1 == white.<wbr/></p>
</td>
<td class="entry_tags">
@@ -13284,28 +13310,67 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the red
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>Since the input and output ranges may vary depending on
-the camera pipeline,<wbr/> the input and output pixel values
-are represented by normalized floating-point values
-between 0 and 1,<wbr/> with 0 == black and 1 == white.<wbr/></p>
-<p>The curve should be linearly interpolated between the
-defined points.<wbr/> The points will be listed in increasing
-order of P_<wbr/>IN.<wbr/> For example,<wbr/> if the array is: [0.<wbr/>0,<wbr/> 0.<wbr/>0,<wbr/>
-0.<wbr/>3,<wbr/> 0.<wbr/>5,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0],<wbr/> then the input->output mapping
-for a few sample points would be: 0 -> 0,<wbr/> 0.<wbr/>15 ->
-0.<wbr/>25,<wbr/> 0.<wbr/>3 -> 0.<wbr/>5,<wbr/> 0.<wbr/>5 -> 0.<wbr/>64</p>
+ <p>Each channel's curve is defined by an array of control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> =
+ [ P0in,<wbr/> P0out,<wbr/> P1in,<wbr/> P1out,<wbr/> P2in,<wbr/> P2out,<wbr/> P3in,<wbr/> P3out,<wbr/> ...,<wbr/> PNin,<wbr/> PNout ]
+2 <= N <= <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a></code></pre>
+<p>These are sorted in order of increasing <code>Pin</code>; it is always
+guaranteed that input values 0.<wbr/>0 and 1.<wbr/>0 are included in the list to
+define a complete mapping.<wbr/> For input values between control points,<wbr/>
+the camera device must linearly interpolate between the control
+points.<wbr/></p>
+<p>Each curve can have an independent number of points,<wbr/> and the number
+of points can be less than max (that is,<wbr/> the request doesn't have to
+always provide a curve with number of points equivalent to
+<a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>A few examples,<wbr/> and their corresponding graphical mappings; these
+only specify the red channel and the precision is limited to 4
+digits,<wbr/> for conciseness.<wbr/></p>
+<p>Linear mapping:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [ 0,<wbr/> 0,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0 ]
+</code></pre>
+<p><img alt="Linear mapping curve" src="images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png"/></p>
+<p>Invert mapping:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [ 0,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0,<wbr/> 0 ]
+</code></pre>
+<p><img alt="Inverting mapping curve" src="images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png"/></p>
+<p>Gamma 1/<wbr/>2.<wbr/>2 mapping,<wbr/> with 16 control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [
+ 0.<wbr/>0000,<wbr/> 0.<wbr/>0000,<wbr/> 0.<wbr/>0667,<wbr/> 0.<wbr/>2920,<wbr/> 0.<wbr/>1333,<wbr/> 0.<wbr/>4002,<wbr/> 0.<wbr/>2000,<wbr/> 0.<wbr/>4812,<wbr/>
+ 0.<wbr/>2667,<wbr/> 0.<wbr/>5484,<wbr/> 0.<wbr/>3333,<wbr/> 0.<wbr/>6069,<wbr/> 0.<wbr/>4000,<wbr/> 0.<wbr/>6594,<wbr/> 0.<wbr/>4667,<wbr/> 0.<wbr/>7072,<wbr/>
+ 0.<wbr/>5333,<wbr/> 0.<wbr/>7515,<wbr/> 0.<wbr/>6000,<wbr/> 0.<wbr/>7928,<wbr/> 0.<wbr/>6667,<wbr/> 0.<wbr/>8317,<wbr/> 0.<wbr/>7333,<wbr/> 0.<wbr/>8685,<wbr/>
+ 0.<wbr/>8000,<wbr/> 0.<wbr/>9035,<wbr/> 0.<wbr/>8667,<wbr/> 0.<wbr/>9370,<wbr/> 0.<wbr/>9333,<wbr/> 0.<wbr/>9691,<wbr/> 1.<wbr/>0000,<wbr/> 1.<wbr/>0000 ]
+</code></pre>
+<p><img alt="Gamma = 1/2.2 tonemapping curve" src="images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png"/></p>
+<p>Standard sRGB gamma mapping,<wbr/> per IEC 61966-2-1:1999,<wbr/> with 16 control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [
+ 0.<wbr/>0000,<wbr/> 0.<wbr/>0000,<wbr/> 0.<wbr/>0667,<wbr/> 0.<wbr/>2864,<wbr/> 0.<wbr/>1333,<wbr/> 0.<wbr/>4007,<wbr/> 0.<wbr/>2000,<wbr/> 0.<wbr/>4845,<wbr/>
+ 0.<wbr/>2667,<wbr/> 0.<wbr/>5532,<wbr/> 0.<wbr/>3333,<wbr/> 0.<wbr/>6125,<wbr/> 0.<wbr/>4000,<wbr/> 0.<wbr/>6652,<wbr/> 0.<wbr/>4667,<wbr/> 0.<wbr/>7130,<wbr/>
+ 0.<wbr/>5333,<wbr/> 0.<wbr/>7569,<wbr/> 0.<wbr/>6000,<wbr/> 0.<wbr/>7977,<wbr/> 0.<wbr/>6667,<wbr/> 0.<wbr/>8360,<wbr/> 0.<wbr/>7333,<wbr/> 0.<wbr/>8721,<wbr/>
+ 0.<wbr/>8000,<wbr/> 0.<wbr/>9063,<wbr/> 0.<wbr/>8667,<wbr/> 0.<wbr/>9389,<wbr/> 0.<wbr/>9333,<wbr/> 0.<wbr/>9701,<wbr/> 1.<wbr/>0000,<wbr/> 1.<wbr/>0000 ]
+</code></pre>
+<p><img alt="sRGB tonemapping curve" src="images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png"/></p>
</td>
</tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="5">HAL Implementation Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="5">
+ <p>For good quality of mapping,<wbr/> at least 128 control points are
+preferred.<wbr/></p>
+<p>A typical use case of this would be a gamma-1/<wbr/>2.<wbr/>2 curve,<wbr/> with as many
+control points used as are available.<wbr/></p>
+ </td>
+ </tr>
<tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr>
<!-- end of entry -->
<tr class="entry" id="controls_android.tonemap.mode">
- <td class="entry_name" rowspan="1">
+ <td class="entry_name" rowspan="3">
android.<wbr/>tonemap.<wbr/>mode
</td>
<td class="entry_type">
@@ -13317,23 +13382,30 @@
<li>
<span class="entry_type_enum_name">CONTRAST_CURVE</span>
<span class="entry_type_enum_notes"><p>Use the tone mapping curve specified in
-android.<wbr/>tonemap.<wbr/>curve</p></span>
+android.<wbr/>tonemap.<wbr/>curve.<wbr/></p>
+<p>All color enhancement and tonemapping must be disabled,<wbr/> except
+for applying the tonemapping curve specified by
+<a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a>,<wbr/> <a href="#controls_android.tonemap.curveBlue">android.<wbr/>tonemap.<wbr/>curve<wbr/>Blue</a>,<wbr/> or
+<a href="#controls_android.tonemap.curveGreen">android.<wbr/>tonemap.<wbr/>curve<wbr/>Green</a>.<wbr/></p>
+<p>Must not slow down frame rate relative to raw
+sensor output.<wbr/></p></span>
</li>
<li>
<span class="entry_type_enum_name">FAST</span>
- <span class="entry_type_enum_notes"><p>Must not slow down frame rate relative to raw
-bayer output</p></span>
+ <span class="entry_type_enum_notes"><p>Advanced gamma mapping and color enhancement may be applied.<wbr/></p>
+<p>Should not slow down frame rate relative to raw sensor output.<wbr/></p></span>
</li>
<li>
<span class="entry_type_enum_name">HIGH_QUALITY</span>
- <span class="entry_type_enum_notes"><p>Frame rate may be reduced by high
-quality</p></span>
+ <span class="entry_type_enum_notes"><p>Advanced gamma mapping and color enhancement may be applied.<wbr/></p>
+<p>May slow down frame rate relative to raw sensor output.<wbr/></p></span>
</li>
</ul>
</td> <!-- entry_type -->
<td class="entry_description">
+ <p>High-level global contrast/<wbr/>gamma/<wbr/>tonemapping control.<wbr/></p>
</td>
<td class="entry_units">
@@ -13346,6 +13418,32 @@
</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>When switching to an application-defined contrast curve by setting
+<a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> to CONTRAST_<wbr/>CURVE,<wbr/> the curve is defined
+per-channel with a set of <code>(in,<wbr/> out)</code> points that specify the
+mapping from input high-bit-depth pixel value to the output
+low-bit-depth value.<wbr/> Since the actual pixel ranges of both input
+and output may change depending on the camera pipeline,<wbr/> the values
+are specified by normalized floating-point numbers.<wbr/></p>
+<p>More-complex color mapping operations such as 3D color look-up
+tables,<wbr/> selective chroma enhancement,<wbr/> or other non-linear color
+transforms will be disabled when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
+<p>When using either FAST or HIGH_<wbr/>QUALITY,<wbr/> the camera device will
+emit its own tonemap curve in <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a>,<wbr/>
+<a href="#controls_android.tonemap.curveGreen">android.<wbr/>tonemap.<wbr/>curve<wbr/>Green</a>,<wbr/> and <a href="#controls_android.tonemap.curveBlue">android.<wbr/>tonemap.<wbr/>curve<wbr/>Blue</a>.<wbr/>
+These values are always available,<wbr/> and as close as possible to the
+actually used nonlinear/<wbr/>nonglobal transforms.<wbr/></p>
+<p>If a request is sent with TRANSFORM_<wbr/>MATRIX with the camera device's
+provided curve in FAST or HIGH_<wbr/>QUALITY,<wbr/> the image's tonemap will be
+roughly the same.<wbr/></p>
+ </td>
+ </tr>
<tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr>
@@ -13380,7 +13478,7 @@
<tr class="entry" id="static_android.tonemap.maxCurvePoints">
- <td class="entry_name" rowspan="1">
+ <td class="entry_name" rowspan="5">
android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points
</td>
<td class="entry_type">
@@ -13393,21 +13491,44 @@
<td class="entry_description">
<p>Maximum number of supported points in the
-tonemap curve</p>
+tonemap curve that can be used for <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a>,<wbr/> or
+<a href="#controls_android.tonemap.curveGreen">android.<wbr/>tonemap.<wbr/>curve<wbr/>Green</a>,<wbr/> or <a href="#controls_android.tonemap.curveBlue">android.<wbr/>tonemap.<wbr/>curve<wbr/>Blue</a>.<wbr/></p>
</td>
<td class="entry_units">
</td>
<td class="entry_range">
- <p>>= 128</p>
+ <p>>= 64</p>
</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>If the actual number of points provided by the application (in
+android.<wbr/>tonemap.<wbr/>curve*) is less than max,<wbr/> the camera device will
+resample the curve to its internal representation,<wbr/> using linear
+interpolation.<wbr/></p>
+<p>The output curves in the result metadata may have a different number
+of points than the input curves,<wbr/> and will represent the actual
+hardware curves used as closely as possible when linearly interpolated.<wbr/></p>
+ </td>
+ </tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="5">HAL Implementation Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="5">
+ <p>This value must be at least 64.<wbr/> This should be at least 128.<wbr/></p>
+ </td>
+ </tr>
<tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr>
<!-- end of entry -->
@@ -13458,8 +13579,9 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping blue input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the blue
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
@@ -13479,9 +13601,7 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the blue
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
+ <p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
</td>
</tr>
@@ -13508,8 +13628,9 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping green input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the green
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
@@ -13529,9 +13650,7 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the green
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
+ <p>See <a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> for more details.<wbr/></p>
</td>
</tr>
@@ -13541,7 +13660,7 @@
<tr class="entry" id="dynamic_android.tonemap.curveRed">
- <td class="entry_name" rowspan="3">
+ <td class="entry_name" rowspan="5">
android.<wbr/>tonemap.<wbr/>curve<wbr/>Red
</td>
<td class="entry_type">
@@ -13558,15 +13677,17 @@
</td> <!-- entry_type -->
<td class="entry_description">
- <p>Table mapping red input values to output
-values</p>
+ <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the red
+channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is
+CONTRAST_<wbr/>CURVE.<wbr/></p>
</td>
<td class="entry_units">
</td>
<td class="entry_range">
- <p>0-1 on input and output coordinates.<wbr/></p>
+ <p>0-1 on both input and output coordinates,<wbr/> normalized
+as a floating-point value such that 0 == black and 1 == white.<wbr/></p>
</td>
<td class="entry_tags">
@@ -13581,28 +13702,67 @@
</tr>
<tr class="entry_cont">
<td class="entry_details" colspan="5">
- <p>Tonemapping /<wbr/> contrast /<wbr/> gamma curve for the red
-channel,<wbr/> to use when <a href="#controls_android.tonemap.mode">android.<wbr/>tonemap.<wbr/>mode</a> is CONTRAST_<wbr/>CURVE.<wbr/></p>
-<p>Since the input and output ranges may vary depending on
-the camera pipeline,<wbr/> the input and output pixel values
-are represented by normalized floating-point values
-between 0 and 1,<wbr/> with 0 == black and 1 == white.<wbr/></p>
-<p>The curve should be linearly interpolated between the
-defined points.<wbr/> The points will be listed in increasing
-order of P_<wbr/>IN.<wbr/> For example,<wbr/> if the array is: [0.<wbr/>0,<wbr/> 0.<wbr/>0,<wbr/>
-0.<wbr/>3,<wbr/> 0.<wbr/>5,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0],<wbr/> then the input->output mapping
-for a few sample points would be: 0 -> 0,<wbr/> 0.<wbr/>15 ->
-0.<wbr/>25,<wbr/> 0.<wbr/>3 -> 0.<wbr/>5,<wbr/> 0.<wbr/>5 -> 0.<wbr/>64</p>
+ <p>Each channel's curve is defined by an array of control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> =
+ [ P0in,<wbr/> P0out,<wbr/> P1in,<wbr/> P1out,<wbr/> P2in,<wbr/> P2out,<wbr/> P3in,<wbr/> P3out,<wbr/> ...,<wbr/> PNin,<wbr/> PNout ]
+2 <= N <= <a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a></code></pre>
+<p>These are sorted in order of increasing <code>Pin</code>; it is always
+guaranteed that input values 0.<wbr/>0 and 1.<wbr/>0 are included in the list to
+define a complete mapping.<wbr/> For input values between control points,<wbr/>
+the camera device must linearly interpolate between the control
+points.<wbr/></p>
+<p>Each curve can have an independent number of points,<wbr/> and the number
+of points can be less than max (that is,<wbr/> the request doesn't have to
+always provide a curve with number of points equivalent to
+<a href="#static_android.tonemap.maxCurvePoints">android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points</a>).<wbr/></p>
+<p>A few examples,<wbr/> and their corresponding graphical mappings; these
+only specify the red channel and the precision is limited to 4
+digits,<wbr/> for conciseness.<wbr/></p>
+<p>Linear mapping:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [ 0,<wbr/> 0,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0 ]
+</code></pre>
+<p><img alt="Linear mapping curve" src="images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png"/></p>
+<p>Invert mapping:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [ 0,<wbr/> 1.<wbr/>0,<wbr/> 1.<wbr/>0,<wbr/> 0 ]
+</code></pre>
+<p><img alt="Inverting mapping curve" src="images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png"/></p>
+<p>Gamma 1/<wbr/>2.<wbr/>2 mapping,<wbr/> with 16 control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [
+ 0.<wbr/>0000,<wbr/> 0.<wbr/>0000,<wbr/> 0.<wbr/>0667,<wbr/> 0.<wbr/>2920,<wbr/> 0.<wbr/>1333,<wbr/> 0.<wbr/>4002,<wbr/> 0.<wbr/>2000,<wbr/> 0.<wbr/>4812,<wbr/>
+ 0.<wbr/>2667,<wbr/> 0.<wbr/>5484,<wbr/> 0.<wbr/>3333,<wbr/> 0.<wbr/>6069,<wbr/> 0.<wbr/>4000,<wbr/> 0.<wbr/>6594,<wbr/> 0.<wbr/>4667,<wbr/> 0.<wbr/>7072,<wbr/>
+ 0.<wbr/>5333,<wbr/> 0.<wbr/>7515,<wbr/> 0.<wbr/>6000,<wbr/> 0.<wbr/>7928,<wbr/> 0.<wbr/>6667,<wbr/> 0.<wbr/>8317,<wbr/> 0.<wbr/>7333,<wbr/> 0.<wbr/>8685,<wbr/>
+ 0.<wbr/>8000,<wbr/> 0.<wbr/>9035,<wbr/> 0.<wbr/>8667,<wbr/> 0.<wbr/>9370,<wbr/> 0.<wbr/>9333,<wbr/> 0.<wbr/>9691,<wbr/> 1.<wbr/>0000,<wbr/> 1.<wbr/>0000 ]
+</code></pre>
+<p><img alt="Gamma = 1/2.2 tonemapping curve" src="images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png"/></p>
+<p>Standard sRGB gamma mapping,<wbr/> per IEC 61966-2-1:1999,<wbr/> with 16 control points:</p>
+<pre><code><a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a> = [
+ 0.<wbr/>0000,<wbr/> 0.<wbr/>0000,<wbr/> 0.<wbr/>0667,<wbr/> 0.<wbr/>2864,<wbr/> 0.<wbr/>1333,<wbr/> 0.<wbr/>4007,<wbr/> 0.<wbr/>2000,<wbr/> 0.<wbr/>4845,<wbr/>
+ 0.<wbr/>2667,<wbr/> 0.<wbr/>5532,<wbr/> 0.<wbr/>3333,<wbr/> 0.<wbr/>6125,<wbr/> 0.<wbr/>4000,<wbr/> 0.<wbr/>6652,<wbr/> 0.<wbr/>4667,<wbr/> 0.<wbr/>7130,<wbr/>
+ 0.<wbr/>5333,<wbr/> 0.<wbr/>7569,<wbr/> 0.<wbr/>6000,<wbr/> 0.<wbr/>7977,<wbr/> 0.<wbr/>6667,<wbr/> 0.<wbr/>8360,<wbr/> 0.<wbr/>7333,<wbr/> 0.<wbr/>8721,<wbr/>
+ 0.<wbr/>8000,<wbr/> 0.<wbr/>9063,<wbr/> 0.<wbr/>8667,<wbr/> 0.<wbr/>9389,<wbr/> 0.<wbr/>9333,<wbr/> 0.<wbr/>9701,<wbr/> 1.<wbr/>0000,<wbr/> 1.<wbr/>0000 ]
+</code></pre>
+<p><img alt="sRGB tonemapping curve" src="images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png"/></p>
</td>
</tr>
+ <tr class="entries_header">
+ <th class="th_details" colspan="5">HAL Implementation Details</th>
+ </tr>
+ <tr class="entry_cont">
+ <td class="entry_details" colspan="5">
+ <p>For good quality of mapping,<wbr/> at least 128 control points are
+preferred.<wbr/></p>
+<p>A typical use case of this would be a gamma-1/<wbr/>2.<wbr/>2 curve,<wbr/> with as many
+control points used as are available.<wbr/></p>
+ </td>
+ </tr>
<tr class="entry_spacer"><td class="entry_spacer" colspan="6"></td></tr>
<!-- end of entry -->
<tr class="entry" id="dynamic_android.tonemap.mode">
- <td class="entry_name" rowspan="1">
+ <td class="entry_name" rowspan="3">
android.<wbr/>tonemap.<wbr/>mode
</td>
<td class="entry_type">
@@ -13614,23 +13774,30 @@
<li>
<span class="entry_type_enum_name">CONTRAST_CURVE</span>
<span class="entry_type_enum_notes"><p>Use the tone mapping curve specified in
-android.<wbr/>tonemap.<wbr/>curve</p></span>
+android.<wbr/>tonemap.<wbr/>curve.<wbr/></p>
+<p>All color enhancement and tonemapping must be disabled,<wbr/> except
+for applying the tonemapping curve specified by
+<a href="#controls_android.tonemap.curveRed">android.<wbr/>tonemap.<wbr/>curve<wbr/>Red</a>,<wbr/> <a href="#controls_android.tonemap.curveBlue">android.<wbr/>tonemap.<wbr/>curve<wbr/>Blue</a>,<wbr/> or
+<a href="#controls_android.tonemap.curveGreen">android.<wbr/>tonemap.<wbr/>curve<wbr/>Green</a>.<wbr/></p>
+<p>Must not slow down frame rate relative to raw
+sensor output.<wbr/></p></span>
</li>
<li>
<span class="entry_type_enum_name">FAST</span>
- <span class="entry_type_enum_notes"><p>Must not slow down frame rate relative to raw
-bayer output</p></span>
+ <span class="entry_type_enum_notes"><p>Advanced gamma mapping and color enhancement may be applied.<wbr/></p>
+<p>Should not slow down frame rate relative to raw sensor output.<wbr/></p></span>
</li>
<li>
<span class="entry_type_enum_name">HIGH_QUALITY</span>
- <span class="entry_type_enum_notes"><p>Frame rate may be reduced by high
-quality</p></span>
+ <span class="entry_type_enum_notes"><p>Advanced gamma mapping and color enhancement may be applied.<wbr/></p>
+<p>May slow down frame rate relative to raw sensor output.<wbr/></p></span>
</li>
</ul>
</td> <!-- entry_type -->
<td class="entry_description">
+ <p>High-level global contrast/<wbr/>gamma/<wbr/>tonemapping control.<wbr/></p>
</td>
<td class="entry_units">