ImageFormat

Description

[ShutdownSurvive]
abstract class Tinman.Terrain.Imaging.ImageFormat

Derived from

FileFormat abstract

Extended by

GdalImageFormat sealed

The supported image file formats.

Each built-in image file format has a short text block that indicates which features are supported:

Public / Constants

Any


public static readonly attribute Any → (ImageFormat)

The file format is unknown and will be determined automatically.

Use IFileFormat.Next to walk through all registered formats.

BMP


public static readonly attribute BMP → (ImageFormat)

The BMP image file format.

Write supported: yes
IANA media type: image/bmp
File extensions: .bmp
Prefix sequence: yes
Raw value range: no

When writing *.bmp files, the following information will be lost:

DDS


public static readonly attribute DDS → (ImageFormat)

The DDS image file format.

Write supported: no
IANA media type: none
File extensions: .dds
Prefix sequence: yes
Raw value range: no

GIF


public static readonly attribute GIF → (ImageFormat)

The GIF image file format.

Write supported: no
IANA media type: image/gif
File extensions: .gif
Prefix sequence: yes
Raw value range: no

HDR


public static readonly attribute HDR → (ImageFormat)

The HDR image file format.

Write supported: no
IANA media type: image/vnd.radiance
File extensions: .hdr
Prefix sequence: yes
Raw value range: no

JPEG


public static readonly attribute JPEG → (ImageFormat)

The JPEG image file format.

Write supported: no
IANA media type: image/jpeg
File extensions: .jpeg .jpg
Prefix sequence: yes
Raw value range: no

PNG


public static readonly attribute PNG → (ImageFormat)

The PNG image file format.

Write supported: no
IANA media type: image/png
File extensions: .png
Prefix sequence: yes
Raw value range: no

PXB


public static readonly attribute PXB → (ImageFormat)

The PXB image file format ('PiXel Buffer', proprietary).

Write supported: yes
IANA media type: none
File extensions: .pxb
Prefix sequence: yes
Raw value range: no

When writing *.pxb files, the following information will be lost:

See also

ColorBuffer

Simple​Http


[ShutdownSurvive]
public static readonly attribute SimpleHttp → (ISimpleHttpImage)

A ISimpleHttpImage object that uses Any to decode image data.

The image format is determined from the binary file format prefix (see IFileFormat.CanRead1), falling back to the content type (see FileFormat.ForMime), as returned by the web server.

TGA


public static readonly attribute TGA → (ImageFormat)

The TGA image file format.

Write supported: yes
IANA media type: none
File extensions: .tga
Prefix sequence: no
Raw value range: no

When writing *.bmp files, the following information will be lost:

TIFF


public static readonly attribute TIFF → (ImageFormat)

The TIFF image file format.

Write supported: no
IANA media type: image/tiff
File extensions: .tif .tiff
Prefix sequence: yes
Raw value range: yes

TXB


public static readonly attribute TXB → (ImageFormat)

The TXB image file format ('TeXel Buffer', proprietary).

Write supported: no
IANA media type: none
File extensions: .txb
Prefix sequence: yes
Raw value range: no

See also

TexelBuffer

Public / Methods

For​Name


public static method ForName → (1)

name in : string

[not-empty]
The file image format name.

returns → ImageFormat

The file image format or Any if not found.

Returns a file image format by its IFileFormat.Name.

Read​Image


[OwnerReturn]
public method ReadImage → (2)

data in : IFileData

[not-null]
The image data provider.

flags in : ReadImageFlags

The image reading flags.

returns → IImageReader

The validated IImageReader for reading the image data (see IValidatable.Validate).

Reads the given image.

IOException

If an I/O error has occurred while opening the image data.

GeorefException

If the image contains unsupported geo-referencing metadata.

ValidatingException

If a validation error has occurred on data in or the returned image reader.

Read​Texture


[OwnerReturn]
public virtual method ReadTexture → (2)

data in : IFileData

[not-null]
The image data provider.

face in : CubemapFace

The cubemap face.

returns → TexelBuffer

The read TexelBuffer or null if the given image data cannot be interpreted as a texture (pixels must be read separately and then encoded as texels).

Tries to read the given image data as a texture.

IOException

If an I/O error has occurred.

ValidatingException

If a validation error has occurred on data in or the returned image reader.

Write​Image


[OwnerReturn]
public virtual method WriteImage → (1)

file in : Path

[not-null]
The output image file.

returns → IImageWriter

The image writer object to use.

Writes an image to the given file.

IOException

If this image format does not support writing (i.e. IFileFormat.CanWrite would return false).

See also

IImage.Write

Protected / Constructors

Image​Format


protected constructor ImageFormat → (4)

name in : string

[not-empty]
Value for IFileFormat.Name

description in : string

[not-empty]
Value for IFileFormat.Description

mime in : string

Value for IFileFormat.Mime

isAny opt : bool = false

Is this an automatic file format?

Creates a new instance of ImageFormat.

Protected / Methods

Cannot​Write


protected static method CannotWrite → (2)

source in : string

The error source tag.

file in : Path

The output image file path.

returns → IOException

The ready-to-throw exception.

Returns an IOException for the case when an image format does not support writing.

Do​Read​Image


[OwnerReturn]
protected abstract method DoReadImage → (2)

data in : IFileData

The image data provider: will never be null and IValidatable.Validate did not report any errors.

flags in : ReadImageFlags

The image reading flags.

returns → IImageReader

The IImageReader for reading the image data. The IValidatable.Validate has not yet been called on it.

Reads the given image.

IOException

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

GeorefException

If the image contains unsupported geo-referencing metadata.