-
-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bmp File Viewer + extras #2119
Merged
Merged
Bmp File Viewer + extras #2119
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* add literal str print in asyncmsg * remove debug things * accept suggestion per gull * fix documentary
* WIP * WIP * WIP * Corrected name * WIP * WIP * WIP * WIP * Added new calc * WIP * WIP * WIP * WIP * WIP * WIP * Added debug serial lines * WIP * Fixed issue * Fixed calculation issue * Added voltage to performance DFU menu * Added padding function and added voltage to perf menu * Clean up * Refactor * Fixed linting * Hides voltage if PP does not conatin IC * WIP showing battery % * made the percentage a int * Added % to header * Removed test UI * Removed comment * Added fix for precision too large * Added fix for precision too large * Linting
NotherNgineer
approved these changes
Apr 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a big pr, trying to get all the changes, with some documentation.
Got a new View BMPFileViewer. You pass a path to it and it tries to open the BMP file. It goes to full screen mode, and can exit via "enter" key on the keypad.
You can use most features of the new Widget in this app, described bellow.
This View won't replace splashviewer (could, but need to handle the exit part and show a popup if want to set up the splash screen, if the resolution is ok, ... not done this.)
Fileman is modified, so it'll look for the BMP extension. If a BMP file is opened, checks the dir. From the SPLASH dir, it opens the splashviewer, otherwise it opens the new BMPFV app.
File.cpp got 2 new functions, close(), and eof(). This way I can reuse the same BMP object, and open a new file, ...
BMPViewer is a new Widget.
This can load a BMP file and can zoom, and scroll in it. Default to 'enter' key, is to fit zoom, and scroll to 0,0 position. (enter key can be overrided to pass it to parent).
This widget can be any size, and in theory it can handle any size (uint32 x, int32 y) bmp image. (see BMPFile class).
SystemView got a new function set_app_fullscreen(). With this, you can hide / show the status bar. (Don't forget to set it back when you don't need it!)
UsbSerialAsyncmsg::asyncmsg got a float overload.
firmware/common/bmp.hpp got a breaking change! The height of the image can be negative, and this indicates the bottom-up parameter for viewers. ( see https://en.wikipedia.org/wiki/BMP_file_format )
BMPFile class.
With this class, you can open a BMP file, and manipulate it. Or create a new file. Need to mention, the create function is yet limited to top-to bottom format, and 3 byte color depth.
The image then can be expanded by Y axe. With this, you can receive APT, FAX, ... without knowing how long will be the RX.
You must use SEEK() function. The BMP width and height parameter is the number of pixels, but the seek(x,y) coordinates are 0 based. so can seek 0 --> (width-1), 0--> (height-1) px.
read_next_px() reades the pixel and advances to the next if it is not disabled.
write_next_px() also can be called multiple times, and writes px next to each other. But if you use the bottom-up format, don't forget to seek to the right y coordinate after each line.
If you don't set background, the file will contain garbage where there was no px written, but the creation and expansion will be much faster.
Won't load BMP files that has color table (<=8bit, ..). No memory to store and calculate that. Also constant seeking would slow down the process much.