IImageWriter

Description

interface Tinman.Terrain.Imaging.IImageWriter

Derived from

IDisposable
IConfigurableNull

Extended by

ImageWriter abstract

Base interface for classes that write image data.

The following default image writer properties exist:

  • FormatAnd, FormatOr:
    Can be used to reduce or extend the output pixel format. First, the intersection of the pixel format flags of the input image (see IImageInfo.PixelFormat) and the flags of FormatAnd is computed. Then, the union of the resulting flags and FormatOr is computed. The final flags are used to hint the image writer, which may choose a different bit-depth or color mode, for example.

  • HasGeoref:
    Indicates whether geo-referencing information can be written or not.

  • ISrgb.Srgb:
    Controls sRGB compression when writing color channel values.

Implementing classes may provide additional properties to control how image data is written.

Public / Methods

Write​Image


public method WriteImage → (2)

imageReader in : IImageReader own

[not-null]
The image reader.

progress opt : IProgressMonitor = null

Optional progress monitor to use. A fixed number of progress ticks should be generated for each written image pixel.

Writes the image data provided by the given image reader.

Usually it is more convenient to call IImageOps.WriteImage instead of using this method directly, which requires creation and disposal of a IImageWriter object.

IOException

If an I/O error has occurred while writing the image file.

Public / Attributes

Format​And


public attribute FormatAnd → (get,set)

value : PixelFormat

The pixel format mask to use.

Controls the format of the written image, by giving a hint to the output pixel format.

Defaults to PixelFormat.All, i.e. all input pixel format flags are retained.

Format​Or


public attribute FormatOr → (get,set)

value : PixelFormat

The pixel format mask to use.

Controls the format of the written image, by giving a hint to the output pixel format.

Defaults to PixelFormat.Unknown, i.e. no output pixel format flags are added.

Has​Georef


public attribute HasGeoref → (get)

value : bool

true if this writer can write geo-referencing information, false if not.

Can this writer output geo-referencing information?

If a writer cannot output geo-referencing information, it is good practice to omit ReadImageFlags.Geo when reading the input image data.

Srgb


public attribute Srgb → (get,set)

value : int32

< 0 : force image writer to output linear sRGB color channel values,
> 0 : force image writer to output compressed sRGB color channel values,
= 0 : let image write choose according to its file format specifications.

Controls how to apply sRGB compression when writing image data.

Defaults to 0.