cmm: add support for relative_bpc intent
This commit is contained in:
parent
dca0df2555
commit
4d5675916b
2 changed files with 11 additions and 2 deletions
|
|
@ -1,15 +1,20 @@
|
|||
use crate::{ifs::color_management::RENDER_INTENT_PERCEPTUAL, object::Version};
|
||||
use crate::{
|
||||
ifs::color_management::{RENDER_INTENT_PERCEPTUAL, RENDER_INTENT_RELATIVE_BPC},
|
||||
object::Version,
|
||||
};
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Default)]
|
||||
pub enum RenderIntent {
|
||||
#[default]
|
||||
Perceptual,
|
||||
RelativeBpc,
|
||||
}
|
||||
|
||||
impl RenderIntent {
|
||||
pub fn from_wayland(intent: u32, _version: Version) -> Option<Self> {
|
||||
let res = match intent {
|
||||
RENDER_INTENT_PERCEPTUAL => Self::Perceptual,
|
||||
RENDER_INTENT_RELATIVE_BPC => Self::RelativeBpc,
|
||||
_ => return None,
|
||||
};
|
||||
Some(res)
|
||||
|
|
@ -18,12 +23,14 @@ impl RenderIntent {
|
|||
pub fn black_point_compensation(self) -> bool {
|
||||
match self {
|
||||
RenderIntent::Perceptual => true,
|
||||
RenderIntent::RelativeBpc => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bradford_adjustment(self) -> bool {
|
||||
match self {
|
||||
RenderIntent::Perceptual => true,
|
||||
RenderIntent::RelativeBpc => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue