Skip to content
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

api: ImageSpec::scanline_bytes, tile_bytes, image_bytes #4631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Feb 11, 2025

Existing versions could return the expected bytes for a scanline, tile, or image for either the native per-channel types, or the single composite channel type.

The new flavor lets you pass in any data type and it tells you how many bytes you'd need for a scanline, tile, or image if all channels were the passed type. (As a special case, the answer for TypeUnknown is the "native" size, same as thing_bytes(true)).

This is handy for computing how big your buffer needs to be to hold a type-converted scanline or tile.

Existing versions could return the expected bytes for a scanline,
tile, or image for either the native per-channel types, or the single
composite channel type.

The new flavor lets you pass in any data type and it tells you how
many bytes you'd need for a scanline, tile, or image if all channels
were the passed type. (As a special case, the answer for TypeUnknown
is the "native" size, same as `thing_bytes(true)`).

This is handy for computing how big your buffer needs to be to hold a
type-converted scanline or tile.

Signed-off-by: Larry Gritz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant