| 1 | /* |
| 2 | * // Copyright (c) Radzivon Bartoshyk 4/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 | #![cfg(feature = "lut")] |
| 30 | use craterust-analyzer cargo moxcms 0.8.1 crate/::conversionsrust-analyzer cargo moxcms 0.8.1 conversions/::lut3x4rust-analyzer cargo moxcms 0.8.1 conversions/lut3x4/::create_lut3_samplesrust-analyzer cargo moxcms 0.8.1 conversions/lut3x4/create_lut3_samples().; |
| 31 | use craterust-analyzer cargo moxcms 0.8.1 crate/::errrust-analyzer cargo moxcms 0.8.1 err/::try_vecrust-analyzer cargo moxcms 0.8.1 err/try_vec!; |
| 32 | use craterust-analyzer cargo moxcms 0.8.1 crate/::mlafrust-analyzer cargo moxcms 0.8.1 mlaf/::mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().; |
| 33 | use craterust-analyzer cargo moxcms 0.8.1 crate/::{ |
| 34 | CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#, ColorProfilerust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#, GammaLutInterpolaterust-analyzer cargo moxcms 0.8.1 trc/GammaLutInterpolate#, InPlaceStagerust-analyzer cargo moxcms 0.8.1 transform/InPlaceStage#, Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#, PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#, |
| 35 | Rgbrust-analyzer cargo moxcms 0.8.1 rgb/Rgb#, TransformOptionsrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#, |
| 36 | }; |
| 37 | use num_traitsrust-analyzer cargo num-traits 0.2.19 crate/::AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#; |
| 38 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#; |
| 39 | |
| 40 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) struct XyzToRgbStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#<T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#> { |
| 41 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) r_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#r_gamma.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[T; 65536]>, |
| 42 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) g_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#g_gamma.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[T; 65536]>, |
| 43 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) b_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#b_gamma.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[T; 65536]>, |
| 44 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#matrices.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#>, |
| 45 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#bit_depth.: usize, |
| 46 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) gamma_lutrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#gamma_lut.: usize, |
| 47 | } |
| 48 | |
| 49 | impl<T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32>> InPlaceStagerust-analyzer cargo moxcms 0.8.1 transform/InPlaceStage# for XyzToRgbStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#<T> { |
| 50 | fn transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`XyzToRgbStage<T>`][InPlaceStage]transform().(&self, dst: &mut [f32]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> { |
| 51 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(self.bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#bit_depth. >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). 0); |
| 52 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#matrices..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() { |
| 53 | let m = self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#matrices.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().; |
| 54 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 55 | let x = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 56 | let y = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 57 | let z = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 58 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 59 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 60 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | for m in self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#matrices..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().skiprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#skip().(1) { |
| 65 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 66 | let x = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 67 | let y = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 68 | let z = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 69 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 70 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 71 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | let max_colors = (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl().self.bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#bit_depth.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1; |
| 76 | let color_scale = 1f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().max_colors as f32; |
| 77 | let lut_cap = (self.gamma_lutrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#gamma_lut. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1) as f32; |
| 78 | |
| 79 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 80 | let rgb = Rgbrust-analyzer cargo moxcms 0.8.1 rgb/Rgb#::newrust-analyzer cargo moxcms 0.8.1 rgb/impl#[`Rgb<T>`]new().(dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 81 | let r = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(0.5f32, rgb.rrust-analyzer cargo moxcms 0.8.1 rgb/Rgb#r., lut_cap).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(lut_cap).maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0f32) as u16; |
| 82 | let g = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(0.5f32, rgb.grust-analyzer cargo moxcms 0.8.1 rgb/Rgb#g., lut_cap).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(lut_cap).maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0f32) as u16; |
| 83 | let b = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(0.5f32, rgb.brust-analyzer cargo moxcms 0.8.1 rgb/Rgb#b., lut_cap).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(lut_cap).maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0f32) as u16; |
| 84 | |
| 85 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.r_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#r_gamma.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().r as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().color_scale; |
| 86 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.g_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#g_gamma.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().g as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().color_scale; |
| 87 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.b_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#b_gamma.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().b as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().color_scale; |
| 88 | } |
| 89 | |
| 90 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | #[cfg(feature = "extended_range")] |
| 95 | use craterust-analyzer cargo moxcms 0.8.1 crate/::trcrust-analyzer cargo moxcms 0.8.1 trc/::ToneCurveEvaluatorrust-analyzer cargo moxcms 0.8.1 trc/ToneCurveEvaluator#; |
| 96 | |
| 97 | #[cfg(feature = "extended_range")] |
| 98 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) struct XyzToRgbStageExtendedrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#<T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#> { |
| 99 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) gamma_evaluatorrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#gamma_evaluator.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn ToneCurveEvaluatorrust-analyzer cargo moxcms 0.8.1 trc/ToneCurveEvaluator#>, |
| 100 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#matrices.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#>, |
| 101 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) phantom_datarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#phantom_data.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>, |
| 102 | } |
| 103 | |
| 104 | #[cfg(feature = "extended_range")] |
| 105 | impl<T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32>> InPlaceStagerust-analyzer cargo moxcms 0.8.1 transform/InPlaceStage# for XyzToRgbStageExtendedrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#<T> { |
| 106 | fn transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`XyzToRgbStageExtended<T>`][InPlaceStage]transform().(&self, dst: &mut [f32]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> { |
| 107 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#matrices..is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() { |
| 108 | let m = self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#matrices.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().; |
| 109 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 110 | let x = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 111 | let y = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 112 | let z = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 113 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 114 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 115 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | for m in self.matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#matrices..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().skiprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#skip().(1) { |
| 120 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 121 | let x = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 122 | let y = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 123 | let z = dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 124 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 125 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 126 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(mlafrust-analyzer cargo moxcms 0.8.1 mlaf/mlaf().(x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., y, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().), z, m.vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | for dst in dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3) { |
| 131 | let mut rgb = Rgbrust-analyzer cargo moxcms 0.8.1 rgb/Rgb#::newrust-analyzer cargo moxcms 0.8.1 rgb/impl#[`Rgb<T>`]new().(dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().); |
| 132 | rgb = self.gamma_evaluatorrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#gamma_evaluator..evaluate_tristimulusrust-analyzer cargo moxcms 0.8.1 trc/ToneCurveEvaluator#evaluate_tristimulus().(rgb); |
| 133 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = rgb.rrust-analyzer cargo moxcms 0.8.1 rgb/Rgb#r..as_rust-analyzer cargo num-traits 0.2.19 cast/impl#[f32][`AsPrimitive<Self>`]as_().(); |
| 134 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = rgb.grust-analyzer cargo moxcms 0.8.1 rgb/Rgb#g..as_rust-analyzer cargo num-traits 0.2.19 cast/impl#[f32][`AsPrimitive<Self>`]as_().(); |
| 135 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = rgb.brust-analyzer cargo moxcms 0.8.1 rgb/Rgb#b..as_rust-analyzer cargo num-traits 0.2.19 cast/impl#[f32][`AsPrimitive<Self>`]as_().(); |
| 136 | } |
| 137 | |
| 138 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | struct RgbLinearizationStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#<T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, const LINEAR_CAP: usize, const SAMPLES: usize> { |
| 143 | r_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#r_lin.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[f32; LINEAR_CAP]>, |
| 144 | g_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#g_lin.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[f32; LINEAR_CAP]>, |
| 145 | b_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#b_lin.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[f32; LINEAR_CAP]>, |
| 146 | _phantomrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#_phantom.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>, |
| 147 | bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#bit_depth.: usize, |
| 148 | } |
| 149 | |
| 150 | impl< |
| 151 | T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<usize> + PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#, |
| 152 | const LINEAR_CAP: usize, |
| 153 | const SAMPLES: usize, |
| 154 | > RgbLinearizationStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#<T, LINEAR_CAP, SAMPLES> |
| 155 | { |
| 156 | fn transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`RgbLinearizationStage<T, LINEAR_CAP, SAMPLES>`]transform().(&self, src: &[T], dst: &mut [f32]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> { |
| 157 | if src.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 158 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#::LaneMultipleOfChannelsrust-analyzer cargo moxcms 0.8.1 err/CmsError#LaneMultipleOfChannels#); |
| 159 | } |
| 160 | if dst.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Rem<Self>`]rem().3 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 161 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#::LaneMultipleOfChannelsrust-analyzer cargo moxcms 0.8.1 err/CmsError#LaneMultipleOfChannels#); |
| 162 | } |
| 163 | |
| 164 | let scale = if T::FINITErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#FINITE. { |
| 165 | ((1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<usize>`]shl().self.bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#bit_depth.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1) as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(SAMPLES as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1f32) |
| 166 | } else { |
| 167 | (T::NOT_FINITE_LINEAR_TABLE_SIZErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#NOT_FINITE_LINEAR_TABLE_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1) as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div().(SAMPLES as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Sub<Self>`]sub().1f32) |
| 168 | }; |
| 169 | |
| 170 | let capped_value = if T::FINITErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#FINITE. { |
| 171 | (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`Shl<Self>`]shl().self.bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#bit_depth.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 |
| 172 | } else { |
| 173 | T::NOT_FINITE_LINEAR_TABLE_SIZErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#NOT_FINITE_LINEAR_TABLE_SIZE. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 |
| 174 | }; |
| 175 | |
| 176 | for (src, dst) in src.chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(3).ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(dst.chunks_exact_mutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact_mut().(3)) { |
| 177 | let j_r = src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale; |
| 178 | let j_g = src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale; |
| 179 | let j_b = src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().() as f32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Mul<Self>`]mul().scale; |
| 180 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.r_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#r_lin.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(j_r.roundrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]round().().maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0.0).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(capped_value as f32) as u16) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 181 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.g_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#g_lin.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(j_g.roundrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]round().().maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0.0).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(capped_value as f32) as u16) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 182 | dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.b_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#b_lin.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(j_b.roundrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f32/impl#[f32]round().().maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]max().(0.0).minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]min().(capped_value as f32) as u16) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 183 | } |
| 184 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) fn create_rgb_lin_lutrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/create_rgb_lin_lut().< |
| 189 | T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy# + Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32> + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<usize> + PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#, |
| 190 | const BIT_DEPTH: usize, |
| 191 | const LINEAR_CAP: usize, |
| 192 | const GRID_SIZE: usize, |
| 193 | >( |
| 194 | source: &ColorProfilerust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#, |
| 195 | opts: TransformOptionsrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#, |
| 196 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<f32>, CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> |
| 197 | where |
| 198 | u32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>, |
| 199 | f32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>, |
| 200 | { |
| 201 | let lut_origins = create_lut3_samplesrust-analyzer cargo moxcms 0.8.1 conversions/lut3x4/create_lut3_samples().::<T, GRID_SIZE>(); |
| 202 | |
| 203 | let lin_r = |
| 204 | source.build_r_linearize_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_r_linearize_table().::<T, LINEAR_CAP, BIT_DEPTH>(opts.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 205 | let lin_g = |
| 206 | source.build_g_linearize_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_g_linearize_table().::<T, LINEAR_CAP, BIT_DEPTH>(opts.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 207 | let lin_b = |
| 208 | source.build_b_linearize_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_b_linearize_table().::<T, LINEAR_CAP, BIT_DEPTH>(opts.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 209 | |
| 210 | let lin_stage = RgbLinearizationStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#::<T, LINEAR_CAP, GRID_SIZE> { |
| 211 | r_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#r_lin.: lin_r, |
| 212 | g_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#g_lin.: lin_g, |
| 213 | b_linrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#b_lin.: lin_b, |
| 214 | _phantomrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#_phantom.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 215 | bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/RgbLinearizationStage#bit_depth.: BIT_DEPTH, |
| 216 | }; |
| 217 | |
| 218 | let mut lut = try_vecrust-analyzer cargo moxcms 0.8.1 err/try_vec!![0f32; lut_origins.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()]; |
| 219 | lin_stage.transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`RgbLinearizationStage<T, LINEAR_CAP, SAMPLES>`]transform().(&lut_origins, &mut lut)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 220 | |
| 221 | let xyz_to_rgb = source.rgb_to_xyz_matrixrust-analyzer cargo moxcms 0.8.1 profile/impl#[ColorProfile]rgb_to_xyz_matrix().(); |
| 222 | |
| 223 | let matrices = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![ |
| 224 | xyz_to_rgb.to_f32rust-analyzer cargo moxcms 0.8.1 matrix/impl#[Matrix3d]to_f32().(), |
| 225 | Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f# { |
| 226 | vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.: [ |
| 227 | [32768.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 65535.0, 0.0, 0.0], |
| 228 | [0.0, 32768.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 65535.0, 0.0], |
| 229 | [0.0, 0.0, 32768.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 65535.0], |
| 230 | ], |
| 231 | }, |
| 232 | ]; |
| 233 | |
| 234 | let matrix_stage = craterust-analyzer cargo moxcms 0.8.1 crate/::conversionsrust-analyzer cargo moxcms 0.8.1 conversions/::lut_transformsrust-analyzer cargo moxcms 0.8.1 conversions/lut_transforms/::MatrixStagerust-analyzer cargo moxcms 0.8.1 conversions/lut_transforms/MatrixStage# { matricesrust-analyzer cargo moxcms 0.8.1 conversions/lut_transforms/MatrixStage#matrices. }; |
| 235 | matrix_stage.transformrust-analyzer cargo moxcms 0.8.1 conversions/lut_transforms/impl#[MatrixStage][InPlaceStage]transform().(&mut lut)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 236 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(lut) |
| 237 | } |
| 238 | |
| 239 | pub(craterust-analyzer cargo moxcms 0.8.1 crate/) fn prepare_inverse_lut_rgb_xyzrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/prepare_inverse_lut_rgb_xyz().< |
| 240 | T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy# |
| 241 | + Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# |
| 242 | + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32> |
| 243 | + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# |
| 244 | + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# |
| 245 | + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<usize> |
| 246 | + PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible# |
| 247 | + GammaLutInterpolaterust-analyzer cargo moxcms 0.8.1 trc/GammaLutInterpolate#, |
| 248 | const BIT_DEPTH: usize, |
| 249 | const GAMMA_LUT: usize, |
| 250 | >( |
| 251 | dest: &ColorProfilerust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#, |
| 252 | lut: &mut [f32], |
| 253 | options: TransformOptionsrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#, |
| 254 | ) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> |
| 255 | where |
| 256 | f32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>, |
| 257 | u32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>, |
| 258 | { |
| 259 | #[cfg(feature = "extended_range")] |
| 260 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().T::FINITErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#FINITE. && options.allow_extended_range_rgb_xyzrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_extended_range_rgb_xyz. { |
| 261 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(extended_gamma) = dest.try_extended_gamma_evaluatorrust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]try_extended_gamma_evaluator().() { |
| 262 | let xyz_to_rgb = dest.rgb_to_xyz_matrixrust-analyzer cargo moxcms 0.8.1 profile/impl#[ColorProfile]rgb_to_xyz_matrix().().inverserust-analyzer cargo moxcms 0.8.1 matrix/impl#[Matrix3d]inverse().(); |
| 263 | |
| 264 | let mut matrices = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f# { |
| 265 | vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.: [ |
| 266 | [65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0, 0.0, 0.0], |
| 267 | [0.0, 65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0, 0.0], |
| 268 | [0.0, 0.0, 65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0], |
| 269 | ], |
| 270 | }]; |
| 271 | |
| 272 | matrices.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(xyz_to_rgb.to_f32rust-analyzer cargo moxcms 0.8.1 matrix/impl#[Matrix3d]to_f32().()); |
| 273 | let xyz_to_rgb_stage = XyzToRgbStageExtendedrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#::<T> { |
| 274 | gamma_evaluatorrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#gamma_evaluator.: extended_gamma, |
| 275 | matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#matrices., |
| 276 | phantom_datarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStageExtended#phantom_data.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#, |
| 277 | }; |
| 278 | xyz_to_rgb_stage.transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`XyzToRgbStageExtended<T>`][InPlaceStage]transform().(lut)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 279 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()); |
| 280 | } |
| 281 | } |
| 282 | let gamma_map_r = dest.build_gamma_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_gamma_table().::<T, 65536, GAMMA_LUT, BIT_DEPTH>( |
| 283 | &dest.red_trcrust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#red_trc., |
| 284 | options.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer., |
| 285 | )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 286 | let gamma_map_g = dest.build_gamma_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_gamma_table().::<T, 65536, GAMMA_LUT, BIT_DEPTH>( |
| 287 | &dest.green_trcrust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#green_trc., |
| 288 | options.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer., |
| 289 | )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 290 | let gamma_map_b = dest.build_gamma_tablerust-analyzer cargo moxcms 0.8.1 trc/impl#[ColorProfile]build_gamma_table().::<T, 65536, GAMMA_LUT, BIT_DEPTH>( |
| 291 | &dest.blue_trcrust-analyzer cargo moxcms 0.8.1 profile/ColorProfile#blue_trc., |
| 292 | options.allow_use_cicp_transferrust-analyzer cargo moxcms 0.8.1 transform/TransformOptions#allow_use_cicp_transfer., |
| 293 | )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 294 | |
| 295 | let xyz_to_rgb = dest.rgb_to_xyz_matrixrust-analyzer cargo moxcms 0.8.1 profile/impl#[ColorProfile]rgb_to_xyz_matrix().().inverserust-analyzer cargo moxcms 0.8.1 matrix/impl#[Matrix3d]inverse().(); |
| 296 | |
| 297 | let mut matrices = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![Matrix3frust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f# { |
| 298 | vrust-analyzer cargo moxcms 0.8.1 matrix/Matrix3f#v.: [ |
| 299 | [65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0, 0.0, 0.0], |
| 300 | [0.0, 65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0, 0.0], |
| 301 | [0.0, 0.0, 65535.0 /rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f32][`Div<Self>`]div(). 32768.0], |
| 302 | ], |
| 303 | }]; |
| 304 | |
| 305 | matrices.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(xyz_to_rgb.to_f32rust-analyzer cargo moxcms 0.8.1 matrix/impl#[Matrix3d]to_f32().()); |
| 306 | let xyz_to_rgb_stage = XyzToRgbStagerust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#::<T> { |
| 307 | r_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#r_gamma.: gamma_map_r, |
| 308 | g_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#g_gamma.: gamma_map_g, |
| 309 | b_gammarust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#b_gamma.: gamma_map_b, |
| 310 | matricesrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#matrices., |
| 311 | gamma_lutrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#gamma_lut.: GAMMA_LUT, |
| 312 | bit_depthrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/XyzToRgbStage#bit_depth.: BIT_DEPTH, |
| 313 | }; |
| 314 | xyz_to_rgb_stage.transformrust-analyzer cargo moxcms 0.8.1 conversions/prelude_lut_xyz_rgb/impl#[`XyzToRgbStage<T>`][InPlaceStage]transform().(lut)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 315 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 316 | } |