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 38mins ago
mvahoney the codewitch2hrs 38mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
CPallini2hrs 33mins ago
mveCPallini2hrs 33mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
0x01AA2hrs 28mins ago
mve0x01AA2hrs 28mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
honey the codewitch2hrs 20mins ago
mvahoney the codewitch2hrs 20mins 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 14mins ago
mve0x01AA2hrs 14mins ago 
GeneralRe: I'm not sure whether to laugh or cry. Pin
PIEBALDconsult1 hr 1 min ago
mvePIEBALDconsult1 hr 1 min ago 
GeneralDomain hosting recommendations Pin
pkfox3hrs 2mins ago
professionalpkfox3hrs 2mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 54mins ago
professionalJeremy Falcon2hrs 54mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 49mins ago
professionalJeremy Falcon2hrs 49mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 43mins ago
professionalJeremy Falcon2hrs 43mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 40mins ago
professionalpkfox2hrs 40mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon2hrs 22mins ago
professionalJeremy Falcon2hrs 22mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox1 hr 56mins ago
professionalpkfox1 hr 56mins ago 
GeneralRe: Domain hosting recommendations Pin
Jeremy Falcon1 hr ago
professionalJeremy Falcon1 hr ago 
GeneralRe: Domain hosting recommendations Pin
pkfox16mins ago
professionalpkfox16mins ago 
GeneralRe: Domain hosting recommendations Pin
Ron Anders2hrs 39mins ago
Ron Anders2hrs 39mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA2hrs 34mins ago
mve0x01AA2hrs 34mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs 22mins ago
professionalpkfox2hrs 22mins ago 
GeneralRe: Domain hosting recommendations Pin
0x01AA2hrs 15mins ago
mve0x01AA2hrs 15mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch2hrs 12mins ago
mvahoney the codewitch2hrs 12mins ago 
GeneralRe: Domain hosting recommendations Pin
pkfox2hrs ago
professionalpkfox2hrs ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch1 hr 53mins ago
mvahoney the codewitch1 hr 53mins ago 
GeneralRe: Domain hosting recommendations Pin
theoldfool57mins ago
professionaltheoldfool57mins ago 
GeneralRe: Domain hosting recommendations Pin
dandy721 hr 52mins ago
dandy721 hr 52mins ago 
GeneralRe: Domain hosting recommendations Pin
honey the codewitch1 hr 51mins ago
mvahoney the codewitch1 hr 51mins 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.