1#![forbid(unsafe_code)]
7#![doc = "2D graphics foundation types for rpdfium — a faithful Rust port of PDFium."]
8pub mod cfx_color;
18pub mod cfx_dibitmap;
19pub mod cfx_path;
20pub mod cfx_textrenderoptions;
21pub mod clip;
22
23pub use cfx_color::{BlendMode, Color, ColorSpaceFamily};
25pub use cfx_dibitmap::{Bitmap, BitmapFormat};
26pub use cfx_path::{
27 DashPattern, FillRule, LineCapStyle, LineJoinStyle, PathOp, PathStyle, bounding_box,
28 bounding_box_for_stroke_path, get_bounding_box, get_bounding_box_for_stroke_path, get_rect,
29 is_rect, rect_if_axis_aligned,
30};
31pub use cfx_textrenderoptions::TextRenderingMode;
32pub use clip::ClipPath;
33
34#[derive(Debug, Clone, PartialEq, Eq, Hash)]
39pub struct ImageRef {
40 pub object_id: rpdfium_core::ObjectId,
42}
43
44#[cfg(test)]
45mod tests {
46 use super::*;
47
48 #[test]
49 fn test_all_types_accessible() {
50 let _ = PathOp::Close;
51 let _ = FillRule::default();
52 let _ = LineCapStyle::default();
53 let _ = LineJoinStyle::default();
54 let _ = DashPattern::default();
55 let _ = PathStyle::default();
56 let _ = BlendMode::default();
57 let _ = Color::default();
58 let _ = ColorSpaceFamily::DeviceRGB;
59 let _ = TextRenderingMode::default();
60 let _ = ClipPath::default();
61 let _ = BitmapFormat::Rgba32;
62 }
63
64 #[test]
65 fn test_types_are_send_sync() {
66 fn assert_send_sync<T: Send + Sync>() {}
67 assert_send_sync::<PathOp>();
68 assert_send_sync::<PathStyle>();
69 assert_send_sync::<BlendMode>();
70 assert_send_sync::<Color>();
71 assert_send_sync::<TextRenderingMode>();
72 assert_send_sync::<ClipPath>();
73 assert_send_sync::<Bitmap>();
74 assert_send_sync::<ImageRef>();
75 }
76
77 #[test]
78 fn test_image_ref_equality() {
79 let a = ImageRef {
80 object_id: rpdfium_core::ObjectId {
81 number: 1,
82 generation: 0,
83 },
84 };
85 let b = a.clone();
86 assert_eq!(a, b);
87 }
88}