Function exr::image::read::read_all_rgba_layers_from_file[][src]

pub fn read_all_rgba_layers_from_file<R, G, B, A, Set: 'static, Create: 'static, Pixels: 'static>(
    path: impl AsRef<Path>,
    create: Create,
    set_pixel: Set
) -> Result<PixelLayersImage<Pixels, RgbaChannels>> where
    R: FromNativeSample,
    G: FromNativeSample,
    B: FromNativeSample,
    A: FromNativeSample,
    Create: Fn(Vec2<usize>, &RgbaChannels) -> Pixels,
    Set: Fn(&mut Pixels, Vec2<usize>, (R, G, B, A)), 

No deep data, no resolution levels, rgba channels, all layers. If a single layer does not contain rgba data, this method returns an error. 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.