| <link rel="stylesheet" href="../style.css" /> |
| |
| [TOC] |
| # fuchsia.ui.brightness |
| |
| <div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div> |
| |
| ## **PROTOCOLS** |
| |
| ## ColorAdjustmentHandler {#ColorAdjustmentHandler} |
| *Defined in [fuchsia.ui.brightness/color_adjustment.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/color_adjustment.fidl;l=10)* |
| <p>Handler implemented by the owner of the presentation. |
| The UI component that controls brightness and screen tint uses this protocol to request changes |
| to the screen's color adjustment matrix.</p> |
| |
| ### SetColorAdjustment {#ColorAdjustmentHandler.SetColorAdjustment} |
| |
| <p>Called when the color adjustment has changed.</p> |
| |
| #### Request {#ColorAdjustmentHandler.SetColorAdjustment_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>color_adjustment</code></td> |
| <td> |
| <code><a class='link' href='#ColorAdjustmentTable'>ColorAdjustmentTable</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## Control {#Control} |
| *Defined in [fuchsia.ui.brightness/brightness.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=14)* |
| <p>Control provides an interface to manage the brightness component.</p> |
| |
| ### GetMaxAbsoluteBrightness {#Control.GetMaxAbsoluteBrightness} |
| |
| <p>Gets the maximum supported backlight brightness in nits, if known.</p> |
| |
| #### Request {#Control.GetMaxAbsoluteBrightness_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Control.GetMaxAbsoluteBrightness_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>result</code></td> |
| <td> |
| <code><a class='link' href='#Control_GetMaxAbsoluteBrightness_Result'>Control_GetMaxAbsoluteBrightness_Result</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| ### SetAutoBrightness {#Control.SetAutoBrightness} |
| |
| <p>Turns the auto-brightness mode on. |
| SetManualBrightness will turn it off.</p> |
| |
| #### Request {#Control.SetAutoBrightness_Request} |
| |
| <EMPTY> |
| |
| |
| ### SetAutoBrightnessAdjustment {#Control.SetAutoBrightnessAdjustment} |
| |
| <p>Sets the brightness adjustment. |
| This will change the brightness curve by the factor of the adjustment. |
| The adjustment is in the range of -1.0 to 1.0.</p> |
| |
| #### Request {#Control.SetAutoBrightnessAdjustment_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>adjustment</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SetBrightnessTable {#Control.SetBrightnessTable} |
| |
| <p>Sets the brightness curve as a set of points. |
| This will override the built-in brightness curve. |
| The default brightness curve will be used if the table is empty. |
| The connection will be closed if table errors are detected.</p> |
| |
| #### Request {#Control.SetBrightnessTable_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>table</code></td> |
| <td> |
| <code><a class='link' href='#BrightnessTable'>BrightnessTable</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SetManualBrightness {#Control.SetManualBrightness} |
| |
| <p>Turns auto-brightness mode off. |
| Used by e.g. Settings to set manual brightness using a slider |
| Value is in the range 0.0 to 1.0 representing min to max and |
| will be clamped if out of range.</p> |
| |
| #### Request {#Control.SetManualBrightness_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>value</code></td> |
| <td> |
| <code><a class='link' href='#brightness'>brightness</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### SetManualBrightnessSmooth {#Control.SetManualBrightnessSmooth} |
| |
| <p>Set manual brightness specifying the duration over which the |
| target brightness will be set.</p> |
| |
| #### Request {#Control.SetManualBrightnessSmooth_Request} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>value</code></td> |
| <td> |
| <code><a class='link' href='#brightness'>brightness</a></code> |
| </td> |
| </tr> |
| <tr> |
| <td><code>duration</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#duration'>duration</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ### WatchAutoBrightness {#Control.WatchAutoBrightness} |
| |
| <p>Requests the current auto-brightness mode. |
| This call implements the Hanging Get protocol.</p> |
| |
| #### Request {#Control.WatchAutoBrightness_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Control.WatchAutoBrightness_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>enabled</code></td> |
| <td> |
| <code>bool</code> |
| </td> |
| </tr> |
| </table> |
| |
| ### WatchAutoBrightnessAdjustment {#Control.WatchAutoBrightnessAdjustment} |
| |
| <p>Gets the current auto brightness adjustment. |
| This call implements the Hanging Get protocol.</p> |
| |
| #### Request {#Control.WatchAutoBrightnessAdjustment_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Control.WatchAutoBrightnessAdjustment_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>adjustment</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| </tr> |
| </table> |
| |
| ### WatchCurrentBrightness {#Control.WatchCurrentBrightness} |
| |
| <p>Gets the current brightness in the range 0.0 to 1.0. |
| This result is valid for both manual and auto-brightness modes |
| and is typically used to show the current brightness on a slider. |
| This call implements the Hanging Get protocol.</p> |
| |
| #### Request {#Control.WatchCurrentBrightness_Request} |
| |
| <EMPTY> |
| |
| |
| #### Response {#Control.WatchCurrentBrightness_Response} |
| |
| <table> |
| <tr><th>Name</th><th>Type</th></tr> |
| <tr> |
| <td><code>value</code></td> |
| <td> |
| <code><a class='link' href='#brightness'>brightness</a></code> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **STRUCTS** |
| |
| ### BrightnessPoint {#BrightnessPoint data-text="BrightnessPoint"} |
| *Defined in [fuchsia.ui.brightness/brightness.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=77)* |
| <p>A tuple representing a point on the auto-brightness curve |
| Ambient_lux and nits must be positive values.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="BrightnessPoint.ambient_lux"> |
| <td><code>ambient_lux</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| <tr id="BrightnessPoint.display_nits"> |
| <td><code>display_nits</code></td> |
| <td> |
| <code>float32</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### BrightnessTable {#BrightnessTable data-text="BrightnessTable"} |
| *Defined in [fuchsia.ui.brightness/brightness.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=84)* |
| <p>A set of points defining the auto-brightness curve. |
| The ambient_lux values must be monotonically increasing.</p> |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="BrightnessTable.points"> |
| <td><code>points</code></td> |
| <td> |
| <code>vector<<a class='link' href='#BrightnessPoint'>BrightnessPoint</a>>[50]</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| ### Control_GetMaxAbsoluteBrightness_Response {#Control_GetMaxAbsoluteBrightness_Response data-text="Control_GetMaxAbsoluteBrightness_Response"} |
| *Defined in [fuchsia.ui.brightness/brightness.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=70)* |
| |
| <table> |
| <tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr> |
| <tr id="Control_GetMaxAbsoluteBrightness_Response.max_brightness"> |
| <td><code>max_brightness</code></td> |
| <td> |
| <code>float64</code> |
| </td> |
| <td></td> |
| <td>No default</td> |
| </tr> |
| </table> |
| |
| |
| |
| ## **TABLES** |
| |
| ### ColorAdjustmentTable {#ColorAdjustmentTable data-text="ColorAdjustmentTable"} |
| |
| |
| *Defined in [fuchsia.ui.brightness/color_adjustment.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/color_adjustment.fidl;l=18)* |
| <p>The table for screen color tint adjustments.</p> |
| |
| <table> |
| <tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr> |
| <tr id="ColorAdjustmentTable.matrix"> |
| <td><h3 id="ColorAdjustmentTable.matrix" class="add-link hide-from-toc">1</h3></td> |
| <td><code>matrix</code></td> |
| <td> |
| <code>float32[9]</code> |
| </td> |
| <td><p>3x3 Matrix in row-major form which will be used by root presenter |
| to apply color adjustment. |
| This field may be omitted to disable color adjustment.</p> |
| </td> |
| </tr> |
| </table> |
| |
| |
| ## **UNIONS** |
| |
| ### Control_GetMaxAbsoluteBrightness_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Control_GetMaxAbsoluteBrightness_Result data-text="Control_GetMaxAbsoluteBrightness_Result"} |
| *Defined in [fuchsia.ui.brightness/brightness.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=70)* |
| <table> |
| <tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr> |
| <tr id="Control_GetMaxAbsoluteBrightness_Result.response"> |
| <td><h3 id="Control_GetMaxAbsoluteBrightness_Result.response" class="add-link hide-from-toc">1</h3></td> |
| <td><code>response</code></td> |
| <td> |
| <code><a class='link' href='#Control_GetMaxAbsoluteBrightness_Response'>Control_GetMaxAbsoluteBrightness_Response</a></code> |
| </td> |
| <td></td> |
| </tr> |
| <tr id="Control_GetMaxAbsoluteBrightness_Result.err"> |
| <td><h3 id="Control_GetMaxAbsoluteBrightness_Result.err" class="add-link hide-from-toc">2</h3></td> |
| <td><code>err</code></td> |
| <td> |
| <code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code> |
| </td> |
| <td></td> |
| </tr> |
| </table> |
| |
| |
| |
| |
| ## **TYPE ALIASES** |
| |
| <table> |
| <tr><th>Name</th><th>Value</th><th>Description</th></tr> |
| <tr id="brightness"> |
| <td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.ui.brightness/brightness.fidl;l=10">brightness</a></td> |
| <td> |
| <code>float32</code></td> |
| <td><p>A normalized relative brightness adjustment in the range |
| 0.0 (off/minimum) to 1.0 (maximum).</p> |
| </td> |
| </tr> |
| </table> |