Skip to main content

pic_scale/
lib.rs

1/*
2 * Copyright (c) Radzivon Bartoshyk. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification,
5 * are permitted provided that the following conditions are met:
6 *
7 * 1.  Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * 2.  Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * 3.  Neither the name of the copyright holder nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29#![deny(deprecated)]
30// #![deny(unreachable_code, unused)]
31#![allow(stable_features, clippy::incompatible_msrv, unused_features)]
32#![allow(
33    clippy::too_many_arguments,
34    clippy::manual_clamp,
35    clippy::type_complexity
36)]
37#![cfg_attr(
38    all(feature = "nightly_i8mm", target_arch = "aarch64"),
39    feature(stdarch_neon_i8mm)
40)]
41#![cfg_attr(
42    all(feature = "nightly_avx512fp16", target_arch = "x86_64"),
43    feature(stdarch_x86_avx512_f16)
44)]
45#![cfg_attr(feature = "nightly_f16", feature(f16))]
46#![cfg_attr(
47    all(feature = "nightly_f16", target_arch = "aarch64"),
48    feature(stdarch_neon_f16)
49)]
50#![cfg_attr(docsrs, feature(doc_cfg))]
51
52mod alpha_check;
53#[cfg(feature = "nightly_f16")]
54mod alpha_handle_f16;
55mod alpha_handle_f32;
56mod alpha_handle_u16;
57mod alpha_handle_u8;
58mod ar30;
59#[cfg(all(target_arch = "x86_64", feature = "avx"))]
60mod avx2;
61#[cfg(all(target_arch = "x86_64", feature = "avx512"))]
62mod avx512;
63mod cbcr16;
64mod cbcr8;
65mod cbcr_f32;
66mod color_group;
67#[cfg(feature = "colorspaces")]
68mod colors;
69mod convolution;
70mod convolve_naive_f32;
71mod dispatch_group_ar30;
72mod dispatch_group_u16;
73#[cfg(feature = "nightly_f16")]
74mod f16;
75mod filter_weights;
76mod fixed_point_horizontal;
77mod fixed_point_horizontal_ar30;
78mod fixed_point_vertical;
79mod fixed_point_vertical_ar30;
80mod floating_point_horizontal;
81mod floating_point_vertical;
82mod handler_provider;
83mod image_size;
84mod image_store;
85mod math;
86mod mixed_storage;
87mod mlaf;
88#[cfg(all(target_arch = "aarch64", feature = "neon"))]
89mod neon;
90mod plan;
91mod plane_f32;
92mod plane_u16;
93mod plane_u8;
94mod rgb_f32;
95mod rgb_u16;
96mod rgb_u8;
97mod rgba_f32;
98mod rgba_u16;
99mod rgba_u8;
100mod sampler;
101mod saturate_narrow;
102mod scaler;
103#[cfg(feature = "nightly_f16")]
104#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
105mod scaler_f16;
106#[cfg(all(any(target_arch = "x86_64", target_arch = "x86"), feature = "sse"))]
107mod sse;
108mod support;
109mod threading_policy;
110mod validation;
111#[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
112mod wasm32;
113
114pub use ar30::Ar30ByteOrder;
115#[cfg(feature = "colorspaces")]
116pub use colors::*;
117#[cfg(feature = "colorspaces")]
118pub use colorutils_rs::TransferFunction;
119pub use image_size::ImageSize;
120pub use image_store::{
121    BufferStore, CbCr8ImageStore, CbCr8ImageStoreMut, CbCr16ImageStore, CbCr16ImageStoreMut,
122    CbCrF32ImageStore, CbCrF32ImageStoreMut, GrayAlpha8ImageStore, GrayAlpha8ImageStoreMut,
123    GrayAlpha16ImageStore, GrayAlpha16ImageStoreMut, GrayAlphaF32ImageStore,
124    GrayAlphaF32ImageStoreMut, ImageStore, ImageStoreMut, Planar8ImageStore, Planar8ImageStoreMut,
125    Planar16ImageStore, Planar16ImageStoreMut, PlanarF32ImageStore, PlanarF32ImageStoreMut,
126    Rgb8ImageStore, Rgb8ImageStoreMut, Rgb16ImageStore, Rgb16ImageStoreMut, RgbF32ImageStore,
127    RgbF32ImageStoreMut, Rgba8ImageStore, Rgba8ImageStoreMut, Rgba16ImageStore,
128    Rgba16ImageStoreMut, RgbaF32ImageStore, RgbaF32ImageStoreMut,
129};
130#[cfg(feature = "nightly_f16")]
131#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
132pub use image_store::{
133    CbCrF16ImageStore, CbCrF16ImageStoreMut, PlanarF16ImageStore, PlanarF16ImageStoreMut,
134    RgbF16ImageStore, RgbF16ImageStoreMut, RgbaF16ImageStore, RgbaF16ImageStoreMut,
135};
136pub(crate) use math::*;
137pub use plan::{Resampling, ResamplingPlan};
138pub use sampler::*;
139pub use scaler::{ImageStoreScaling, Scaler, ScalingOptions, WorkloadStrategy};
140pub use threading_policy::ThreadingPolicy;
141pub use validation::{PicScaleBufferMismatch, PicScaleError};