Class ImageFormatDetection
Methods for detecting image formats from byte data.
Inherited Members
Namespace: GLTFast
Assembly: glTFast.dll
Syntax
public static class ImageFormatDetection
Methods
IsJpeg(ReadOnlySpan<byte>)
Determines if the data is in Jpeg format.
Declaration
public static bool IsJpeg(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | Image data. Can be the first 3 bytes only. |
Returns
| Type | Description |
|---|---|
| bool | True if the data is Jpeg, false otherwise. |
IsKtx(ReadOnlySpan<byte>)
Determines if the data is in KTX format.
Declaration
public static bool IsKtx(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | Image data. Can be the first 12 bytes only. |
Returns
| Type | Description |
|---|---|
| bool | True if the data is KTX, false otherwise. |
IsPng(ReadOnlySpan<byte>)
Determines if the data is in PNG format.
Declaration
public static bool IsPng(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | Image data. Can be the first 8 bytes only. |
Returns
| Type | Description |
|---|---|
| bool | True if the data is PNG, false otherwise. |
IsPngOrJpeg(ReadOnlySpan<byte>)
Determines if the data is in PNG or Jpeg format.
Declaration
public static bool IsPngOrJpeg(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | Image data. Can be the first 8 bytes only. |
Returns
| Type | Description |
|---|---|
| bool | True if the data is PNG or Jpeg, false otherwise. |
IsWebP(ReadOnlySpan<byte>)
Determines if the data is in WebP format.
Declaration
public static bool IsWebP(ReadOnlySpan<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | data | Image data. Can be the first 12 bytes only. |
Returns
| Type | Description |
|---|---|
| bool | True if the data is WebP, false otherwise. |