Move image/svg handling into iced_graphics

The `TextureStore` trait is implemented by the atlas, and can also be
implemented in the glow renderer or in a software renderer.

The API here may be improved in the future, but API stability is
presumably not a huge issue since these types will only be used by
renderer backends.
This commit is contained in:
Ian Douglas Scott 2022-10-31 13:37:56 -07:00 committed by Héctor Ramón Jiménez
parent 7b12991728
commit 2c7c42ee93
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
10 changed files with 281 additions and 191 deletions

View file

@ -11,17 +11,33 @@ keywords = ["gui", "ui", "graphics", "interface", "widgets"]
categories = ["gui"]
[features]
svg = ["resvg", "usvg", "tiny-skia"]
image = ["png", "jpeg", "jpeg_rayon", "gif", "webp", "bmp"]
png = ["image_rs/png"]
jpeg = ["image_rs/jpeg"]
jpeg_rayon = ["image_rs/jpeg_rayon"]
gif = ["image_rs/gif"]
webp = ["image_rs/webp"]
pnm = ["image_rs/pnm"]
ico = ["image_rs/ico"]
bmp = ["image_rs/bmp"]
hdr = ["image_rs/hdr"]
dds = ["image_rs/dds"]
farbfeld = ["image_rs/farbfeld"]
canvas = ["lyon"]
qr_code = ["qrcode", "canvas"]
font-source = ["font-kit"]
font-fallback = []
font-icons = []
opengl = []
image_rs = ["kamadak-exif"]
[dependencies]
glam = "0.21.3"
log = "0.4"
raw-window-handle = "0.5"
thiserror = "1.0"
bitflags = "1.2"
[dependencies.bytemuck]
version = "1.4"
@ -48,6 +64,28 @@ default-features = false
version = "0.10"
optional = true
[dependencies.image_rs]
version = "0.23"
package = "image"
default-features = false
optional = true
[dependencies.resvg]
version = "0.18"
optional = true
[dependencies.usvg]
version = "0.18"
optional = true
[dependencies.tiny-skia]
version = "0.6"
optional = true
[dependencies.kamadak-exif]
version = "0.5"
optional = true
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true