HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I get the pixel data under the mouse cursor?

    Scheduled Pinned Locked Moved General Questions
    12 Posts 4 Posters 232 Views
    Loading More Posts
    • 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.
    • d.healeyD
      d.healey @Orvillain
      last edited by

      @Orvillain said in How do I get the pixel data under the mouse cursor?:

      How would I do this?

      I don't think this is possible

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      O 1 Reply Last reply Reply Quote 0
      • O
        Orvillain @d.healey
        last edited by

        @d-healey Because there's nothing like a getPixelData(x=a, y=b) method for panels I guess?

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @Orvillain
          last edited by

          @Orvillain Correct

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          O 1 Reply Last reply Reply Quote 0
          • O
            Orvillain @d.healey
            last edited by

            @d-healey ahhhhhhhh suckage. Hmmmm. I can definitely provide X/Y data in a JSON file, and parse the current position in relation to that, to be able to detect which image I am hovered over. But these images might overlap... which meannnnnssss.... hmmm, I need to think about it some more.

            Basically the goal here is... load a bunch of film strips that can potentially overlap with some transparent areas.... click on one of them, and trigger the filmstrip animation. But I can foresee that if the images are overlapping, I'll end up triggering the wrong animation if I click in a particular area where they overlap unintuitively.

            The ideal solution would be to parse the current pixel (or pixels in a grid around the mouse cursor) and detect if that particular sub panel is transparent or not. If it is, don't trigger the filmstrip animation. If it isn't, then trigger it.

            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @Orvillain
              last edited by

              @Orvillain you need to rethink that entire approach, even in JUCE it's almost impossible to query the actual pixel at a given position because the image data is passed to the GPU so the CPU will not now the blended state.

              O 1 Reply Last reply Reply Quote 1
              • O
                Orvillain @Christoph Hart
                last edited by

                @Christoph-Hart said in How do I get the pixel data under the mouse cursor?:

                @Orvillain you need to rethink that entire approach, even in JUCE it's almost impossible to query the actual pixel at a given position because the image data is passed to the GPU so the CPU will not now the blended state.

                Thanks. The only other thing that springs to mind right now is:

                Assemble the filmstrip panels as I want them.
                Provide a JSON file that gives click zone co-ordinates.
                On a click, check the current position, and check if it falls within a specific coordinate region.
                If it does, tell the film strip to animate.
                If it doesn't, do nothing.

                Christoph HartC 1 Reply Last reply Reply Quote 0
                • Christoph HartC
                  Christoph Hart @Orvillain
                  last edited by

                  @Orvillain I could add a wrapper to Path.contains(), then you can at least create shapes with hit zones using paths and test the hover state with the mouse positions, this relieves you from the burden of weird geometry and a JSON file.

                  LindonL O 2 Replies Last reply Reply Quote 2
                  • LindonL
                    Lindon @Christoph Hart
                    last edited by

                    @Christoph-Hart whilst this is a valid edge case is there any chance we get #581 fixed first - I have live users complaining:

                    Link Preview Image
                    EQ Display bug - Draggable Filter Panel not displaying "empty" correctly... · Issue #581 · christophhart/HISE

                    Please see this thread for a discussion and confirmation... https://forum.hise.audio/topic/10631/eq-display-bug-draggable-filter-panel Basically when the draggable filter panel has no nodes, it fails to clear the last loaded presets shap...

                    favicon

                    GitHub (github.com)

                    HISE Development for hire.
                    www.channelrobot.com

                    Christoph HartC 1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart @Lindon
                      last edited by

                      @Lindon yeah if we could please not hijack other threads with bumping your own issues. I know there is a lot of stuff that has accumulated over the last months and I‘ll chew through them in a sensible order but it shouldn‘t be determined by who screames the loudest.

                      LindonL 1 Reply Last reply Reply Quote 1
                      • LindonL
                        Lindon @Christoph Hart
                        last edited by

                        @Christoph-Hart ok yep - sorry mea culpa

                        HISE Development for hire.
                        www.channelrobot.com

                        1 Reply Last reply Reply Quote 0
                        • O
                          Orvillain @Christoph Hart
                          last edited by

                          @Christoph-Hart said in How do I get the pixel data under the mouse cursor?:

                          @Orvillain I could add a wrapper to Path.contains(), then you can at least create shapes with hit zones using paths and test the hover state with the mouse positions, this relieves you from the burden of weird geometry and a JSON file.

                          Hey Christoph, that sounds like it would be very useful.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          51

                          Online

                          1.7k

                          Users

                          11.7k

                          Topics

                          102.2k

                          Posts