Click here to Skip to main content
16,011,626 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralI'm not sure whether to laugh or cry. Pin
honey the codewitch2hrs 40mins ago
mvahoney the codewitch2hrs 40mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
CPallini2hrs 35mins ago
mveCPallini2hrs 35mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
0x01AA2hrs 30mins ago
mve0x01AA2hrs 30mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
honey the codewitch2hrs 22mins ago
mvahoney the codewitch2hrs 22mins ago 
It's not windows. (Well, it can be, but it's embedded/cross platform)

It's based on the fact that the plutosvg library I used uses argb and rgba but LITTLE ENDIAN overall.

The thing is, since shifts are reversed for big vs little endian in C/C++ big endian RGBA = little endian ABGR

My graphics library produces big endian footprints for pixels on little endian systems. The reason for that is almost all display hardware takes its frame buffer memory in big endian format.

I'd change plutovg to use big endian pixels but I don't understand this function:

C++
static inline uint32_t BYTE_MUL(uint32_t x, uint32_t a)
{
    uint32_t t = (x & 0xff00ff) * a;
    t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
    t &= 0xff00ff;
    x = ((x >> 8) & 0xff00ff) * a;
    x = (x + ((x >> 8) & 0xff00ff) + 0x800080);
    x &= 0xff00ff00;
    x |= t;
    return x;
}


The exception would be things like a windows PC, * but * in that case it's 1 byte per pixel, making swapping them easy, whereas byte swapping a 16-bit RGB565 pixel is less straightforward.

So since plutovg is RGBA little endian, my vector pixel format is ABGR big endian. In my library, conversions between different pixel formats is transparent so it really doesn't impact the surface area of the API.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

PraiseRe: I'm not sure whether to laugh or cry. Pin
0x01AA2hrs 16mins ago
mve0x01AA2hrs 16mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
PIEBALDconsult1 hr 3mins ago
mvePIEBALDconsult1 hr 3mins ago 
GeneralDomain hosting recommendations Pin
pkfox3hrs 4mins ago
professionalpkfox3hrs 4mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 56mins ago
professionalJeremy Falcon2hrs 56mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 51mins ago
professionalJeremy Falcon2hrs 51mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 45mins ago
professionalJeremy Falcon2hrs 45mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 42mins ago
professionalpkfox2hrs 42mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 24mins ago
professionalJeremy Falcon2hrs 24mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox1 hr 58mins ago
professionalpkfox1 hr 58mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon1 hr 2mins ago
professionalJeremy Falcon1 hr 2mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox18mins ago
professionalpkfox18mins ago 
GeneralRe: Domain hosting recommendations Pin
Ron Anders2hrs 41mins ago
Ron Anders2hrs 41mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA2hrs 36mins ago
mve0x01AA2hrs 36mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 24mins ago
professionalpkfox2hrs 24mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA2hrs 17mins ago
mve0x01AA2hrs 17mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch2hrs 14mins ago
mvahoney the codewitch2hrs 14mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 2mins ago
professionalpkfox2hrs 2mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch1 hr 55mins ago
mvahoney the codewitch1 hr 55mins ago 
GeneralRe: Domain hosting recommendations Pin
theoldfool59mins ago
professionaltheoldfool59mins ago 
GeneralRe: Domain hosting recommendations Pin
dandy721 hr 54mins ago
dandy721 hr 54mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch1 hr 53mins ago
mvahoney the codewitch1 hr 53mins ago 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.