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

16 bit per channel image buffers and dynamic images #1085

Merged
merged 13 commits into from Dec 12, 2019

Commits on Dec 10, 2019

  1. Support 16 bit per channel image buffers

    Add 16 bit buffers for all 16 bit types in ColorType. Include these as
    supported types in DynamicImage. These 16 bit images are currently only
    supported with u16 representation; changing this would require
    specialization and macroing of color conversions.
    
    Load 16 bit PNGs at full bit depth rather than squashing to 8 bit.
    
    Note that tests will not pass until upgrading to a release of image-png
    including image-rs/image-png#174.
    
    Closes image-rs#560.
    Closes image-rs#665.
    Closes image-rs#940.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    67a327b View commit details
    Browse the repository at this point in the history
  2. Create common trait for all image format encoders

    This ImageEncoder trait is currently minimal, but establishes a uniform
    interface so that all formats have native endian encoding interfaces,
    which is necessary for 16 bit per channel encoding.
    
    Closes image-rs#1076.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    4d776b7 View commit details
    Browse the repository at this point in the history
  3. Bump png version

    This fixes 16bpc tests.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    a32fd74 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    fe06c05 View commit details
    Browse the repository at this point in the history
  5. Remove ColorType::bytes_per_channel

    Per review comments, this assumes equal channel bit depths, which will
    not be the case in the future.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    7b62a7b View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    9de3e61 View commit details
    Browse the repository at this point in the history
  7. Restore as_flat_samples methods for DynamicImage

    Because the return type depends on the buffer's bits per channel, make
    the return optional and provide separate methods for 8 and 16 bit
    images.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    a502bee View commit details
    Browse the repository at this point in the history
  8. Remove zerocopy from public interface

    Instead create a crate-local AsBytes wrapper trait. This trait is not
    sealed as Primitive was not sealed, so that users can delegate it for
    newtypes if needed.
    aschampion committed Dec 10, 2019
    Copy the full SHA
    ed47a76 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2019

  1. Fix compilation on 1.34.2

    aschampion committed Dec 12, 2019
    Copy the full SHA
    c642686 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    e12da31 View commit details
    Browse the repository at this point in the history
  3. Remove ChannelsType

    aschampion committed Dec 12, 2019
    Copy the full SHA
    35ebf63 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    33cebef View commit details
    Browse the repository at this point in the history
  5. Switch from zerocopy to bytemuck

    Bytemuck is more feature constrained and builds on Rust 1.34.2.
    aschampion committed Dec 12, 2019
    Copy the full SHA
    5dae1fd View commit details
    Browse the repository at this point in the history