blob: c8c69891b677a698d36cac9549ec4d98cd44a153 [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.
type ColorCorrectionMode = strict enum {
/// 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.
///
/// For original RGB value (r, g, b) (each component ranged between 0 and 1), the RGB value of
/// corrected color (r', g', b') is
/// (r', g', b') = color_adjustment_post_offset
/// + color_adjustment_matrix . ((r, g, b) + color_adjustment_pre_offset).
type ColorTransformConfiguration = table {
/// When color_inversion_enabled is true, certain colors are inverted across the entire screen.
/// If this field is omitted behavior should remain unchanged.
1: color_inversion_enabled bool;
/// 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: color_correction ColorCorrectionMode;
/// 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: color_adjustment_matrix array<float32, 9>;
/// 3x1 vector which is used by root presenter as an offset added to the original RGB color,
/// before it multiplies with the |color_adjustment_matrix|. This field should always be set.
4: color_adjustment_pre_offset array<float32, 3>;
/// 3x1 vector which is used by root presenter as an offset added to the multiplied result
/// of |color_adjustment_matrix| and original RGB color. This field should always be set.
5: color_adjustment_post_offset array<float32, 3>;
};
/// 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(struct {
configuration ColorTransformConfiguration;
}) -> ();
};
/// 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(resource struct {
handler client_end:ColorTransformHandler;
});
};