1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Image URL types for web rendering.
//!
//! Image drawables ([`cotis_defaults::render_commands::Image`]) require an associated type that
//! implements [`URLImage`]. The renderer uses [`URLImage::url`] to set CSS
//! `background-image: url("...")`.
//!
//! [`URLImageEnum`] is the usual choice for [`ElementConfig`](cotis_defaults::element_configs::ElementConfig)
//! image type parameters in WASM apps.
//!
//! # Path conventions
//!
//! URLs are passed to the browser as-is. Use paths relative to the page origin (e.g.
//! `"assets/logo.png"`) or absolute URLs. The renderer does not prepend
//! [`HTMLRenderer::new`](crate::renderer::HTMLRenderer::new)'s stored origin automatically today.
//!
//! # API status
//!
//! The image URL API is **incomplete** (`// TODO Finish this` in source). Current behavior
//! delegates to `get_path()` on [`PNGImage`],
//! [`JPEGImage`], and
//! [`SVGImage`]. Blob URLs, data URLs, and async
//! loading are not yet handled.
use ;
/// Types that can provide a URL string for CSS `background-image`.
/// Sum type over the standard Cotis image formats for web apps.