1
0
Fork 0
forked from wry/wry

color-management: use more consistent naming

This commit is contained in:
Julian Orth 2025-09-05 13:45:09 +02:00
parent 32db933242
commit 83e79b68e6
65 changed files with 439 additions and 510 deletions

View file

@ -1,6 +1,6 @@
use {
crate::{
cmm::cmm_transfer_function::TransferFunction,
cmm::cmm_eotf::Eotf,
format::ARGB8888,
gfx_api::{GfxContext, GfxTexture},
pango::{
@ -79,7 +79,7 @@ pub fn render(
let data = create_data(font, width, height, scale)?;
data.layout.set_text(text);
let font_height = data.layout.pixel_size().1;
let [r, g, b, a] = color.to_array(TransferFunction::Gamma22);
let [r, g, b, a] = color.to_array(Eotf::Gamma22);
data.cctx.set_operator(CAIRO_OPERATOR_SOURCE);
data.cctx.set_source_rgba(r as _, g as _, b as _, a as _);
let y = y.unwrap_or((height - font_height) / 2);

View file

@ -192,7 +192,7 @@ impl GuiElement for Button {
}
fn render_at(&self, color_manager: &ColorManager, r: &mut RendererBase, x1: f32, y1: f32) {
let srgb_srgb = color_manager.srgb_srgb();
let srgb_srgb = color_manager.srgb_gamma22();
let srgb = &srgb_srgb.linear;
let x2 = x1 + self.data.width.get();
let y2 = y1 + self.data.height.get();
@ -331,7 +331,7 @@ impl GuiElement for Label {
AcquireSync::None,
ReleaseSync::None,
false,
color_manager.srgb_srgb(),
color_manager.srgb_gamma22(),
);
}
}
@ -644,10 +644,10 @@ impl WindowData {
let res = buf.fb.render_custom(
AcquireSync::Implicit,
ReleaseSync::Implicit,
self.dpy.state.color_manager.srgb_srgb(),
self.dpy.state.color_manager.srgb_gamma22(),
self.scale.get(),
Some(&Color::from_gray_srgb(0)),
&self.dpy.state.color_manager.srgb_srgb().linear,
&self.dpy.state.color_manager.srgb_gamma22().linear,
None,
self.dpy.state.color_manager.srgb_linear(),
&mut |r| {