Debian Codegraph @

src/conversions/sse/t_lut3_to_3_q0_15.rs

raw symbols SCIP
1 /*
2 * // Copyright (c) Radzivon Bartoshyk 3/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 = "sse_luts")]
30 use craterust-analyzer cargo moxcms 0.8.1 crate/::conversionsrust-analyzer cargo moxcms 0.8.1 conversions/::LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#;
31 use craterust-analyzer cargo moxcms 0.8.1 crate/::conversionsrust-analyzer cargo moxcms 0.8.1 conversions/::interpolatorrust-analyzer cargo moxcms 0.8.1 conversions/interpolator/::BarycentricWeightrust-analyzer cargo moxcms 0.8.1 conversions/interpolator/BarycentricWeight#;
32 use craterust-analyzer cargo moxcms 0.8.1 crate/::conversionsrust-analyzer cargo moxcms 0.8.1 conversions/::sserust-analyzer cargo moxcms 0.8.1 conversions/sse/::interpolator_q0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/::*;
33 use craterust-analyzer cargo moxcms 0.8.1 crate/::transformrust-analyzer cargo moxcms 0.8.1 transform/::PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#;
34 use craterust-analyzer cargo moxcms 0.8.1 crate/::{CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#, DataColorSpacerust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#, InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#, Layoutrust-analyzer cargo moxcms 0.8.1 transform/Layout#, TransformExecutorrust-analyzer cargo moxcms 0.8.1 transform/TransformExecutor#};
35 use num_traitsrust-analyzer cargo num-traits 0.2.19 crate/::AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#;
36 #[cfg(target_arch = "x86")]
37 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::archrust-analyzer cargo std https://github.com/rust-lang/rust/library/std arch/::x86::*;
38 #[cfg(target_arch = "x86_64")]
39 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::archrust-analyzer cargo std https://github.com/rust-lang/rust/library/std arch/::x86_64rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/arch/x86_64/::*;
40 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#;
41
42 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) struct TransformLut3x3SseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#<
43 T,
44 U,
45 const SRC_LAYOUT: u8,
46 const DST_LAYOUT: u8,
47 const GRID_SIZE: usize,
48 const BIT_DEPTH: usize,
49 const BINS: usize,
50 const BARYCENTRIC_BINS: usize,
51 > {
52 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) lutrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#lut.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<SseAlignedI16x4rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/SseAlignedI16x4#>,
53 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) _phantomrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#_phantom.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>,
54 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) _phantom2rust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#_phantom2.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<U>,
55 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) interpolation_methodrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#interpolation_method.: InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#,
56 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) weightsrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#weights.: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<[BarycentricWeightrust-analyzer cargo moxcms 0.8.1 conversions/interpolator/BarycentricWeight#<i16>; BINS]>,
57 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) color_spacerust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#color_space.: DataColorSpacerust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#,
58 pub(craterust-analyzer cargo moxcms 0.8.1 crate/) is_linearrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#is_linear.: bool,
59 }
60
61 impl<
62 T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32> + Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# + PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#,
63 U: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<usize>,
64 const SRC_LAYOUT: u8,
65 const DST_LAYOUT: u8,
66 const GRID_SIZE: usize,
67 const BIT_DEPTH: usize,
68 const BINS: usize,
69 const BARYCENTRIC_BINS: usize,
70 >
71 TransformLut3x3SseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#<
72 T,
73 U,
74 SRC_LAYOUT,
75 DST_LAYOUT,
76 GRID_SIZE,
77 BIT_DEPTH,
78 BINS,
79 BARYCENTRIC_BINS,
80 >
81 where
82 f32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>,
83 u32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>,
84 (): LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#<T, U>,
85 {
86 #[allow(unused_unsafe)]
87 #[target_feature(enable = "sse4.1")]
88 #[inline(never)]
89 unsafe fn transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(
90 &self,
91 src: &[T],
92 dst: &mut [T],
93 interpolator: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn SseMdInterpolationQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/SseMdInterpolationQ0_15# + 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#>,
94 ) {
95 unsafe {
96 let src_cn = Layoutrust-analyzer cargo moxcms 0.8.1 transform/Layout#::fromrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout][`From<u8>`]from().(SRC_LAYOUT);
97 let src_channels = src_cn.channelsrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]channels().();
98
99 let dst_cn = Layoutrust-analyzer cargo moxcms 0.8.1 transform/Layout#::fromrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout][`From<u8>`]from().(DST_LAYOUT);
100 let dst_channels = dst_cn.channelsrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]channels().();
101
102 let f_value_scale = _mm_set1_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_set1_ps().(1. 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().((1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().14i32) 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);
103 let max_value = ((1u32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shl<usize>`]shl().BIT_DEPTH) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`Sub<Self>`]sub().1).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
104 let v_max_scale = if T::FINITErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#FINITE. {
105 _mm_set1_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_set1_epi16().(((1i32 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().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 i16)
106 } else {
107 _mm_set1_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_set1_epi16().(((1i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shl<Self>`]shl().14i32) 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 i16)
108 };
109
110 for (src, dst) in src
111 .chunks_exactrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]chunks_exact().(src_channels)
112 .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().(dst_channels))
113 {
114 let x = <() as LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#<T, U>>::reducerust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#reduce().::<BIT_DEPTH, BARYCENTRIC_BINS>(
115 src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().src_cn.r_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]r_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
116 );
117 let y = <() as LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#<T, U>>::reducerust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#reduce().::<BIT_DEPTH, BARYCENTRIC_BINS>(
118 src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().src_cn.g_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]g_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
119 );
120 let z = <() as LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#<T, U>>::reducerust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#reduce().::<BIT_DEPTH, BARYCENTRIC_BINS>(
121 src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().src_cn.b_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]b_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().,
122 );
123
124 let a = if src_channels rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().4 {
125 src[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().src_cn.a_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]a_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().
126 } else {
127 max_value
128 };
129
130 let v = interpolator.inter3_sserust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/SseMdInterpolationQ0_15#inter3_sse().(
131 &self.lutrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#lut.,
132 x.as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().(),
133 y.as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().(),
134 z.as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().(),
135 self.weightsrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#weights..as_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`]as_slice().(),
136 );
137 if T::FINITErust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#FINITE. {
138 let mut o = _mm_max_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_max_epi16().(v.vrust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/SseVector#v., _mm_setzero_si128rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_setzero_si128().());
139 o = _mm_min_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_min_epi16().(o, v_max_scale);
140 let x = _mm_extract_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_extract_epi16().::<0>(o);
141 let y = _mm_extract_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_extract_epi16().::<1>(o);
142 let z = _mm_extract_epi16rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_extract_epi16().::<2>(o);
143
144 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.r_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]r_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = (x as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
145 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.g_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]g_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = (y as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
146 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.b_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]b_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = (z as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
147 } else {
148 let mut r = _mm_cvtepi32_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse2/_mm_cvtepi32_ps().(_mm_cvtepi16_epi32rust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse41/_mm_cvtepi16_epi32().(v.vrust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/SseVector#v.));
149 r = _mm_mul_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse/_mm_mul_ps().(r, f_value_scale);
150 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.r_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]r_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(_mm_extract_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse41/_mm_extract_ps().::<0>(r) as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
151 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.g_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]g_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(_mm_extract_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse41/_mm_extract_ps().::<1>(r) as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
152 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.b_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]b_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = f32::from_bitsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core f32/impl#[f32]from_bits().(_mm_extract_psrust-analyzer cargo core https://github.com/rust-lang/rust/library/core core_arch/x86/sse41/_mm_extract_ps().::<2>(r) as u32).as_rust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#as_().();
153 }
154 if dst_channels rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().4 {
155 dst[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().dst_cn.a_irust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]a_i().()]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = a;
156 }
157 }
158 }
159 }
160 }
161
162 impl<
163 T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy# + AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<f32> + Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# + PointeeSizeExpressiblerust-analyzer cargo moxcms 0.8.1 transform/PointeeSizeExpressible#,
164 U: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<usize>,
165 const SRC_LAYOUT: u8,
166 const DST_LAYOUT: u8,
167 const GRID_SIZE: usize,
168 const BIT_DEPTH: usize,
169 const BINS: usize,
170 const BARYCENTRIC_BINS: usize,
171 > TransformExecutorrust-analyzer cargo moxcms 0.8.1 transform/TransformExecutor#<T>
172 for TransformLut3x3SseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#<
173 T,
174 U,
175 SRC_LAYOUT,
176 DST_LAYOUT,
177 GRID_SIZE,
178 BIT_DEPTH,
179 BINS,
180 BARYCENTRIC_BINS,
181 >
182 where
183 f32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>,
184 u32: AsPrimitiverust-analyzer cargo num-traits 0.2.19 cast/AsPrimitive#<T>,
185 (): LutBarycentricReductionrust-analyzer cargo moxcms 0.8.1 conversions/reduction/LutBarycentricReduction#<T, U>,
186 {
187 fn transformrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`][`TransformExecutor<T>`]transform().(&self, src: &[T], dst: &mut [T]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), CmsErrorrust-analyzer cargo moxcms 0.8.1 err/CmsError#> {
188 let src_cn = Layoutrust-analyzer cargo moxcms 0.8.1 transform/Layout#::fromrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout][`From<u8>`]from().(SRC_LAYOUT);
189 let src_channels = src_cn.channelsrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]channels().();
190
191 let dst_cn = Layoutrust-analyzer cargo moxcms 0.8.1 transform/Layout#::fromrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout][`From<u8>`]from().(DST_LAYOUT);
192 let dst_channels = dst_cn.channelsrust-analyzer cargo moxcms 0.8.1 transform/impl#[Layout]channels().();
193 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().src_channels 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 {
194 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#);
195 }
196 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().dst_channels 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 {
197 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#);
198 }
199 let src_chunks = 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][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().src_channels;
200 let dst_chunks = 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][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().dst_channels;
201 if src_chunks 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().dst_chunks {
202 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#::LaneSizeMismatchrust-analyzer cargo moxcms 0.8.1 err/CmsError#LaneSizeMismatch#);
203 }
204
205 unsafe {
206 if self.color_spacerust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#color_space. rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().==rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq(). rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().DataColorSpacerust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#::Labrust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#Lab#
207 || (self.is_linearrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#is_linear. && self.color_spacerust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#color_space. rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().==rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq(). rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().DataColorSpacerust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#::Rgbrust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#Rgb#)
208 || self.color_spacerust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#color_space. rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().==rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq(). rust-analyzer cargo moxcms 0.8.1 profile/impl#[DataColorSpace][`PartialEq<Self>`]eq().DataColorSpacerust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#::Xyzrust-analyzer cargo moxcms 0.8.1 profile/DataColorSpace#Xyz#
209 {
210 self.transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(src, dst, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(TrilinearSseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/TrilinearSseQ0_15#::<GRID_SIZE> {}));
211 } else {
212 match self.interpolation_methodrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/TransformLut3x3SseQ0_15#interpolation_method. {
213 #[cfg(feature = "options")]
214 InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#::Tetrahedralrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#Tetrahedral# => {
215 self.transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(
216 src,
217 dst,
218 Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(TetrahedralSseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/TetrahedralSseQ0_15#::<GRID_SIZE> {}),
219 );
220 }
221 #[cfg(feature = "options")]
222 InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#::Pyramidrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#Pyramid# => {
223 self.transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(src, dst, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(PyramidalSseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/PyramidalSseQ0_15#::<GRID_SIZE> {}));
224 }
225 #[cfg(feature = "options")]
226 InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#::Prismrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#Prism# => {
227 self.transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(src, dst, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(PrismaticSseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/PrismaticSseQ0_15#::<GRID_SIZE> {}));
228 }
229 InterpolationMethodrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#::Linearrust-analyzer cargo moxcms 0.8.1 transform/InterpolationMethod#Linear# => {
230 self.transform_chunkrust-analyzer cargo moxcms 0.8.1 conversions/sse/t_lut3_to_3_q0_15/impl#[`TransformLut3x3SseQ0_15<T, U, SRC_LAYOUT, DST_LAYOUT, GRID_SIZE, BIT_DEPTH, BINS, BARYCENTRIC_BINS>`]transform_chunk().(src, dst, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/impl#[`Box<T>`]new().(TrilinearSseQ0_15rust-analyzer cargo moxcms 0.8.1 conversions/sse/interpolator_q0_15/TrilinearSseQ0_15#::<GRID_SIZE> {}));
231 }
232 }
233 }
234 }
235 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
236 }
237 }