I have made a function for posterizing images.
// =( #define ARGB_COLOR(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) inline UINT
A combination of _mm_shuffle_epi8 and _mm_cvtsi128_si32 is what you need:
_mm_shuffle_epi8
_mm_cvtsi128_si32
static const __m128i shuffleMask = _mm_setr_epi8(0, 4, 8, 12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1); UINT color = _mm_cvtsi128_si32(_mm_shuffle_epi8(iClr, shuffleMask));