-
Notifications
You must be signed in to change notification settings - Fork 65
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
Document ssd1306_display_image #17
Comments
oid ssd1306_display_image(SSD1306_t * dev, int page, int seg, uint8_t * images, int width) documentation about page and seg(=segment) is here. |
Could you write or provide a helper function to draw bitmaps? I'm reading the datasheet now, but I just need an abstraction API to draw a simple uint8_t byte buffer containing monchrome image data. |
Bitmap drawing can be done with this function. oid ssd1306_display_image(SSD1306_t * dev, int page, int seg, uint8_t * images, int width) This is API to draw a simple uint8_t byte buffer containing monchrome image data.
|
Like I posted in the other issue, having an abstraction that takes a XBM buffer would be ideal, because that is what everyone uses and the industry standard. I understand that at low-level you have to write the segments across each page... I read the datasheet. But having a function that abstracts the whole process (including size calculations) is nice to have and more people will use your library, simply because the rest are Arduino centric. ESP32 with ESP-IDF for example cannot use U8G2 since it has a broken HAL for ESP32. Your I2C code worked out of the box for me. |
A sample XBM:
|
Really? I still don't understand the advantages of XBM buffer. What are the benefits of using XBM buffer? Is there an official specification for the XBM buffer? If the XBM buffer format is officially present and this is very informative, I will make it. ssd1306_display_xbm(&dev, logoMischianti); |
Not sure if you are being serious but I'm certainly not going to pick an argument with a stranger over the Internet... So, I will answer your questions and bask in some good karma:
I might be misinterpreting your reactions, but I think I will just let it be. Note that I did not even comment about box, circle or polygon drawing, which other libraries also do. I merely asked for XBM because it is literally the single most common use case scenario: have some text screens, logo as screensaver, perhaps a scrolling menu... |
I wanted to know this. |
I will cleanup the small helper function I wrote, but it assumes vertically drawn XBMP is already provided. I appreciate the work you put into this library already. |
Vertically drawn XBMP is difficult for humans to understand. I am considering support for horizontally drawn XBMP. The horizontal XBMP to vertical XBMP conversion function is complete. I'm considering whether to draw on pages units fom 0 to 7 or introduce a coordinate system from 0 to 63 |
Indeed, it is cumbersome also because you need to convert the original image to the XBMP buffer knowing that it needs to be vertically drawn, so there is some transformation required, else the image will be drawn garbled (squeezed into a rectangle). My helper function more or less follows this:
This assumes 128x64 sized buffers, that can be obviously evenly divided into the 0..7 pages and 0..127 segments. |
I have added the functionality of XBM bitmap. Thank you for telling me various things. https://github.com/nopnop2002/esp-idf-ssd1306/tree/master/ImageDemo |
No need to thank me, thank you for your time and effort. I will review the changes more closely but what I've seen looks good. Much cleaner than what I did. |
I'm trying to figure out how to use ssd1306_display_image() to display a monochrome image stored in a byte buffer.
There is no documentation or samples on how to do this.
The text was updated successfully, but these errors were encountered: