template <bool align> void FillBgra(uint8_t * dst, size_t stride, size_t width, size_t height, uint8_t blue, uint8_t green, uint8_t red, uint8_t alpha) { if(align) assert(Aligned(dst) && Aligned(stride)); uint32_t bgra32 = uint32_t(alpha) | (uint32_t(red) << 8) | (uint32_t(green) << 16) | (uint32_t(blue) << 24); size_t alignedWidth = AlignLo(width, 4); v128_u8 bgra128 = (v128_u8)SetU32(bgra32); for(size_t row = 0; row < height; ++row) { Storer<align> _dst(dst); Store<align, true>(_dst, bgra128); for(size_t col = 4; col < alignedWidth; col += 4) Store<align, false>(_dst, bgra128); Flush(_dst); if(width != alignedWidth) Store<false>(dst + 4*(width - 4), bgra128); dst += stride; } }
bool CObject::SetU32(const char* name, _U32 index, _U32 val) { return SetU32(Zion::StringFormat("%s[%d]", name, index).c_str(), val); }