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)]
32#![allow(clippy::too_many_arguments, clippy::manual_clamp)]
33#![cfg_attr(
34    all(feature = "nightly_i8mm", target_arch = "aarch64"),
35    feature(stdarch_neon_i8mm)
36)]
37#![cfg_attr(
38    all(feature = "nightly_avx512", target_arch = "x86_64"),
39    feature(cfg_version)
40)]
41#![cfg_attr(
42    all(feature = "nightly_avx512", target_arch = "x86_64"),
43    feature(avx512_target_feature)
44)]
45#![cfg_attr(
46    all(feature = "nightly_avx512", target_arch = "x86_64"),
47    feature(stdarch_x86_avx512)
48)]
49#![cfg_attr(
50    all(feature = "nightly_avx512fp16", target_arch = "x86_64"),
51    feature(stdarch_x86_avx512_f16)
52)]
53#![cfg_attr(
54    all(feature = "nightly_avx512", target_arch = "x86_64"),
55    feature(x86_amx_intrinsics)
56)]
57#![cfg_attr(feature = "nightly_f16", feature(f16))]
58#![cfg_attr(
59    all(feature = "nightly_f16", target_arch = "aarch64"),
60    feature(stdarch_neon_f16)
61)]
62#![cfg_attr(docsrs, feature(doc_cfg))]
63
64mod alpha_check;
65#[cfg(feature = "nightly_f16")]
66mod alpha_handle_f16;
67mod alpha_handle_f32;
68mod alpha_handle_u16;
69mod alpha_handle_u8;
70mod ar30;
71#[cfg(all(target_arch = "x86_64", feature = "avx"))]
72mod avx2;
73#[cfg(all(target_arch = "x86_64", feature = "nightly_avx512"))]
74mod avx512;
75mod cbcr16;
76mod cbcr8;
77mod cbcr_f32;
78mod color_group;
79#[cfg(feature = "colorspaces")]
80mod colors;
81mod convolution;
82mod convolve_naive_f32;
83mod dispatch_group_ar30;
84#[cfg(feature = "nightly_f16")]
85mod dispatch_group_f16;
86mod dispatch_group_f32;
87mod dispatch_group_u16;
88mod dispatch_group_u8;
89#[cfg(feature = "nightly_f16")]
90mod f16;
91mod filter_weights;
92mod fixed_point_horizontal;
93mod fixed_point_horizontal_ar30;
94mod fixed_point_vertical;
95mod fixed_point_vertical_ar30;
96mod floating_point_horizontal;
97mod floating_point_vertical;
98mod handler_provider;
99mod image_size;
100mod image_store;
101mod math;
102mod mixed_storage;
103mod mlaf;
104mod nearest_sampler;
105#[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
106mod neon;
107mod pic_scale_error;
108mod plane_f32;
109mod plane_u16;
110mod plane_u8;
111mod resize_ar30;
112mod rgb_f32;
113mod rgb_u16;
114mod rgb_u8;
115mod rgba_f32;
116mod rgba_u16;
117mod rgba_u8;
118mod sampler;
119mod saturate_narrow;
120mod scaler;
121#[cfg(feature = "nightly_f16")]
122#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
123mod scaler_f16;
124#[cfg(all(any(target_arch = "x86_64", target_arch = "x86"), feature = "sse"))]
125mod sse;
126mod support;
127mod threading_policy;
128#[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
129mod wasm32;
130
131pub use ar30::Ar30ByteOrder;
132#[cfg(feature = "colorspaces")]
133pub use colors::*;
134#[cfg(feature = "colorspaces")]
135pub use colorutils_rs::TransferFunction;
136pub use image_size::ImageSize;
137pub use image_store::{
138    BufferStore, CbCr8ImageStore, CbCr8ImageStoreMut, CbCr16ImageStore, CbCr16ImageStoreMut,
139    CbCrF32ImageStore, CbCrF32ImageStoreMut, GrayAlpha8ImageStore, GrayAlpha8ImageStoreMut,
140    GrayAlpha16ImageStore, GrayAlpha16ImageStoreMut, GrayAlphaF32ImageStore,
141    GrayAlphaF32ImageStoreMut, ImageStore, ImageStoreMut, Planar8ImageStore, Planar8ImageStoreMut,
142    Planar16ImageStore, Planar16ImageStoreMut, PlanarF32ImageStore, PlanarF32ImageStoreMut,
143    Rgb8ImageStore, Rgb8ImageStoreMut, Rgb16ImageStore, Rgb16ImageStoreMut, RgbF32ImageStore,
144    RgbF32ImageStoreMut, Rgba8ImageStore, Rgba8ImageStoreMut, Rgba16ImageStore,
145    Rgba16ImageStoreMut, RgbaF32ImageStore, RgbaF32ImageStoreMut,
146};
147#[cfg(feature = "nightly_f16")]
148#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
149pub use image_store::{
150    CbCrF16ImageStore, CbCrF16ImageStoreMut, PlanarF16ImageStore, PlanarF16ImageStoreMut,
151    RgbF16ImageStore, RgbF16ImageStoreMut, RgbaF16ImageStore, RgbaF16ImageStoreMut,
152};
153pub(crate) use math::*;
154pub use pic_scale_error::{PicScaleBufferMismatch, PicScaleError};
155pub use sampler::*;
156pub use scaler::{ImageStoreScaling, Scaler, ScalingOptions, WorkloadStrategy};
157pub use scaler::{Scaling, ScalingF32, ScalingU16};
158pub use threading_policy::ThreadingPolicy;