• Introduction
  • Programmer's Guide
  • Technical Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • ic4
      • BufferPool
      • DeviceEnum
      • DeviceInfo
      • Display
      • DisplayNotation
      • DisplayRenderPosition
      • DisplayStatistics
      • DisplayType
      • EmbeddedDisplay
      • ErrorCode
      • ExternalOpenGLDisplay
      • FloatRepresentation
      • FloatingDisplay
      • FrameMetaData
      • Grabber
      • HandleObject
      • IBufferAllocator
      • IC4Exception
      • IDisplay
      • ImageBuffer
      • ImageBuffer.CopyOptions
      • ImageBufferExtensions
      • ImageBufferExtensionsHalconDotNet
      • ImageBufferExtensionsOpenCvSharp
      • ImageBufferExtensionsSystemDrawing
      • ImageBufferExtensionsSystemWindowsMedia
      • ImageType
      • IntRepresentation
      • Interface
      • Library
      • LogLevel
      • LogTarget
      • PixelFormat
      • PixelFormatExtensions
      • PngCompressionLevel
      • PropBoolean
      • PropCategory
      • PropCommand
      • PropEnumEntry
      • PropEnumeration
      • PropFloat
      • PropId
      • PropIdBoolean
      • PropIdCommand
      • PropIdEnumeration
      • PropIdFloat
      • PropIdInteger
      • PropIdRegister
      • PropIdString
      • PropInteger
      • PropRegister
      • PropString
      • Property
      • PropertyIncrementMode
      • PropertyMap
      • PropertyType
      • PropertyVisibility
      • QueueSink
      • QueueSinkConnectedEventArgs
      • QueueSinkEventArgs
      • QueueSinkQueueSizes
      • Sink
      • SinkMode
      • SinkType
      • SnapSink
      • SnapSinkAllocationStrategy
      • StreamSetupOption
      • StreamStatistics
      • TransportLayerType
      • VersionInfoFlags
      • VideoWriter
      • VideoWriterType
    • ic4.WinForms
      • Dialogs
      • Display
      • PropertyDialogFlags

    Class PixelFormatExtensions

    Contains helper methods for handling PixelFormat values.

    Inheritance
    object
    PixelFormatExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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

    true if the conversion is available, otherwise false.

    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.

    In this article
    Copyright ©️ 2024 The Imaging Source Europe GmbH www.theimagingsource.com