Class PixelFormatExtensions
Contains helper methods for handling PixelFormat values.
Inherited Members
Namespace: ic4
Assembly: ic4dotnet.dll
Syntax
public static class PixelFormatExtensions
Methods
CanTransformInto(PixelFormat, PixelFormat)
Checks whether the library can convert images from one pixel format to another pixel format.
Declaration
public static bool CanTransformInto(this PixelFormat pixelFormat, PixelFormat dest)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelFormat | pixelFormat | The source format of the conversion |
| PixelFormat | dest | The destination format of the conversion |
Returns
| Type | Description |
|---|---|
| bool |
|
EnumTransforms(PixelFormat)
Queries the possible destination formats into which the library can convert image buffers of a given source format.
Declaration
public static IReadOnlyCollection<PixelFormat> EnumTransforms(this PixelFormat pixelFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelFormat | pixelFormat | The source format of the conversion |
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<PixelFormat> |
Remarks
An image conversion can happen by an explicit call to CopyFrom(ImageBuffer, CopyOptions), or implicitly by setting the accepted pixel format of a QueueSink or SnapSink.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The given pixel format is not a valid source for conversions. |
GetBitsPerPixel(PixelFormat)
Returns the bits per pixel of a pixel format.
Declaration
public static int GetBitsPerPixel(this PixelFormat pixelFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelFormat | pixelFormat | A pixel format |
Returns
| Type | Description |
|---|---|
| int | The bits required to store one pixel using the given pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The bits per pixel for the given format could not be determined. |