#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![warn(clippy::all)]
#![allow(clippy::module_inception)]
pub use skia_rs_core as core;
pub use skia_rs_path as path;
pub use skia_rs_paint as paint;
pub use skia_rs_canvas as canvas;
pub use skia_rs_safe as safe;
#[cfg(feature = "text")]
#[cfg_attr(docsrs, doc(cfg(feature = "text")))]
pub use skia_rs_text as text;
#[cfg(feature = "codec")]
#[cfg_attr(docsrs, doc(cfg(feature = "codec")))]
pub use skia_rs_codec as codec;
#[cfg(feature = "svg")]
#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
pub use skia_rs_svg as svg;
#[cfg(feature = "pdf")]
#[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
pub use skia_rs_pdf as pdf;
#[cfg(feature = "gpu")]
#[cfg_attr(docsrs, doc(cfg(feature = "gpu")))]
pub use skia_rs_gpu as gpu;
#[cfg(feature = "skottie")]
#[cfg_attr(docsrs, doc(cfg(feature = "skottie")))]
pub use skia_rs_skottie as skottie;
#[cfg(feature = "ffi")]
#[cfg_attr(docsrs, doc(cfg(feature = "ffi")))]
pub use skia_rs_ffi as ffi;
pub mod prelude {
pub use skia_rs_core::{
AlphaType, Color, Color4f, ColorSpace, ColorType, IPoint, IRect, ISize, ImageInfo, Matrix,
Point, Rect, Scalar, Size,
};
pub use skia_rs_path::{FillType, Path, PathBuilder, PathDirection};
pub use skia_rs_paint::{BlendMode, Paint, Style};
pub use skia_rs_canvas::{Canvas, ClipOp, SaveLayerRec, Surface};
pub use skia_rs_safe::prelude::*;
#[cfg(feature = "text")]
#[cfg_attr(docsrs, doc(cfg(feature = "text")))]
pub use skia_rs_text::{Font, FontStyle, TextBlob, Typeface};
#[cfg(feature = "codec")]
#[cfg_attr(docsrs, doc(cfg(feature = "codec")))]
pub use skia_rs_codec::{ImageDecoder, ImageEncoder, ImageFormat};
#[cfg(feature = "svg")]
#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
pub use skia_rs_svg::SvgDom;
#[cfg(feature = "pdf")]
#[cfg_attr(docsrs, doc(cfg(feature = "pdf")))]
pub use skia_rs_pdf::PdfDocument;
#[cfg(feature = "gpu")]
#[cfg_attr(docsrs, doc(cfg(feature = "gpu")))]
pub use skia_rs_gpu::GpuContext;
#[cfg(feature = "skottie")]
#[cfg_attr(docsrs, doc(cfg(feature = "skottie")))]
pub use skia_rs_skottie::Animation;
}
pub mod version {
pub const MAJOR: u32 = 0;
pub const MINOR: u32 = 2;
pub const PATCH: u32 = 2;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
#[inline]
pub const fn as_tuple() -> (u32, u32, u32) {
(MAJOR, MINOR, PATCH)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_version() {
assert_eq!(version::VERSION, "0.2.2");
assert_eq!(version::as_tuple(), (0, 2, 2));
}
#[test]
fn test_core_re_export() {
let point = core::Point::new(10.0, 20.0);
assert_eq!(point.x, 10.0);
assert_eq!(point.y, 20.0);
}
#[test]
fn test_prelude_imports() {
use crate::prelude::*;
let color = Color::RED;
assert_eq!(color.red(), 255);
let rect = Rect::from_xywh(0.0, 0.0, 100.0, 100.0);
assert_eq!(rect.width(), 100.0);
}
}