engine/dlib/src/dlib/webp.cpp
// Compose WebP 32-bit color RGBA into RGBA4444 data.
Compose WebP 32-bit color RGBA into RGBA4444 data.
Compose WebP 32 - bit color RGBA into RGBA4444 data .
static inline void ComposeRGBA4444(uint16_t* dest, uint8_t* src, uint32_t elements)
    {
        for(uint32_t i = 0; i < elements; ++i)
        {
            uint16_t p = (((uint16_t) *(src++)) << 8) & 0xf000;
            p |= (((uint16_t) *(src++)) << 4) & 0xf00;
            p |= ((uint16_t) *(src++)) & 0xf0;
            p |= (((uint16_t) *(src++)) >> 4) & 0xf;
            *(dest++) = p;
        }
    }
static inline void ComposeRGBA4444 ( uint16_t * dest , uint8_t * src , uint32_t elements ) { for ( uint32_t i = 0 ; i < elements ; ++ i ) { uint16_t p = ( ( ( uint16_t ) * ( src ++ ) ) << 8 ) & 0xf000 ; p |= ( ( ( uint16_t ) * ( src ++ ) ) << 4 ) & 0xf00 ; p |= ( ( uint16_t ) * ( src ++ ) ) & 0xf0 ; p |= ( ( ( uint16_t ) * ( src ++ ) ) >> 4 ) & 0xf ; * ( dest ++ ) = p ; } }
Compose WebP 32-bit color RGBA into RGBA4444 data.
Compose WebP 32 - bit color RGBA into RGBA4444 data .