-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
extmod/modframebuf.c: Expose width(), height(), format(), and stride() accessors on framebuf.Framebuffer #7828
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
base: master
Are you sure you want to change the base?
Conversation
I provide access in a subclass. If you are going to do it in the base class I would recommend also providing access to the |
Thanks for the feedback, @peterhinch!
Yes, I also do this, but then I wanted to reimplement
This is a good suggestion. I'll do this, too. |
But what is the point to this? Again memory consumption? I was right this evening driven to make a subclass of FrameBuffer for testing my new Framebuffer.get_rect(x, y, w, h) functionality. The subclass makes the convoluted test (lots of parameter combinations) even more complicated and tests should be simple. Also it is IMHO not really Pythonic if an Instance property is write only. In any case it is error prone to have state double accounted. And the double accounting of state becomes not better if it is distributed between two languages. Used in production a subclass will take IMHO more runtime RAM in the python space than the Data access handlers of @theidealist in the C-Space, where the information (w, h, buf, ..) is already stored. @theidealist @peterhinch cetero censeo : Part1
and compile a lean micropython, without. cetero censeo : Part2
Cheers, |
Thanks for the response, @volkerjaenisch
I agree with your assessment (if I understand it correctly), but I'm not sure how to provide numbers to support it. Do you mean you'd like to have numbers that show how much RAM a FrameBuffer subclass in Python that stores the width and height in Python uses compared to a FrameBuffer like mine, which just exposes the already-stored data via accessors? I am new to micropython and so am not sure how to get such numbers.
I apologize if this has become a "negative discussion" somewhere. I truly did not mean it as such -- I was only trying to contribute to a project I find immensely useful. I, personally, am using the esp32 port on a few devices with various small displays and was, for what it's worth, delighted that FrameBuffer support was provided "out of the box" and that I only had to get into learning how to build and deploy my own firmware once I was ready. I did not intend to stifle anyone's creativity and am happy to have the pull-request denied if it is displeasing to senior developers. I've got my own fork -- I can always do with that whatever I want (open source FTW!). |
@theidealist Like you I proposed a simple, reasonable extension to Micropython. Like you I was not greeted with open arms but deflection. Cheers, |
@volkerjaenisch I was merely stating a fact. Not advocating against doing it in the base class.
This surely offers support for doing it in the base class, which I happen to think is a good idea. |
@peterhinch @theidealist Cheers, |
Is there anything I can or should do to have this PR approved or rejected? Anyone know an appropriate maintainer to reach out to? Not trying to be pushy, just curious. |
@dpgeorge -- I see you've done a lot of the work in the extmod/modframebuf git log. What are your thoughts on this PR? |
@peterhinch / @dpgeorge -- do you think I should just abandon this PR or is there a chance it will be reviewed and accepted? |
@theidealist I am not a maintainer, but I think they are busy at the moment. There is quite a queue of pending PR's. |
@dpgeorge -- do you think I should just abandon this PR or is there a chance it will be reviewed and accepted? |
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
It can be helpful when building up native python libraries that utilize external
framebuf.Framebuffer
s to know the width and height of those objects. This PR adds four simple methods toframebuf.Framebuffer
that permit retrieval of width, height, format and stride.Tested locally on the ESP32 GENERIC board port: