| 1 | /* |
| 2 | * // Copyright (c) Radzivon Bartoshyk 2/2025. 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 | #![allow(clippy::manual_clamp, clippy::excessive_precision)] |
| 30 | #![cfg_attr(docsrs, feature(doc_cfg))] |
| 31 | #![deny(unreachable_pub)] |
| 32 | #![deny( |
| 33 | clippy::print_stdout, |
| 34 | clippy::print_stderr, |
| 35 | clippy::print_literal, |
| 36 | clippy::print_in_format_impl |
| 37 | )] |
| 38 | #![allow(stable_features)] |
| 39 | #![cfg_attr( |
| 40 | not(any(feature = "avx", feature = "sse", feature = "avx512", feature = "neon",)), |
| 41 | forbid(unsafe_code) |
| 42 | )] |
| 43 | mod chad; |
| 44 | mod cicp; |
| 45 | mod conversions; |
| 46 | mod dat; |
| 47 | mod defaults; |
| 48 | mod err; |
| 49 | mod gamma; |
| 50 | mod gamut; |
| 51 | mod ictcp; |
| 52 | mod jzazbz; |
| 53 | mod jzczhz; |
| 54 | mod lab; |
| 55 | mod luv; |
| 56 | /// One of main intent is to provide fast math available in const context |
| 57 | /// ULP most of the methods <= 0.5 |
| 58 | mod math; |
| 59 | mod matrix; |
| 60 | mod mlaf; |
| 61 | mod nd_array; |
| 62 | mod oklab; |
| 63 | mod oklch; |
| 64 | mod profile; |
| 65 | mod reader; |
| 66 | mod rgb; |
| 67 | mod safe_math; |
| 68 | mod tag; |
| 69 | mod transform; |
| 70 | mod trc; |
| 71 | mod writer; |
| 72 | mod yrg; |
| 73 | // Simple math analysis module |
| 74 | mod chromaticity; |
| 75 | mod dt_ucs; |
| 76 | mod helpers; |
| 77 | mod interceptors; |
| 78 | mod lut_hint; |
| 79 | mod matan; |
| 80 | mod srlab2; |
| 81 | mod xyy; |
| 82 | |
| 83 | pub use chad::{ |
| 84 | adapt_to_d50, adapt_to_d50_d, adapt_to_illuminant, adapt_to_illuminant_d, |
| 85 | adapt_to_illuminant_xyz, adapt_to_illuminant_xyz_d, adaption_matrix, adaption_matrix_d, |
| 86 | }; |
| 87 | pub use chromaticity::Chromaticity; |
| 88 | pub use cicp::{CicpColorPrimaries, ColorPrimaries, MatrixCoefficients, TransferCharacteristics}; |
| 89 | pub use dat::ColorDateTime; |
| 90 | pub use defaults::{ |
| 91 | HLG_LUT_TABLE, PQ_LUT_TABLE, WHITE_POINT_D50, WHITE_POINT_D60, WHITE_POINT_D65, |
| 92 | WHITE_POINT_DCI_P3, |
| 93 | }; |
| 94 | pub use dt_ucs::{DtUchHcb, DtUchHsb, DtUchJch}; |
| 95 | pub use err::{CmsError, MalformedSize}; |
| 96 | pub use gamut::filmlike_clip; |
| 97 | pub use ictcp::ICtCp; |
| 98 | pub use jzazbz::Jzazbz; |
| 99 | pub use jzczhz::Jzczhz; |
| 100 | pub use lab::Lab; |
| 101 | pub use luv::{LCh, Luv}; |
| 102 | pub use math::rounding_div_ceil; |
| 103 | pub use matrix::{ |
| 104 | BT2020_MATRIX, DISPLAY_P3_MATRIX, Matrix3, Matrix3d, Matrix3f, Matrix4f, SRGB_MATRIX, Vector3, |
| 105 | Vector3d, Vector3f, Vector3i, Vector3u, Vector4, Vector4d, Vector4f, Vector4i, Xyz, Xyzd, |
| 106 | }; |
| 107 | pub use nd_array::{Cube, Hypercube}; |
| 108 | pub use oklab::Oklab; |
| 109 | pub use oklch::Oklch; |
| 110 | pub use profile::{ |
| 111 | CicpProfile, ColorProfile, DataColorSpace, DescriptionString, LocalizableString, LutDataType, |
| 112 | LutMultidimensionalType, LutStore, LutType, LutWarehouse, Measurement, MeasurementGeometry, |
| 113 | ParsingOptions, ProfileClass, ProfileSignature, ProfileText, ProfileVersion, RenderingIntent, |
| 114 | StandardIlluminant, StandardObserver, TechnologySignatures, ViewingConditions, |
| 115 | }; |
| 116 | pub use rgb::{FusedExp, FusedExp2, FusedExp10, FusedLog, FusedLog2, FusedLog10, FusedPow, Rgb}; |
| 117 | pub use srlab2::Srlab2; |
| 118 | pub use transform::{ |
| 119 | BarycentricWeightScale, InPlaceStage, InPlaceTransformExecutor, InterpolationMethod, Layout, |
| 120 | PointeeSizeExpressible, Stage, Transform8BitExecutor, Transform16BitExecutor, |
| 121 | TransformExecutor, TransformF32Executor, TransformF64Executor, TransformOptions, |
| 122 | }; |
| 123 | pub use trc::{ |
| 124 | GammaLutInterpolate, ParametricCurve, ToneCurveEvaluator, ToneReprCurve, curve_from_gamma, |
| 125 | }; |
| 126 | pub use xyy::{XyY, XyYRepresentable}; |
| 127 | pub use yrg::{Ych, Yrg, cie_y_1931_to_cie_y_2006}; |