blob: 0c7c8a2f78677938c8572e1e059ec2ae18889f35 [file] [log] [blame]
// Copyright 2019 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.accessibility;
/// Specifies color correction mode.
enum ColorCorrectionMode {
/// No color correction.
DISABLED = 0;
/// Color correction for protanomaly (red-green -- reduced sensitivity to red light).
CORRECT_PROTANOMALY = 1;
/// Color correction for deuteranomaly (red-green -- reduced sensitivity to green light).
CORRECT_DEUTERANOMALY = 2;
/// Color correction for tritanomaly (blue-yellow -- reduced sensitivity to blue light).
CORRECT_TRITANOMALY = 3;
};
/// The current configuration for accessibility color transforms, which includes color inversion and
/// color correction. This always includes the matrix required to apply the appropriate transforms.
/// Color correction and color inversion may be active simultaneously.
table ColorTransformConfiguration {
/// When color_inversion_enabled is true, certain colors are inverted across the entire screen.
/// If this field is omitted behavior should remain unchanged.
1: bool color_inversion_enabled;
/// When color_correction is set to DISABLED, colors are displayed normally. When
/// color_correction has different value, colors are modified to correct for the specified type
/// of color blindness. If this field is omitted behavior should remain unchanged.
2: ColorCorrectionMode color_correction;
/// 3x3 Matrix in row-major form which will be used by root presenter to apply color correction
/// and color inversion, or a combination fo the two. This field should always be set.
3: array<float32>:9 color_adjustment_matrix;
};
/// Handler implemented by the owner of the presentation. Accessibility manager uses this protocol
/// to make changes to the screen's color transform.
protocol ColorTransformHandler {
/// Called when the color transform configuration has changed.
SetColorTransformConfiguration(ColorTransformConfiguration configuration) -> ();
};
/// Allows a presentation owner to register a handler for color transforms. This API is implemented
/// by the Accessibility manager and called by Root Presenter.
[Discoverable]
protocol ColorTransform {
/// Registers a handler for changes in the color transform configuration.
RegisterColorTransformHandler(ColorTransformHandler handler);
};