Function exr::image::read::read_first_rgba_layer_from_file

source ยท
pub fn read_first_rgba_layer_from_file<R, G, B, A, Set, Create, Pixels: 'static>(
    path: impl AsRef<Path>,
    create: Create,
    set_pixel: Set,
) -> Result<PixelImage<Pixels, RgbaChannels>>
where R: FromNativeSample, G: FromNativeSample, B: FromNativeSample, A: FromNativeSample, Create: Fn(Vec2<usize>, &RgbaChannels) -> Pixels + 'static, Set: Fn(&mut Pixels, Vec2<usize>, (R, G, B, A)) + 'static,
Expand description

No deep data, no resolution levels, rgba channels, choosing the first layer with rgba channels. Uses parallel decompression and relaxed error handling. Create and Set can be closures, see the examples for more information. Inspect the source code of this function if you need customization. The alpha channel will contain the value 1.0 if no alpha channel can be found in the image.

Using two closures, define how to store the pixels. The first closure creates an image, and the second closure inserts a single pixel. The type of the pixel can be defined by the second closure; it must be a tuple containing four values, each being either f16, f32, u32 or Sample.