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