1mod alpha_type;
7mod annotation;
8pub mod arc;
9mod bbh_factory;
10mod bitmap;
11mod blend_mode;
12mod blender;
13mod blur_types;
14pub mod canvas;
15mod clip_op;
16mod color;
17pub mod color_filter;
18mod color_space;
19mod color_table;
20mod color_type;
21pub mod contour_measure;
22mod coverage_mode;
23mod cpu_recorder;
24mod cubic_map;
25mod data;
26mod data_table;
27pub mod document;
28pub mod drawable;
29mod flattenable;
30pub mod font;
31pub mod font_arguments;
32pub mod font_metrics;
33mod font_mgr;
34pub mod font_parameters;
35mod font_scanner;
36pub mod font_style;
37mod font_types;
38mod four_byte_tag;
39pub mod graphics;
40pub mod image;
41pub mod image_filter;
42mod image_generator;
43mod image_info;
44mod m44;
45mod mask_filter;
46pub mod matrix;
47mod mesh;
48mod milestone;
49pub mod paint;
50pub mod path;
51mod path_builder;
52pub mod path_effect;
53mod path_iter;
54pub mod path_measure;
55pub mod path_types;
56pub mod path_utils;
57mod picture;
58pub mod picture_recorder;
59mod pixel_ref;
60mod pixmap;
61mod point;
62mod point3;
63mod raster_handle_allocator;
64pub mod recorder;
65mod rect;
66pub mod region;
67pub mod rrect;
68mod rsxform;
69pub mod sampling_options;
70mod scalar_;
71pub mod shader;
72mod size;
73pub mod stroke_rec;
74pub mod surface;
75mod surface_props;
76mod swizzle;
77mod text_blob;
78mod texture_compression_type;
79mod tile_mode;
80pub mod tiled_image_utils;
81mod time;
82mod trace_memory_dump;
83pub mod typeface;
84mod types;
85mod un_pre_multiply;
86pub mod vertices;
87pub mod yuva_info;
88pub mod yuva_pixmaps;
89
90pub use alpha_type::*;
91pub use annotation::annotate;
92pub use bbh_factory::*;
93pub use bitmap::*;
94pub use blend_mode::*;
95pub use blender::*;
96pub use blur_types::*;
97pub use canvas::{AutoCanvasRestore, Canvas, OwnedCanvas};
98pub use clip_op::*;
99pub use color::*;
100pub use color_filter::{color_filters, ColorFilter};
101pub use color_space::*;
102pub use color_table::*;
103pub use color_type::*;
104pub use contour_measure::{ContourMeasure, ContourMeasureIter};
105pub use coverage_mode::*;
106pub use cubic_map::*;
107pub use data::*;
108pub use data_table::*;
109pub use document::Document;
110pub use drawable::Drawable;
111pub use flattenable::*;
112pub use font::Font;
113pub use font_arguments::FontArguments;
114pub use font_metrics::FontMetrics;
115pub use font_mgr::*;
116pub use font_style::FontStyle;
117pub use font_types::*;
118pub use four_byte_tag::*;
119pub use image::{images, Image};
120pub use image_filter::ImageFilter;
121pub use image_generator::*;
122pub use image_info::*;
123pub use m44::*;
124pub use mask_filter::*;
125pub use matrix::Matrix;
126pub use milestone::*;
127pub use paint::Paint;
128pub use tile_mode::*;
129pub use arc::Arc;
131pub use cpu_recorder::cpu;
132pub use paint::Cap as PaintCap;
133pub use paint::Join as PaintJoin;
134pub use paint::Style as PaintStyle;
135pub use path::Path;
136pub use path_builder::PathBuilder;
137pub use path_effect::PathEffect;
138pub use path_iter::*;
139pub use path_measure::PathMeasure;
140pub use path_types::*;
141pub use picture::*;
142pub use picture_recorder::PictureRecorder;
143pub use pixel_ref::*;
144pub use pixmap::*;
145pub use point::*;
146pub use point3::*;
147#[allow(unused)]
148pub use raster_handle_allocator::*;
149pub use recorder::{Recorder, RecorderRef};
150pub use rect::*;
151pub use region::Region;
152pub use rrect::RRect;
153pub use rsxform::*;
154#[allow(deprecated)]
155pub use sampling_options::{
156 CubicResampler, FilterMode, FilterOptions, MipmapMode, SamplingMode, SamplingOptions,
157};
158pub use scalar_::*;
159pub use shader::Shader;
160pub use size::*;
161pub use stroke_rec::StrokeRec;
162pub use surface::{surfaces, Surface};
163pub use surface_props::*;
164pub use swizzle::*;
165pub use text_blob::*;
166pub use texture_compression_type::*;
167pub use time::*;
168#[allow(unused)]
169pub use trace_memory_dump::*;
170pub use typeface::Typeface;
171pub use types::*;
172#[allow(unused)]
173pub use un_pre_multiply::*;
174pub use vertices::Vertices;
175pub use yuva_info::YUVAInfo;
176pub use yuva_pixmaps::{yuva_pixmap_info, YUVAPixmapInfo, YUVAPixmaps};
177pub trait Contains<T> {
182 fn contains(&self, other: T) -> bool;
183}
184
185pub trait QuickReject<T> {
186 fn quick_reject(&self, other: &T) -> bool;
187}
188
189pub mod shaders {
190 pub use super::shader::shaders::*;
191 use crate::{prelude::*, scalar, ISize, Shader};
192 use skia_bindings as sb;
193
194 impl Shader {
195 pub fn fractal_perlin_noise(
196 base_frequency: (scalar, scalar),
197 num_octaves: usize,
198 seed: scalar,
199 tile_size: impl Into<Option<ISize>>,
200 ) -> Option<Self> {
201 fractal_noise(base_frequency, num_octaves, seed, tile_size)
202 }
203
204 pub fn turbulence_perlin_noise(
205 base_frequency: (scalar, scalar),
206 num_octaves: usize,
207 seed: scalar,
208 tile_size: impl Into<Option<ISize>>,
209 ) -> Option<Self> {
210 turbulence(base_frequency, num_octaves, seed, tile_size)
211 }
212 }
213
214 pub fn fractal_noise(
215 base_frequency: (scalar, scalar),
216 num_octaves: usize,
217 seed: scalar,
218 tile_size: impl Into<Option<ISize>>,
219 ) -> Option<Shader> {
220 Shader::from_ptr(unsafe {
221 sb::C_SkShaders_MakeFractalNoise(
222 base_frequency.0,
223 base_frequency.1,
224 num_octaves.try_into().unwrap(),
225 seed,
226 tile_size.into().native().as_ptr_or_null(),
227 )
228 })
229 }
230
231 pub fn turbulence(
232 base_frequency: (scalar, scalar),
233 num_octaves: usize,
234 seed: scalar,
235 tile_size: impl Into<Option<ISize>>,
236 ) -> Option<Shader> {
237 Shader::from_ptr(unsafe {
238 sb::C_SkShaders_MakeTurbulence(
239 base_frequency.0,
240 base_frequency.1,
241 num_octaves.try_into().unwrap(),
242 seed,
243 tile_size.into().native().as_ptr_or_null(),
244 )
245 })
246 }
247}