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;
58#[cfg(all(target_arch = "x86_64", feature = "avx"))]
59mod avx2;
60#[cfg(all(target_arch = "x86_64", feature = "avx512"))]
61mod avx512;
62mod color_group;
63#[cfg(feature = "colorspaces")]
64mod colors;
65mod convolution;
66mod convolve_naive_f32;
67#[cfg(feature = "nightly_f16")]
68mod f16;
69mod factory;
70mod filter_weights;
71mod fixed_point_horizontal;
72mod fixed_point_vertical;
73mod floating_point_horizontal;
74mod floating_point_vertical;
75mod handler_provider;
76mod image_size;
77mod image_store;
78mod math;
79mod mixed_storage;
80mod mlaf;
81#[cfg(all(target_arch = "aarch64", feature = "neon"))]
82mod neon;
83mod plan;
84mod sampler;
85mod saturate_narrow;
86mod scaler;
87#[cfg(feature = "nightly_f16")]
88#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
89mod scaler_f16;
90#[cfg(all(any(target_arch = "x86_64", target_arch = "x86"), feature = "sse"))]
91mod sse;
92mod support;
93mod threading_policy;
94mod validation;
95#[cfg(all(target_arch = "wasm32", target_feature = "simd128"))]
96mod wasm32;
97
98#[cfg(feature = "colorspaces")]
99pub use colors::*;
100#[cfg(feature = "colorspaces")]
101pub use colorutils_rs::TransferFunction;
102pub use factory::Ar30ByteOrder;
103pub use image_size::ImageSize;
104pub use image_store::{
105    BufferStore, CbCr8ImageStore, CbCr8ImageStoreMut, CbCr16ImageStore, CbCr16ImageStoreMut,
106    CbCrF32ImageStore, CbCrF32ImageStoreMut, GrayAlpha8ImageStore, GrayAlpha8ImageStoreMut,
107    GrayAlpha16ImageStore, GrayAlpha16ImageStoreMut, GrayAlphaF32ImageStore,
108    GrayAlphaF32ImageStoreMut, ImageStore, ImageStoreMut, Planar8ImageStore, Planar8ImageStoreMut,
109    Planar16ImageStore, Planar16ImageStoreMut, PlanarF32ImageStore, PlanarF32ImageStoreMut,
110    PlanarS16ImageStore, PlanarS16ImageStoreMut, Rgb8ImageStore, Rgb8ImageStoreMut,
111    Rgb16ImageStore, Rgb16ImageStoreMut, RgbF32ImageStore, RgbF32ImageStoreMut, Rgba8ImageStore,
112    Rgba8ImageStoreMut, Rgba16ImageStore, Rgba16ImageStoreMut, RgbaF32ImageStore,
113    RgbaF32ImageStoreMut,
114};
115#[cfg(feature = "nightly_f16")]
116#[cfg_attr(docsrs, doc(cfg(feature = "nightly_f16")))]
117pub use image_store::{
118    CbCrF16ImageStore, CbCrF16ImageStoreMut, PlanarF16ImageStore, PlanarF16ImageStoreMut,
119    RgbF16ImageStore, RgbF16ImageStoreMut, RgbaF16ImageStore, RgbaF16ImageStoreMut,
120};
121pub(crate) use math::*;
122pub use plan::{Resampling, ResamplingPlan};
123pub use sampler::*;
124pub use scaler::{ImageStoreScaling, Scaler, ScalingOptions, WorkloadStrategy};
125pub use threading_policy::ThreadingPolicy;
126pub use validation::{PicScaleBufferMismatch, PicScaleError};