Struct rawloader::RawImage [] [src]

pub struct RawImage {
    pub make: String,
    pub model: String,
    pub clean_make: String,
    pub clean_model: String,
    pub width: usize,
    pub height: usize,
    pub cpp: usize,
    pub wb_coeffs: [f32; 4],
    pub whitelevels: [u16; 4],
    pub blacklevels: [u16; 4],
    pub xyz_to_cam: [[f32; 3]; 4],
    pub cfa: CFA,
    pub crops: [usize; 4],
    pub orientation: Orientation,
    pub data: Vec<u16>,
}

All the data needed to process this raw image, including the image data itself as well as all the needed metadata

Fields

camera make as encoded in the file

camera model as encoded in the file

make cleaned up to be consistent and short

model cleaned up to be consistent and short

width of the full image

height of the full image

number of components per pixel (1 for bayer, 3 for RGB images)

whitebalance coefficients encoded in the file in RGBE order

image whitelevels in RGBE order

image blacklevels in RGBE order

matrix to convert XYZ to camera RGBE

color filter array

how much to crop the image to get all the usable area, order is top, right, bottom, left

orientation of the image as indicated by the image metadata

image data itself, has width*height*cpp elements

Methods

impl RawImage
[src]

Outputs the inverted matrix that converts pixels in the camera colorspace into XYZ components. Those can then be easily used to convert to Lab or a RGB output space

Not all cameras encode a whitebalance so in those cases just using a 6500K neutral one is a good compromise

Convert the image to a sRGB image by doing a demosaic and applying levels, whitebalance, a base curve, color conversions and gamma.

The maxwidth and maxheight values specify maximum dimensions for the final image. If the original image is smaller this will not scale up but otherwise you will get an image that is either maxwidth wide or maxheight tall and maintains the image ratio. Pass in maxwidth and maxheight as 0 if you want the maximum possible image size.

Convert the image to an 8bit sRGB image by doing a demosaic and applying levels, whitebalance, a base curve, color conversions and gamma.

The maxwidth and maxheight values specify maximum dimensions for the final image. If the original image is smaller this will not scale up but otherwise you will get an image that is either maxwidth wide or maxheight tall and maintains the image ratio. Pass in maxwidth and maxheight as 0 if you want the maximum possible image size.

Convert the image to a linear sRGB image by doing a demosaic and applying levels and whitebalance, a base curve and color conversions.

The maxwidth and maxheight values specify maximum dimensions for the final image. If the original image is smaller this will not scale up but otherwise you will get an image that is either maxwidth wide or maxheight tall and maintains the image ratio. Pass in maxwidth and maxheight as 0 if you want the maximum possible image size.

Trait Implementations

impl Debug for RawImage
[src]

Formats the value using the given formatter.

impl Clone for RawImage
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more