Table of Contents

Class RawReaderOptions

Namespace
Egami.Formats.Extended.Raw
Assembly
Egami.Formats.Extended.dll

Options for reading camera RAW files: what Load returns, and how it develops.

public sealed record RawReaderOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<RawReaderOptions>
Inheritance
RawReaderOptions
Implements
Inherited Members

Examples

RawReaderOptions develop = new()
{
    WhiteBalance = RawWhiteBalance.Custom,
    Temperature = 4800,                    // kelvin
    Tint = 5,                              // toward magenta
    Exposure = -0.5,                       // stops
    Highlights = RawHighlightMode.Rebuild, // recover clipped colour from what was not clipped
    Demosaic = RawDemosaicMethod.Malvar,   // faster than the default AHD
    LuminanceNoiseReduction = 20,          // 0 to 100; off by default
    ColorNoiseReduction = 40,              // 0 to 100; 25 by default
    AutoChromaticAberration = true,        // fix colour fringes when no lens profile covers the file
    DefaultToneCurve = true,               // a contrast curve like Adobe Camera Raw's default; off by default
    ConvertColorTo = Colors.ColorProfile.DisplayP3, // rendered straight into P3, the profile attached
};
using Raster photo = Raster.Load("photo.dng", context, develop);
photo.Save("photo-p3.png");

Properties

ApplyBaselineExposure

Gets whether the file's own exposure correction (DNG's BaselineExposure) is applied. Defaults to true.

public bool ApplyBaselineExposure { get; init; }

Property Value

bool

ApplyProfile

Gets whether the camera profile's look is applied: its HueSatMap, LookTable and tone curve. Defaults to true; without it, colours are the colour matrices' alone.

public bool ApplyProfile { get; init; }

Property Value

bool

AutoChromaticAberration

Gets whether a file that no lens correction covers (no lens opcodes, no matching profile) has its lateral chromatic aberration measured from the image and corrected: red and blue are scaled about the centre to line their edges up with green's. Defaults to false, since the measurement costs about as much as the demosaic. Applies only with LensCorrections.

public bool AutoChromaticAberration { get; init; }

Property Value

bool

Examples

RawReaderOptions develop = new()
{
    WhiteBalance = RawWhiteBalance.Custom,
    Temperature = 4800,                    // kelvin
    Tint = 5,                              // toward magenta
    Exposure = -0.5,                       // stops
    Highlights = RawHighlightMode.Rebuild, // recover clipped colour from what was not clipped
    Demosaic = RawDemosaicMethod.Malvar,   // faster than the default AHD
    LuminanceNoiseReduction = 20,          // 0 to 100; off by default
    ColorNoiseReduction = 40,              // 0 to 100; 25 by default
    AutoChromaticAberration = true,        // fix colour fringes when no lens profile covers the file
    DefaultToneCurve = true,               // a contrast curve like Adobe Camera Raw's default; off by default
    ConvertColorTo = Colors.ColorProfile.DisplayP3, // rendered straight into P3, the profile attached
};
using Raster photo = Raster.Load("photo.dng", context, develop);
photo.Save("photo-p3.png");

ColorNoiseReduction

Gets the strength, 0 to 100, of colour noise reduction after demosaicing. Defaults to 25.

public double ColorNoiseReduction { get; init; }

Property Value

double

Exceptions

ArgumentOutOfRangeException

The value is outside 0 to 100.

DefaultToneCurve

Gets whether a develop whose camera profile has no tone curve of its own gets a default one: the contrast curve of Adobe Camera Raw's default rendering, measured as a black box, which lifts the midtones and rolls off the highlights the way most raw converters' default looks do. Defaults to false, which keeps the develop scene-linear (only the output's transfer function); maker files, whose profiles come from the camera table, have no tone curve.

public bool DefaultToneCurve { get; init; }

Property Value

bool

Examples

RawReaderOptions develop = new()
{
    WhiteBalance = RawWhiteBalance.Custom,
    Temperature = 4800,                    // kelvin
    Tint = 5,                              // toward magenta
    Exposure = -0.5,                       // stops
    Highlights = RawHighlightMode.Rebuild, // recover clipped colour from what was not clipped
    Demosaic = RawDemosaicMethod.Malvar,   // faster than the default AHD
    LuminanceNoiseReduction = 20,          // 0 to 100; off by default
    ColorNoiseReduction = 40,              // 0 to 100; 25 by default
    AutoChromaticAberration = true,        // fix colour fringes when no lens profile covers the file
    DefaultToneCurve = true,               // a contrast curve like Adobe Camera Raw's default; off by default
    ConvertColorTo = Colors.ColorProfile.DisplayP3, // rendered straight into P3, the profile attached
};
using Raster photo = Raster.Load("photo.dng", context, develop);
photo.Save("photo-p3.png");

Demosaic

Gets the demosaicing method. Defaults to Ahd.

public RawDemosaicMethod Demosaic { get; init; }

Property Value

RawDemosaicMethod

Exposure

Gets the exposure to add, in stops, −10 to 10. Defaults to 0.

public double Exposure { get; init; }

Property Value

double

Exceptions

ArgumentOutOfRangeException

The value is outside −10 to 10.

Highlights

Gets what happens where the sensor clipped. Defaults to Clip.

public RawHighlightMode Highlights { get; init; }

Property Value

RawHighlightMode

LensCorrections

Gets whether the lens corrections the file carries (distortion, vignetting and lateral chromatic aberration, from DNG opcodes) are applied. Defaults to true.

public bool LensCorrections { get; init; }

Property Value

bool

LensProfiles

Gets the folders of lens profiles to correct with: Lensfun database files (.xml) and Adobe lens profiles (.lcp), searched with their subfolders; a system Lensfun install and the folders Adobe's software installs its lens profiles in are searched too when they are there. A file whose own data corrects the lens (DNG's lens opcodes) uses that instead. Egami ships no profiles: Lensfun's database is under CC BY-SA and Adobe's profiles are Adobe's, so you supply them. Defaults to none. Applies only with LensCorrections.

public IReadOnlyList<string> LensProfiles { get; init; }

Property Value

IReadOnlyList<string>

LuminanceNoiseReduction

Gets the strength, 0 to 100, of luminance noise reduction, done on the sensor data before demosaicing with the file's noise model, or one measured from the image. Defaults to 0 (off).

public double LuminanceNoiseReduction { get; init; }

Property Value

double

Exceptions

ArgumentOutOfRangeException

The value is outside 0 to 100.

Output

Gets what Load returns. Defaults to Developed. When it is that and MinimumSize is set, Load returns the smallest embedded preview, or else a half-size develop, that covers it.

public RawOutput Output { get; init; }

Property Value

RawOutput

PreviewIndex

Gets which preview Preview returns, as an index into Previews, or null (the default) for the largest.

public int? PreviewIndex { get; init; }

Property Value

int?

Exceptions

ArgumentOutOfRangeException

The value is negative.

Temperature

Gets the colour temperature in kelvin, 2,000 to 50,000, that Custom balances for. Defaults to 5,500.

public double Temperature { get; init; }

Property Value

double

Exceptions

ArgumentOutOfRangeException

The value is outside 2,000 to 50,000.

Tint

Gets the tint, −150 to 150, that Custom balances for: positive for light that is magenta, negative for light that is green. Defaults to 0.

public double Tint { get; init; }

Property Value

double

Exceptions

ArgumentOutOfRangeException

The value is outside −150 to 150.

WhiteBalance

Gets where the white balance comes from. Defaults to AsShot.

public RawWhiteBalance WhiteBalance { get; init; }

Property Value

RawWhiteBalance