Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. I'm not sure whether to laugh or cry.

I'm not sure whether to laugh or cry.

Scheduled Pinned Locked Moved The Lounge
designhelpcomgraphicsiot
7 Posts 5 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • honey the codewitchH Offline
    honey the codewitchH Offline
    honey the codewitch
    wrote on last edited by
    #1

    I fixed a bunch of bugs in terms of color byte order (I had switched from RGBA to ABGR) which I hoped would fix my SVG rendering, whose colors are off. After finding and squashing a bunch of bugs (and watching the colors change accordingly) the last bug I fixed put my output clear back where I started! So that was my morning. :doh:

    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

    CPalliniC 0 P StarNamer workS 4 Replies Last reply
    0
    • honey the codewitchH honey the codewitch

      I fixed a bunch of bugs in terms of color byte order (I had switched from RGBA to ABGR) which I hoped would fix my SVG rendering, whose colors are off. After finding and squashing a bunch of bugs (and watching the colors change accordingly) the last bug I fixed put my output clear back where I started! So that was my morning. :doh:

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      Have a colorful day! :-D

      "In testa che avete, Signor di Ceprano?" -- Rigoletto

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • honey the codewitchH honey the codewitch

        I fixed a bunch of bugs in terms of color byte order (I had switched from RGBA to ABGR) which I hoped would fix my SVG rendering, whose colors are off. After finding and squashing a bunch of bugs (and watching the colors change accordingly) the last bug I fixed put my output clear back where I started! So that was my morning. :doh:

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

        0 Offline
        0 Offline
        0x01AA
        wrote on last edited by
        #3

        Why you switched from 'RGBA to ABGR'? From what I remember, 'ABGR' is really a native Windows API thing, which has even corrected with wpf.

        honey the codewitchH 1 Reply Last reply
        0
        • 0 0x01AA

          Why you switched from 'RGBA to ABGR'? From what I remember, 'ABGR' is really a native Windows API thing, which has even corrected with wpf.

          honey the codewitchH Offline
          honey the codewitchH Offline
          honey the codewitch
          wrote on last edited by
          #4

          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:

          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

          0 1 Reply Last reply
          0
          • honey the codewitchH honey the codewitch

            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:

            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

            0 Offline
            0 Offline
            0x01AA
            wrote on last edited by
            #5

            Got it, I think :-D

            1 Reply Last reply
            0
            • honey the codewitchH honey the codewitch

              I fixed a bunch of bugs in terms of color byte order (I had switched from RGBA to ABGR) which I hoped would fix my SVG rendering, whose colors are off. After finding and squashing a bunch of bugs (and watching the colors change accordingly) the last bug I fixed put my output clear back where I started! So that was my morning. :doh:

              Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              Three lefts make a right.

              1 Reply Last reply
              0
              • honey the codewitchH honey the codewitch

                I fixed a bunch of bugs in terms of color byte order (I had switched from RGBA to ABGR) which I hoped would fix my SVG rendering, whose colors are off. After finding and squashing a bunch of bugs (and watching the colors change accordingly) the last bug I fixed put my output clear back where I started! So that was my morning. :doh:

                Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

                StarNamer workS Offline
                StarNamer workS Offline
                StarNamer work
                wrote on last edited by
                #7

                honey the codewitch wrote:

                the last bug I fixed put my output clear back where I started

                Been there. Done that. :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups