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