Skip to content

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]>
@lgritz
Copy link
Collaborator Author

lgritz commented Feb 15, 2025

I will merge this soon if there are no objections.

@lgritz lgritz merged commit 122e6ae into AcademySoftwareFoundation:main Feb 20, 2025
66 checks passed
@lgritz lgritz deleted the lg-bytes branch March 8, 2025 20:22
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 17, 2025
…areFoundation#4631)

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]>
Signed-off-by: Scott Wilson <[email protected]>
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 18, 2025
…areFoundation#4631)

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]>
Signed-off-by: Scott Wilson <[email protected]>
zachlewis pushed a commit to zachlewis/OpenImageIO that referenced this pull request Sep 1, 2025
…areFoundation#4631)

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