Skip to content

Commit

Permalink
Merge pull request #142 from johannesvollmer/fix-int-rect-#141
Browse files Browse the repository at this point in the history
Fix int rect #141
  • Loading branch information
johannesvollmer authored Nov 21, 2021
2 parents c27abd1 + 6663a06 commit 5aa723f
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 80 deletions.
38 changes: 20 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Read and write OpenEXR files without any unsafe code"
keywords = ["exr", "openexr", "file", "binary", "io"]
categories = ["encoding", "filesystem", "graphics", "multimedia"]

version = "1.3.0"
version = "1.4.0"
edition = "2018"
authors = ["johannesvollmer <[email protected]>"]

Expand All @@ -26,21 +26,21 @@ plugin = false
proc-macro = false

[dependencies]
lebe = "0.5.1" # generic binary serialization
half = "1.7.1" # 16 bit float pixel data type
bit_field = "0.10.1" # exr file version bit flags
deflate = "0.9.1" # DEFLATE compression
inflate = "0.4.5" # DEFLATE decompression
smallvec = "1.6.1" # make cache-friendly allocations TODO profile if smallvec is really an improvement!
threadpool = "1.8.1" # threading for parallel compression TODO make this an optional feature?
flume = "0.10.5" # crossbeam, but less unsafe code TODO make this an optional feature?
lebe = "^0.5.1" # generic binary serialization
half = "^1.8.2" # 16 bit float pixel data type
bit_field = "^0.10.1" # exr file version bit flags
deflate = "^1.0.0" # DEFLATE compression
inflate = "^0.4.5" # DEFLATE decompression
smallvec = "^1.7.0" # make cache-friendly allocations TODO profile if smallvec is really an improvement!
threadpool = "^1.8.1" # threading for parallel compression TODO make this an optional feature?
flume = "^0.10.9" # crossbeam, but less unsafe code TODO make this an optional feature?

[dev-dependencies]
image = { version = "0.23.14", features = ["png"] } # used to convert one exr to some pngs

bencher = "0.1.5"
walkdir = "2.3.2" # automatically test things for all files in a directory
rand = "0.8.3" # used for fuzz testing
rand = "0.8.4" # used for fuzz testing
rayon = "1.5.1" # run tests for many files in parallel


Expand Down
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ The samples can currently only be `FlatSamples` or `Levels<FlatSamples>`, and in
### Samples
Currently, only flat samples are supported. These do not contain deep data.
Construct flat samples directly using `FlatSamples::F16(samples_vec)`, `FlatSamples::F32(samples_vec)`, or `FlatSamples::U32(samples_vec)`.
The vector contains all samples of the layer, row by row (bottom up), from left to right.
The vector contains all samples of the layer, row by row (from top to bottom), from left to right.

### Levels
Optionally include Mip Maps or Rip Maps.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ __Big-endian code is not yet fully implemented. Help wanted.__
Add this to your `Cargo.toml`:
```toml
[dependencies]
exr = "1.3.0"
exr = "1.4.0"

# also, optionally add this to your crate for smaller binary size
# and better runtime performance
Expand Down
2 changes: 1 addition & 1 deletion examples/4_specific_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() {
let (alpha, luma, luma_right) = layer.channel_data.pixels.first().unwrap().first().unwrap();

println!(
"bottom left color of layer `{}`: (a, y, yr) = {:?}",
"top left color of layer `{}`: (a, y, yr) = {:?}",
layer.attributes.layer_name.clone().unwrap_or_default(),
(alpha.to_f32(), luma, luma_right)
)
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
These are examples that demonstrate how to use `exrs`.

The examples for any specific `exrs` version can be found on the `docs.rs` page:
- [docs.rs/crate/exr/1.4.0/source/examples/](https://docs.rs/crate/exr/1.4.0/source/examples/)
- [docs.rs/crate/exr/1.3.0/source/examples/](https://docs.rs/crate/exr/1.3.0/source/examples/)
- [docs.rs/crate/exr/1.2.0/source/examples/](https://docs.rs/crate/exr/1.2.0/source/examples/)
- [docs.rs/crate/exr/1.1.0/source/examples/](https://docs.rs/crate/exr/1.1.0/source/examples/)
Expand Down
1 change: 1 addition & 0 deletions releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Yanking shouldn't be the default.
1. ensure `#![warn(missing_docs)]` in `lib.rs`
1. Example in README.md should be up-to-date
1. GUIDE.md should be up-to-date
1. Update Dependencies while you're at it?

## Tasks
1. Bump version in
Expand Down
5 changes: 3 additions & 2 deletions src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ pub struct BlockIndex {
/// Index of the layer.
pub layer: usize,

/// Index of the bottom left pixel from the block within the data window.
/// Index of the top left pixel from the block within the data window.
pub pixel_position: Vec2<usize>,

/// Number of pixels in this block. Stays the same across all resolution levels.
/// Number of pixels in this block, extending to the right and downwards.
/// Stays the same across all resolution levels.
pub pixel_size: Vec2<usize>,

/// Index of the mip or rip level in the image.
Expand Down
Loading

0 comments on commit 5aa723f

Please sign in to comment.