-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Expose and document Image.get_mipmap_count()
#74142
Conversation
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.
Sounds good to me 🙂
Documentation-wise, these methods are likely worth referencing in the create_from_image()
method's description, or whichever method lets you create a new Image with a mipmaps parameter.
I added some references to these new methods to If anyone wants to tweak the wording let me know, I can write some pretty clumsy documentation sometimes. |
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.
Implementation looks good to me, and in principle it makes sense to me to expose this information for users.
Documentation looks great.
The partial duplicate #79368 confirms that there's some demand for the mipmap count.
Neither have a proposal, so I'd like @reduz to sign off on the addition, or clarify if there are any reason he would not expose this.
I would like to avoid exposing further API as dictionaries, at least until the structs proposal is approved and implemented. Alternatively you could have 3 functions:
|
2cdc26d
to
16c3a19
Compare
I agree with the API decision to avoid Dictionaries for now. Considering we will have to live with any exposed API for a long time, I didn't add individual getters like For future reference, adding the a struct API will probably make exposing these details in a more convenient easier in the future. Also, eventually exposing some version of |
Image.get_mipmap_count()
Thanks! |
Adds a new method
Image.get_mipmap_details()
and exposes an already existing methodImage.get_mipmap_count()
. Also documents both. This makes it possible to efficiently manipulate raw mipmap data. It was technically possible before, but the calculations required are not trivial to do and very error prone.