| 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 lut_hint; |
| 78 |
mod matan; |
| 79 |
mod srlab2; |
| 80 |
mod xyy; |
| 81 |
|
| 82 |
pub use chad::{ |
| 83 |
adapt_to_d50, adapt_to_d50_d, adapt_to_illuminant, adapt_to_illuminant_d, |
| 84 |
adapt_to_illuminant_xyz, adapt_to_illuminant_xyz_d, adaption_matrix, adaption_matrix_d, |
| 85 |
}; |
| 86 |
pub use chromaticity::Chromaticity; |
| 87 |
pub use cicp::{CicpColorPrimaries, ColorPrimaries, MatrixCoefficients, TransferCharacteristics}; |
| 88 |
pub use dat::ColorDateTime; |
| 89 |
pub use defaults::{ |
| 90 |
HLG_LUT_TABLE, PQ_LUT_TABLE, WHITE_POINT_D50, WHITE_POINT_D60, WHITE_POINT_D65, |
| 91 |
WHITE_POINT_DCI_P3, |
| 92 |
}; |
| 93 |
pub use dt_ucs::{DtUchHcb, DtUchHsb, DtUchJch}; |
| 94 |
pub use err::{CmsError, MalformedSize}; |
| 95 |
pub use gamut::filmlike_clip; |
| 96 |
pub use ictcp::ICtCp; |
| 97 |
pub use jzazbz::Jzazbz; |
| 98 |
pub use jzczhz::Jzczhz; |
| 99 |
pub use lab::Lab; |
| 100 |
pub use luv::{LCh, Luv}; |
| 101 |
pub use math::rounding_div_ceil; |
| 102 |
pub use matrix::{ |
| 103 |
BT2020_MATRIX, DISPLAY_P3_MATRIX, Matrix3, Matrix3d, Matrix3f, Matrix4f, SRGB_MATRIX, Vector3, |
| 104 |
Vector3d, Vector3f, Vector3i, Vector3u, Vector4, Vector4d, Vector4f, Vector4i, Xyz, Xyzd, |
| 105 |
}; |
| 106 |
pub use nd_array::{Cube, Hypercube}; |
| 107 |
pub use oklab::Oklab; |
| 108 |
pub use oklch::Oklch; |
| 109 |
pub use profile::{ |
| 110 |
CicpProfile, ColorProfile, DataColorSpace, DescriptionString, LocalizableString, LutDataType, |
| 111 |
LutMultidimensionalType, LutStore, LutType, LutWarehouse, Measurement, MeasurementGeometry, |
| 112 |
ParsingOptions, ProfileClass, ProfileSignature, ProfileText, ProfileVersion, RenderingIntent, |
| 113 |
StandardIlluminant, StandardObserver, TechnologySignatures, ViewingConditions, |
| 114 |
}; |
| 115 |
pub use rgb::{FusedExp, FusedExp2, FusedExp10, FusedLog, FusedLog2, FusedLog10, FusedPow, Rgb}; |
| 116 |
pub use srlab2::Srlab2; |
| 117 |
pub use transform::{ |
| 118 |
BarycentricWeightScale, InPlaceStage, InterpolationMethod, Layout, PointeeSizeExpressible, |
| 119 |
Stage, Transform8BitExecutor, Transform16BitExecutor, TransformExecutor, |
| 120 |
TransformF32BitExecutor, TransformF64BitExecutor, TransformOptions, |
| 121 |
}; |
| 122 |
pub use trc::{GammaLutInterpolate, ToneCurveEvaluator, ToneReprCurve, curve_from_gamma}; |
| 123 |
pub use xyy::{XyY, XyYRepresentable}; |
| 124 |
pub use yrg::{Ych, Yrg, cie_y_1931_to_cie_y_2006}; |