ICC: Implement Profile::to_pcs() for grayscale colors
There's probably a nicer way of doing this where we don't need to expand the gray value into a full Vector3, but for now this is good enough. Makes PDFs written by macOS 13.5.2's "Save as PDF..." feature show up.
This commit is contained in:
parent
6b4da8680d
commit
563bb9d20c
Notes:
sideshowbarker
2024-07-16 23:13:25 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/563bb9d20c Pull-request: https://github.com/SerenityOS/serenity/pull/21257 Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 5 additions and 2 deletions
|
@ -1437,9 +1437,12 @@ ErrorOr<FloatVector3> Profile::to_pcs(ReadonlyBytes color) const
|
|||
};
|
||||
|
||||
if (data_color_space() == ColorSpace::Gray) {
|
||||
VERIFY(color.size() == 1); // True because of color.size() check further up.
|
||||
|
||||
// ICC v4, F.2 grayTRCTag
|
||||
// FIXME
|
||||
return Error::from_string_literal("ICC::Profile::to_pcs: Gray handling not yet implemented");
|
||||
// "connection = grayTRC[device]"
|
||||
float gray = evaluate_curve(grayTRCTag, color[0] / 255.f);
|
||||
return FloatVector3 { gray, gray, gray };
|
||||
}
|
||||
|
||||
// FIXME: Per ICC v4, A.1 General, this should also handle HLS, HSV, YCbCr.
|
||||
|
|
Loading…
Add table
Reference in a new issue