cmm: store render intent
This commit is contained in:
parent
a4928d8ed6
commit
dca0df2555
16 changed files with 207 additions and 60 deletions
29
src/cmm/cmm_render_intent.rs
Normal file
29
src/cmm/cmm_render_intent.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use crate::{ifs::color_management::RENDER_INTENT_PERCEPTUAL, object::Version};
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Default)]
|
||||
pub enum RenderIntent {
|
||||
#[default]
|
||||
Perceptual,
|
||||
}
|
||||
|
||||
impl RenderIntent {
|
||||
pub fn from_wayland(intent: u32, _version: Version) -> Option<Self> {
|
||||
let res = match intent {
|
||||
RENDER_INTENT_PERCEPTUAL => Self::Perceptual,
|
||||
_ => return None,
|
||||
};
|
||||
Some(res)
|
||||
}
|
||||
|
||||
pub fn black_point_compensation(self) -> bool {
|
||||
match self {
|
||||
RenderIntent::Perceptual => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bradford_adjustment(self) -> bool {
|
||||
match self {
|
||||
RenderIntent::Perceptual => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue