Krita Source Code Documentation
Loading...
Searching...
No Matches
KoRgbaInterleavers< 16 > Struct Reference

#include <KoRgbaInterleavers.h>

Static Public Member Functions

template<typename T , typename A , bool aligned = false>
static void deinterleave (const void *src, batch< T, A > &a, batch< T, A > &b)
 
template<bool aligned, typename T , typename A , enable_sized_integral_t< T, 4 > = 0, enable_sized_vector_t< T, A, 4 > = 0>
static void deinterleave (const void *src, batch< T, A > &dst1, batch< T, A > &dst2, kernel::requires_arch< generic >)
 
template<typename T , typename A , bool aligned = false>
static void interleave (void *dst, batch< T, A > const &a, batch< T, A > const &b)
 
template<bool aligned, typename T , typename A , enable_sized_integral_t< T, 4 > = 0, enable_sized_vector_t< T, A, 4 > = 0>
static void interleave (void *dst, batch< T, A > const &a, batch< T, A > const &b, kernel::requires_arch< generic >)
 

Detailed Description

Definition at line 97 of file KoRgbaInterleavers.h.

Member Function Documentation

◆ deinterleave() [1/2]

template<typename T , typename A , bool aligned = false>
static void KoRgbaInterleavers< 16 >::deinterleave ( const void * src,
batch< T, A > & a,
batch< T, A > & b )
inlinestatic

Definition at line 179 of file KoRgbaInterleavers.h.

180 {
181 return deinterleave<aligned>(src, a, b, A{});
182 }

References A.

◆ deinterleave() [2/2]

template<bool aligned, typename T , typename A , enable_sized_integral_t< T, 4 > = 0, enable_sized_vector_t< T, A, 4 > = 0>
static void KoRgbaInterleavers< 16 >::deinterleave ( const void * src,
batch< T, A > & dst1,
batch< T, A > & dst2,
kernel::requires_arch< generic >  )
inlinestatic

Definition at line 135 of file KoRgbaInterleavers.h.

136 {
137 const auto *srcPtr = static_cast<const T *>(src);
138 using U = std::conditional_t<aligned, aligned_mode, unaligned_mode>;
139
140 const auto a = batch<T, A>::load(srcPtr, U{});
141 const auto b = batch<T, A>::load(srcPtr + batch<T, A>::size, U{});
142 const auto t1 = zip_lo(a, b);
143 const auto t2 = zip_hi(a, b);
144 dst1 = zip_lo(t1, t2);
145 dst2 = zip_hi(t1, t2);
146 }

◆ interleave() [1/2]

template<typename T , typename A , bool aligned = false>
static void KoRgbaInterleavers< 16 >::interleave ( void * dst,
batch< T, A > const & a,
batch< T, A > const & b )
inlinestatic

Definition at line 129 of file KoRgbaInterleavers.h.

130 {
131 return interleave<aligned>(dst, a, b, A{});
132 }

References A.

◆ interleave() [2/2]

template<bool aligned, typename T , typename A , enable_sized_integral_t< T, 4 > = 0, enable_sized_vector_t< T, A, 4 > = 0>
static void KoRgbaInterleavers< 16 >::interleave ( void * dst,
batch< T, A > const & a,
batch< T, A > const & b,
kernel::requires_arch< generic >  )
inlinestatic

Definition at line 99 of file KoRgbaInterleavers.h.

100 {
101 auto *dstPtr = static_cast<T *>(dst);
102 using U = std::conditional_t<aligned, aligned_mode, unaligned_mode>;
103 const auto t1 = zip_lo(a, b);
104 const auto t2 = zip_hi(a, b);
105 t1.store(dstPtr, U{});
106 t2.store(dstPtr + batch<T, A>::size, U{});
107 }

The documentation for this struct was generated from the following file: