Skip to content

feat!: Handle transparency/nodata bit masks#205

Merged
kylebarron merged 5 commits intomainfrom
kyle/handle-loading-bitmask
Jan 29, 2026
Merged

feat!: Handle transparency/nodata bit masks#205
kylebarron merged 5 commits intomainfrom
kyle/handle-loading-bitmask

Conversation

@kylebarron
Copy link
Member

@kylebarron kylebarron commented Jan 29, 2026

TIFF supports storing nodata values in a transparency bitmask.

Instead of exposing the raw bitmask itself to users, I decided that it would be a better API to expose a Vec<bool> in the TypedArray. This requires a copy from the bitmask to the Vec<bool>.

In the future, we could add some sort of BooleanArray abstraction like Arrow that interprets the raw bits, but I think this is fine for now.

Then in the Python API we expose the Vec<bool> zero-copy through the buffer protocol as a uint8 array.

Change list

  • Adds Bool variant to DataType.
  • Adds Bool(Vec<bool>) variant to TypedArray.
  • Python: Expose boolean data through buffer protocol. The Vec<bool> is exposed as a uint8 array of 0/1 values
  • Python: Fix: Expose .shape as tuple[int, int, int], not as list[int]
  • Python: Add test with vantor data

@github-actions github-actions bot added the feat label Jan 29, 2026
@kylebarron kylebarron changed the title feat: Handle bit masks feat!: Handle transparency/nodata bit masks Jan 29, 2026
@kylebarron kylebarron enabled auto-merge (squash) January 29, 2026 19:12
@kylebarron kylebarron disabled auto-merge January 29, 2026 19:12
@kylebarron kylebarron merged commit a56e586 into main Jan 29, 2026
13 checks passed
@kylebarron kylebarron deleted the kyle/handle-loading-bitmask branch January 29, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant