Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bradh
Copy link
Collaborator

@bradh bradh commented Dec 17, 2025

This matches the results of the file9.jp2 sample.

Resolves #46

@bradh bradh assigned iszak and unassigned iszak Dec 17, 2025
@bradh bradh requested a review from iszak December 17, 2025 09:11
reader.read_exact(&mut value_bytes)?;
u16::from_be_bytes(value_bytes) as u32
}
_ => unimplemented!(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have: 32-bit support might be worth implementing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it would be nice, I don't think paletted colour with > 16 bits per component is that likely.

I allowed for up to 32 bits in the API, and 32 bits isn't that hard to do. The 24 bit case is somewhat messier though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it's unlikely and we can always add it later.

This matches the results of the file9.jp2 sample.

Resolves iszak#46
j += 1;
for _ in 0..num_entries {
let mut entry_components = Vec::<u32>::with_capacity(num_palette_columns as usize);
for i in 0..num_palette_columns as usize {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, you could use entry_components.capacity()

@iszak
Copy link
Owner

iszak commented Dec 23, 2025

LGTM 👍

@iszak iszak merged commit 2714cb1 into iszak:main Dec 23, 2025
4 checks passed
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.

Palette box decoding problems

3 participants