Skip to content

Commit

Permalink
color_management: update protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Oct 26, 2023
1 parent 0f1d6c8 commit d4b8fdd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions protocols/color-management-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@
if not explicitly set:
- mastering display primaries and white point (target color volume)
- mastering luminance range
- maxCLL
- maxFALL
- maximum content light level
- maximum frame-average light level

Each required property must be set exactly once if the client is to create
an image description. The set requests verify that a property was not
Expand Down Expand Up @@ -743,35 +743,35 @@
<arg name="max_lum" type="uint" summary="max L (cd/m²)"/>
</request>

<request name="set_maxCLL">
<request name="set_max_cll">
<description summary="maximum content light level">
Sets the maximum content light level (maxCLL) as defined by CTA-861-H.
Sets the maximum content light level (max_cll) as defined by CTA-861-H.

This can only be set when set_tf_cicp is used to set the transfer
characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system.
Otherwise, 'create' request shall raise inconsistent_set protocol
error.

MaxCLL is undefined by default.
max_cll is undefined by default.
</description>

<arg name="maxCLL" type="uint" summary="maxCLL (cd/m²)"/>
<arg name="max_cll" type="uint" summary="Maximum content light level (cd/m²)"/>
</request>

<request name="set_maxFALL">
<request name="set_max_fall">
<description summary="maximum frame-average light level">
Sets the maximum frame-average light level (maxFALL) as defined by
Sets the maximum frame-average light level (max_fall) as defined by
CTA-861-H.

This can only be set when set_tf_cicp is used to set the transfer
characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system.
Otherwise, 'create' request shall raise inconsistent_set protocol
error.

MaxFALL is undefined by default.
max_fall is undefined by default.
</description>

<arg name="maxFALL" type="uint" summary="maxFALL (cd/m²)"/>
<arg name="max_fall" type="uint" summary="Maximum frame-average light level (cd/m²)"/>
</request>
</interface>

Expand Down Expand Up @@ -1024,32 +1024,32 @@
<arg name="max_lum" type="uint" summary="max L (cd/m²)"/>
</event>

<event name="target_maxCLL">
<event name="target_max_cll">
<description summary="target maximum content light level">
This is an information event, see get_information.

Provides the targeted maxCLL of the image description. MaxCLL is
Provides the targeted max_cll of the image description. max_cll is
defined by CTA-861-H.

This luminance is only theoretical and may not correspond to the
luminance of light emitted on an actual display.
</description>

<arg name="maxCLL" type="uint" summary="maxCLL (cd/m²)"/>
<arg name="max_cll" type="uint" summary="Maximum content light-level (cd/m²)"/>
</event>

<event name="target_maxFALL">
<event name="target_max_fall">
<description summary="target maximum frame-average light level">
This is an information event, see get_information.

Provides the targeted maxFALL of the image description. MaxFALL is
Provides the targeted max_fall of the image description. max_fall is
defined by CTA-861-H.

This luminance is only theoretical and may not correspond to the
luminance of light emitted on an actual display.
</description>

<arg name="maxFALL" type="uint" summary="maxFALL (cd/m²)"/>
<arg name="max_fall" type="uint" summary="Maximum frame-average light level (cd/m²)"/>
</event>
</interface>
</protocol>
12 changes: 6 additions & 6 deletions src/wayland/color/management/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ where
}
}
if let Some(max_ccl) = max_ccl {
resource.target_maxCLL(*max_ccl);
resource.target_max_cll(*max_ccl);
}
if let Some(max_fall) = max_fall {
resource.target_maxFALL(*max_fall);
resource.target_max_fall(*max_fall);
}
}
}
Expand Down Expand Up @@ -854,7 +854,7 @@ where
return;
}
}
wp_image_description_creator_params_v1::Request::SetMaxCLL { maxCLL } => {
wp_image_description_creator_params_v1::Request::SetMaxCll { max_cll } => {
let mut data_guard = data.lock().unwrap();
let Some(data) = data_guard.as_mut() else {
resource.post_error(wp_image_description_creator_params_v1::Error::AlreadyUsed, "Creator was already used");
Expand All @@ -871,15 +871,15 @@ where
return;
}

if data.set_max_cll(maxCLL) {
if data.set_max_cll(max_cll) {
resource.post_error(
wp_image_description_creator_params_v1::Error::AlreadySet,
"Max CCL was already set",
);
return;
}
}
wp_image_description_creator_params_v1::Request::SetMaxFALL { maxFALL } => {
wp_image_description_creator_params_v1::Request::SetMaxFall { max_fall } => {
let mut data_guard = data.lock().unwrap();
let Some(data) = data_guard.as_mut() else {
resource.post_error(wp_image_description_creator_params_v1::Error::AlreadyUsed, "Creator was already used");
Expand All @@ -896,7 +896,7 @@ where
return;
}

if data.set_max_fall(maxFALL) {
if data.set_max_fall(max_fall) {
resource.post_error(
wp_image_description_creator_params_v1::Error::AlreadySet,
"Max CCL was already set",
Expand Down

0 comments on commit d4b8fdd

Please sign in to comment.