vfx-rs / openexr-bind

cppmm bindings for OpenEXR
BSD 3-Clause "New" or "Revised" License
11 stars 6 forks source link

1 bind imf previewimage #41

Closed tiago-lqt closed 3 years ago

tiago-lqt commented 3 years ago

Description

Fixes #1.

Implements bindings for PreviewImage

CPPMM Checklist

Cppmm is our bindings generator. There are some tools in it to aid in creating safe and stable APIs.

FFI Safety Checklist

The Rustonomicon provides useful guides to prevent soundness errors in Rust. The FFI section of the document provides the source for these checklist items.

Rust API Guidelines Checklist

The checklist is heavily inspired by The Rust API Guidelines. Please check each item that applies, or note if an item is intentionally skipped (either partially or fully) with the reason.

Testing Checklist

The tests are meant to validate that the wrappers are sound and work as expected. Tests that are designed to exercise code for the wrapped library and not the bindings should be added to the wrapped library instead.

anderslanglands commented 3 years ago

Yep was thinking From. I’d keep this function as it’s still useful. Should probably add from_f32 as well.

On Tue, 20 Jul 2021 at 06:18, Tiago Carvalho @.***> wrote:

@.**** commented on this pull request.

In openexr-rs/src/core/preview_image.rs https://github.com/vfx-rs/openexr-bind/pull/41#discussion_r672526170:

  • b: u8,
  • /// The pixel's alpha.
  • /// 0 == transparent, 255 == opaque.
  • a: u8, +}
  • +impl PreviewRgba {

  • /// Creates a PreviewRgba from RGB and Alpha u8 values
  • ///
  • pub fn from_u8(r: u8, g: u8, b: u8, a: u8) -> PreviewRgba {
  • PreviewRgba { r, g, b, a }
  • }
  • /// Creates a PreviewRgba from RGB and Alpha u8 values
  • ///
  • pub fn from_f16(r: f16, g: f16, b: f16, a: f16) -> PreviewRgba {

What do you have in mind for the From? impl From for PreviewRgba or something else? And should we still keep this function?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/vfx-rs/openexr-bind/pull/41#discussion_r672526170, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOYQXK3MVO72E6QAXBLRV3TYRUBBANCNFSM5AO7DSLQ .