Closed bit69tream closed 1 year ago
That's an interesting feature.
Obviously, you need to know the start address of the memory buffer. Do you need to know the size of the memory buffer? Or does GF figure that out somehow?
Also, the image could be: png, bmp, etc.... ?
Here you can see a pop-up which you can use to add bitmaps. You are required to provide image dimensions because the image itself is assumed to be a flat array of RGBA pixels.
I personally think that this format is enough for most use cases.
It would also be really handy having an option to choose pixel format (RGBA, RGB, BGR, etc), which GF doesn't have at the moment.
Okay. Thanks for the screenshot. I'll play around with it.
I use Qt as the gui toolkit. It has a number of formats it support. Could you look at this page and see which ones you want supported for the first cut?
I'll start with these.
RGBA8888
and RGB888
is honestly enough for me.
I almost always use stb_image.h header-only lib for loading images and those are formats in which this library usually gives data.
Got it. I'll start with those two.
BTW, how big are the images you typically view? (width x height)
I think it's usually around 2k pixels on each size. Why do you ask?
I'm encountering a speed issue in my code. Just wondering how fast GF is when you attempt to view an image. Is it instant?
Yes, it is.
I have some speed issues to work out, but the image viewer is coming along.
Looks nice!
Good and bad news. :)
I've added the Image viewer to the MemoryVisualizer. Works well.
I've identified the slowness.The other 2 tabs in the MemoryVisualizer are the culprits (Hex and Assembly tabs).
I use Qt's QPlainTextEdit widget. It's EXTREMELY slow for large number of lines. With images (800K bytes), this results in a lot of text lines. Bogs down the QPlainTextEdit.
While I have updated the code to git, it's basically not usable yet. I need to find a replacement for QPlainTextEdit. Will let you know.
Oh yeah it's really slow. Excited to see it working fast!
And I also thing there is more room for QoL improvement!
width
and height
fields?bytes
field is a bit annoying. I end up trying to display image first and putting in the number from the message at the bottom anyways.Tbh I don't really see a purpose for the bytes
field while viewing images anyway ¯\(ツ)/¯.
I cougld help implementing these btw. Would love to help the project with more that just feature suggestions! :D
I'll remove what I added to the "MemoryVisualizer" and I think I'll make a separate "ImageVisualizer".
The width and height fields can be made to accept a variable name, function name, or a literal. A bytes field isn't necessary.
Thanks for the suggestions!
I've made a new "ImageVisualizer" and reverted the "MemoryVisualizer" back to the way it was before.
Select one of these two methods to launch it.
Enter the variable name and hit ENTER. It should fill in the variable's address.
For now, you need to enter the width and height (in pixels) and select which format. Hit REFRESH or ENTER will show the image. I'll work on allowing the width and height fields to take a variable.
You can interact with the image to zoom in or out.
'+' zoom in
'-' zoom out
<ESC> reset to default zoom level.
^P print image.
Doh! Didn't mean to close this task yet.
Wow! An ability to zoom in/out is awesome!
I fixed the "SAVE" and "PRINT" icons. And I felt I needed to remove the "^P" for printing.
I'm going to close this task. I've created another task to allow a variable expression to be entered for the width/height size. As this can be added to other visualizers.
Before seer i've been using gf and tbh there is only one feature i really miss - an ability to view images from the memory of a debuggee.
You can see it in action here:
Would really appreciate if this feature was to be implemented in seer :)