Click here to Skip to main content
16,011,611 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 codewitch4hrs 27mins ago
mvahoney the codewitch4hrs 27mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
CPallini4hrs 22mins ago
mveCPallini4hrs 22mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
0x01AA4hrs 17mins ago
mve0x01AA4hrs 17mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
honey the codewitch4hrs 9mins ago
mvahoney the codewitch4hrs 9mins 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
0x01AA4hrs 3mins ago
mve0x01AA4hrs 3mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
PIEBALDconsult2hrs 50mins ago
mvePIEBALDconsult2hrs 50mins ago 
GeneralDomain hosting recommendations Pin
pkfox4hrs 51mins ago
professionalpkfox4hrs 51mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon4hrs 43mins ago
professionalJeremy Falcon4hrs 43mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon4hrs 38mins ago
professionalJeremy Falcon4hrs 38mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon4hrs 32mins ago
professionalJeremy Falcon4hrs 32mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox4hrs 29mins ago
professionalpkfox4hrs 29mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon4hrs 11mins ago
professionalJeremy Falcon4hrs 11mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox3hrs 45mins ago
professionalpkfox3hrs 45mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 49mins ago
professionalJeremy Falcon2hrs 49mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 5mins ago
professionalpkfox2hrs 5mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon1 hr 39mins ago
professionalJeremy Falcon1 hr 39mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox1 hr 25mins ago
professionalpkfox1 hr 25mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon1 hr 6mins ago
professionalJeremy Falcon1 hr 6mins ago 
GeneralRe: Domain hosting recommendations Pin
Ron Anders4hrs 28mins ago
Ron Anders4hrs 28mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA4hrs 23mins ago
mve0x01AA4hrs 23mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox4hrs 11mins ago
professionalpkfox4hrs 11mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA4hrs 4mins ago
mve0x01AA4hrs 4mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch4hrs 1 min ago
mvahoney the codewitch4hrs 1 min ago 
GeneralRe: Domain hosting recommendations Pin
pkfox3hrs 49mins ago
professionalpkfox3hrs 49mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch3hrs 42mins ago
mvahoney the codewitch3hrs 42mins 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.