| // Copyright 2018 The Fuchsia Authors. All rights reserved. | 
 | // Use of this source code is governed by a BSD-style license that can be | 
 | // found in the LICENSE file. | 
 | library fuchsia.hardware.backlight; | 
 | using zx; | 
 |  | 
 | type State = struct { | 
 |     backlight_on bool; | 
 |     /// `brightness` can either be: | 
 |     /// 1. The unitless brightness value on a linear scale where 0.0 is the minimum | 
 |     ///    brightness and 1.0 is the maximum brightness - represents the current / | 
 |     ///    desired brightness as a percentage within the supported range. Used | 
 |     ///    by the `GetStateNormalized` / `SetStateNormalized` calls. The maximum | 
 |     ///    brightness that can be set using `SetStateNormalized` is | 
 |     ///    GetBrightnessScale() * GetMaxAbsoluteBrightness(). | 
 |     /// 2. Absolute brightness in nits. Used by the `GetStateAbsolute` / | 
 |     ///    `SetStateAbsolute` calls. | 
 |     brightness float64; | 
 | }; | 
 |  | 
 | protocol Device { | 
 |     /// Gets the current backlight brightness as a percentage value between 0.0 | 
 |     /// and 1.0 | 
 |     GetStateNormalized() -> (struct { | 
 |         state State; | 
 |     }) error zx.status; | 
 |  | 
 |     /// Sets the current backlight brightness as a percentage value between 0.0 | 
 |     /// and 1.0 | 
 |     SetStateNormalized(struct { | 
 |         state State; | 
 |     }) -> (struct {}) error zx.status; | 
 |  | 
 |     /// Gets the current backlight brightness in nits | 
 |     GetStateAbsolute() -> (struct { | 
 |         state State; | 
 |     }) error zx.status; | 
 |  | 
 |     /// Sets the current backlight brightness in nits. Not affected by the scale | 
 |     /// set by SetNormalizedBrightnessScale. | 
 |     SetStateAbsolute(struct { | 
 |         state State; | 
 |     }) -> (struct {}) error zx.status; | 
 |  | 
 |     /// Gets the maximum supported backlight brightness in nits, if known. | 
 |     /// Otherwise returns error ZX_ERR_NOT_SUPPORTED. | 
 |     GetMaxAbsoluteBrightness() -> (struct { | 
 |         max_brightness float64; | 
 |     }) error zx.status; | 
 |  | 
 |     /// Scales the maximum normalized brightness by a percentage value in | 
 |     /// [0.0, 1.0], if supported. Otherwise returns error ZX_ERR_NOT_SUPPORTED. | 
 |     /// Values passed to SetStateNormalized will correspond to a maximum | 
 |     /// brightness of scale * GetMaxAbsoluteBrightness(). Calling this may | 
 |     /// change the current absolute brightness. | 
 |     SetNormalizedBrightnessScale(struct { | 
 |         scale float64; | 
 |     }) -> (struct {}) error zx.status; | 
 |  | 
 |     /// Gets the current normalized brightness scale as a percentage value in | 
 |     /// [0.0, 1.0]. | 
 |     GetNormalizedBrightnessScale() -> (struct { | 
 |         scale float64; | 
 |     }) error zx.status; | 
 | }; |