Struct libraw::Image [] [src]

pub struct Image {
    // some fields omitted
}

A raw image.

Methods

impl Image

fn open(path: &Path) -> Result<Image>

Opens the raw image file at the specified path.

fn unpack(&mut self) -> Result<()>

Unpacks the raw pixel data.

The raw data must be unpacked before it can be accessed. After unpacking, the pixel type can be determined with raw_pixel_type(), and the pixel data can be accessed with raw_pixmap(), color3_pixmap(), or color4_pixmap().

fn raw_pixel_type(&self) -> Result<PixelType>

Returns the pixel type of the raw data.

The data must be unpacked before determining the pixel type. The value returned from this method determines which of the raw pixmap types is available.

  • PixelType::Raw means that raw_pixmap() is available.
  • PixelType::Color3 means that colro3_pixmap() is available.
  • PixelType::Color4 means that colro4_pixmap() is available.

Errors

This method returns an error if the pixel data has not been unpacked.

fn raw_pixmap(&self) -> Result<Pixmap<RawPixel>>

Returns a pixmap of the raw pixels.

Errors

This method returns an error if the pixel data has not been unpacked or if the raw pixel data is in a different format (see raw_pixel_type()).

fn color3_pixmap(&self) -> Result<Pixmap<Color3Pixel>>

Returns a pixmap of the raw 3-color pixels.

Errors

This method returns an error if the pixel data has not been unpacked or if the raw pixel data is in a different format (see raw_pixel_type()).

fn color4_pixmap(&self) -> Result<Pixmap<Color4Pixel>>

Returns a pixmap of the raw 4-color pixels.

Errors

This method returns an error if the pixel data has not been unpacked or if the raw pixel data is in a different format (see raw_pixel_type()).

Trait Implementations

impl Drop for Image

fn drop(&mut self)