decoder: Add basic color profile support

This only covers 8bit RGB(A) JPEG, PNG, and HEIF.
Should only be a temporary solution until GTK supports
color profiles.

Closes #36

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/172>
This commit is contained in:
Sophie Herold 2023-04-12 04:13:30 +02:00
parent 3b6cc8c404
commit e710419a22
6 changed files with 186 additions and 23 deletions

69
Cargo.lock generated
View file

@ -397,6 +397,9 @@ name = "cc"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
dependencies = [
"jobserver",
]
[[package]]
name = "cfg-expr"
@ -755,6 +758,12 @@ dependencies = [
"dtoa",
]
[[package]]
name = "dunce"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c"
[[package]]
name = "either"
version = "1.8.1"
@ -973,6 +982,33 @@ dependencies = [
"spin",
]
[[package]]
name = "foreign-types"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
dependencies = [
"foreign-types-macros",
"foreign-types-shared",
]
[[package]]
name = "foreign-types-macros"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.15",
]
[[package]]
name = "foreign-types-shared"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "form_urlencoded"
version = "1.1.0"
@ -1677,6 +1713,15 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "jobserver"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2"
dependencies = [
"libc",
]
[[package]]
name = "jpeg-decoder"
version = "0.3.0"
@ -1725,6 +1770,28 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lcms2"
version = "5.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d50a4d00d909da0ec023ab34ea09bf3b3b79b5a36b3e0da3a305112edaf150"
dependencies = [
"foreign-types",
"lcms2-sys",
]
[[package]]
name = "lcms2-sys"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abb8aac1a07fd8cdffaa25461a3873a7bf7164cd20b849d44a183a1348d682f"
dependencies = [
"cc",
"dunce",
"libc",
"pkg-config",
]
[[package]]
name = "lebe"
version = "0.5.2"
@ -1911,12 +1978,14 @@ dependencies = [
"image",
"indexmap",
"kamadak-exif",
"lcms2",
"libadwaita",
"libgweather",
"libheif-rs",
"librsvg",
"log",
"once_cell",
"rgb",
"safe-transmute",
"url",
]