1#![warn(missing_docs)]
23#![warn(clippy::all)]
24#![warn(clippy::pedantic)]
25#![allow(clippy::module_name_repetitions)]
26
27pub mod color;
28pub mod geometry;
29pub mod matrix44;
30pub mod pixel;
31pub mod region;
32
33pub use color::{
35 AlphaType, Color, Color4f, ColorFilterFlags, ColorGamut, ColorSpace, ColorType, IccColorSpace,
36 IccPcs, IccProfile, IccProfileClass, TransferFunction, color_to_linear, color4f_linear_to_srgb,
37 color4f_srgb_to_linear, contrast_ratio, hsl_to_rgb, hsv_to_rgb, lab_to_rgb, linear_to_color,
38 linear_to_srgb, luminance, mix_colors, premultiply_color, rgb_to_hsl, rgb_to_hsv, rgb_to_lab,
39 rgb_to_xyz, srgb_to_linear, unpremultiply_color, xyz_to_rgb,
40};
41pub use geometry::{Corner, IPoint, IRect, ISize, Matrix, Point, Point3, RRect, Rect, Size};
42pub use matrix44::Matrix44;
43pub use pixel::{
44 Bitmap, ImageInfo, PixelError, PixelGeometry, Pixmap, SurfaceProps, SurfacePropsFlags,
45 convert_pixels, premultiply_in_place, swizzle_rb_in_place, unpremultiply_in_place,
46};
47pub use region::{Region, RegionOp};
48
49pub type Scalar = f32;
54
55pub trait AsScalar {
57 fn as_scalar(self) -> Scalar;
59}
60
61impl AsScalar for f32 {
62 #[inline]
63 fn as_scalar(self) -> Scalar {
64 self
65 }
66}
67
68impl AsScalar for f64 {
69 #[inline]
70 fn as_scalar(self) -> Scalar {
71 self as Scalar
72 }
73}
74
75impl AsScalar for i32 {
76 #[inline]
77 fn as_scalar(self) -> Scalar {
78 self as Scalar
79 }
80}
81
82pub mod prelude {
84 pub use crate::color::{
85 AlphaType, Color, Color4f, ColorSpace, ColorType, hsl_to_rgb, hsv_to_rgb, linear_to_srgb,
86 luminance, mix_colors, premultiply_color, rgb_to_hsl, rgb_to_hsv, srgb_to_linear,
87 unpremultiply_color,
88 };
89 pub use crate::geometry::{
90 Corner, IPoint, IRect, ISize, Matrix, Point, Point3, RRect, Rect, Size,
91 };
92 pub use crate::matrix44::Matrix44;
93 pub use crate::pixel::{Bitmap, ImageInfo, PixelGeometry, Pixmap, SurfaceProps};
94 pub use crate::region::{Region, RegionOp};
95 pub use crate::{AsScalar, Scalar};
96}