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 too sick for this nonsense

I'm too sick for this nonsense

Scheduled Pinned Locked Moved The Lounge
designhelpcomgraphics
7 Posts 5 Posters 2 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.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    Update: Not a compiler bug. User error. GCC is more forgiving and the error message was weird. That was my first suspicion but after banging on it for an hour I decided it wasn't me. Then I posted here, which invoked Murphy's Law by making me look like an idiot, but at least my code works now, so it did its job. :laugh:

    template class has_channel_names_impl;
    template
    class has_channel_names_impl {
    using chidx = typename PixelType::template channel_index_by_name;
    public:
    constexpr static const bool value = (-1!= chidx::value) &&
    has_channel_names_impl::value;
    };
    template
    class has_channel_names_impl {
    public:
    constexpr static const bool value = true;
    };

    This isn't pretty, but what it does is it looks through a pixel definition to see if the pixel has a channel or channels with particular names, at compile time. So Microsoft, explain to me the situation in which value does not resolve to a compile time constant, because that's what your compiler is telling me sometimes. Apparently it depends on the context in which it's being used/instantiated, or maybe the day of the week. Who knows? I'm not well. I don't need compiler bugs right now.

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

    C B 2 Replies Last reply
    0
    • H honey the codewitch

      Update: Not a compiler bug. User error. GCC is more forgiving and the error message was weird. That was my first suspicion but after banging on it for an hour I decided it wasn't me. Then I posted here, which invoked Murphy's Law by making me look like an idiot, but at least my code works now, so it did its job. :laugh:

      template class has_channel_names_impl;
      template
      class has_channel_names_impl {
      using chidx = typename PixelType::template channel_index_by_name;
      public:
      constexpr static const bool value = (-1!= chidx::value) &&
      has_channel_names_impl::value;
      };
      template
      class has_channel_names_impl {
      public:
      constexpr static const bool value = true;
      };

      This isn't pretty, but what it does is it looks through a pixel definition to see if the pixel has a channel or channels with particular names, at compile time. So Microsoft, explain to me the situation in which value does not resolve to a compile time constant, because that's what your compiler is telling me sometimes. Apparently it depends on the context in which it's being used/instantiated, or maybe the day of the week. Who knows? I'm not well. I don't need compiler bugs right now.

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

      C Offline
      C Offline
      charlieg
      wrote on last edited by
      #2

      nope, sorry. You beat your head on this for an hour. You had three choices: 1) go take a dump. bring notebook; 2) take a shower, while washing hair answer will come to you; 3) Post on CP, answer will become immediately obvious - where's the delete button. There is an option 4, post on stackoverflow (worst site ever imho) and get reamed for being stupid, reposting, duplicating, yada yada.

      Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

      H 1 Reply Last reply
      0
      • C charlieg

        nope, sorry. You beat your head on this for an hour. You had three choices: 1) go take a dump. bring notebook; 2) take a shower, while washing hair answer will come to you; 3) Post on CP, answer will become immediately obvious - where's the delete button. There is an option 4, post on stackoverflow (worst site ever imho) and get reamed for being stupid, reposting, duplicating, yada yada.

        Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #3

        Well, it worked. Y'all got to be my rubber duck. As an aside, MSVC++ gives the WORST error messages.

        static inline gfx_result image(Destination& destination, const rect16& destination_rect, const image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);

        It said this function did not take 5 arguments. I was pulling my hair out for an hour on this too.

        static inline gfx_result image(Destination& destination, const rect16& destination_rect, const ::gfx::image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);

        That fixed it. ETA: It may look strange to call the method image that itself takes an image. It's part of my draw facilities and ends up getting used like this:

        png_image img(VisualFA128);
        gfx_result r = img.initialize();
        if(r!=gfx_result::success) {
        printf("img init failure %d\n",(int)r);
        while(1);
        }
        r=draw::image(panel_fb,img.bounds().center(panel_fb.bounds()),img);
        if(r!=gfx_result::success) {
        printf("draw error: %d\n",(int)r);
        }

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

        pkfoxP 1 Reply Last reply
        0
        • H honey the codewitch

          Well, it worked. Y'all got to be my rubber duck. As an aside, MSVC++ gives the WORST error messages.

          static inline gfx_result image(Destination& destination, const rect16& destination_rect, const image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);

          It said this function did not take 5 arguments. I was pulling my hair out for an hour on this too.

          static inline gfx_result image(Destination& destination, const rect16& destination_rect, const ::gfx::image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);

          That fixed it. ETA: It may look strange to call the method image that itself takes an image. It's part of my draw facilities and ends up getting used like this:

          png_image img(VisualFA128);
          gfx_result r = img.initialize();
          if(r!=gfx_result::success) {
          printf("img init failure %d\n",(int)r);
          while(1);
          }
          r=draw::image(panel_fb,img.bounds().center(panel_fb.bounds()),img);
          if(r!=gfx_result::success) {
          printf("draw error: %d\n",(int)r);
          }

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

          pkfoxP Offline
          pkfoxP Offline
          pkfox
          wrote on last edited by
          #4

          What did you change ? Edit just spotted it ::gfx:: No wonder it had you flummoxed

          In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

          H 1 Reply Last reply
          0
          • pkfoxP pkfox

            What did you change ? Edit just spotted it ::gfx:: No wonder it had you flummoxed

            In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #5

            1st vs 2nd codeblock in the previous comment, 3rd parameter to the function from const image& to const ::gfx::image&

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

            J 1 Reply Last reply
            0
            • H honey the codewitch

              1st vs 2nd codeblock in the previous comment, 3rd parameter to the function from const image& to const ::gfx::image&

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

              J Offline
              J Offline
              jmaida
              wrote on last edited by
              #6

              I guess it's just old guy symptom but you folks write code in code.

              "A little time, a little trouble, your better day" Badfinger

              1 Reply Last reply
              0
              • H honey the codewitch

                Update: Not a compiler bug. User error. GCC is more forgiving and the error message was weird. That was my first suspicion but after banging on it for an hour I decided it wasn't me. Then I posted here, which invoked Murphy's Law by making me look like an idiot, but at least my code works now, so it did its job. :laugh:

                template class has_channel_names_impl;
                template
                class has_channel_names_impl {
                using chidx = typename PixelType::template channel_index_by_name;
                public:
                constexpr static const bool value = (-1!= chidx::value) &&
                has_channel_names_impl::value;
                };
                template
                class has_channel_names_impl {
                public:
                constexpr static const bool value = true;
                };

                This isn't pretty, but what it does is it looks through a pixel definition to see if the pixel has a channel or channels with particular names, at compile time. So Microsoft, explain to me the situation in which value does not resolve to a compile time constant, because that's what your compiler is telling me sometimes. Apparently it depends on the context in which it's being used/instantiated, or maybe the day of the week. Who knows? I'm not well. I don't need compiler bugs right now.

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

                B Offline
                B Offline
                BryanFazekas
                wrote on last edited by
                #7

                I've spent all day beating on a problem with no success. Then: 1) I put it away, the next morning I spot the problem in 3 seconds. 2) Or, I call someone over; they spot the problem in 3 seconds. 3) Or, I call someone over; then *I* spot the problem in 3 seconds. Of course, I've had co-workers call me to help, and I spot the problem in 3 seconds. Typically, the person feels stupid, but the reality is that after staring at something too long, we don't see what's there -- we see what we expect to be there. The best course of action is to walk away for an hour -- do something else, then come back. To be fair, not all problems are solved so easily. My freshman year in college, working on a DEC/VAX, the program I wrote was failing to compile on a specific line, and the error made no sense. I took it to the professor, and he acted disgusted, expecting a newbie programmer problem. He read through that section twice. Frowned, and said, "That is written correctly." He thought for another moment and said, "Delete that line plus the one above and below. Retype them." An unprintable character had been inserted into the file and the compiler choaked on it. Retyping those 3 lines solved it.

                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