ViewportStruct

struct ViewportStruct

Used as the type for the viewport [CameraAvStreamManagementTrait.Attributes.viewport] attribute, allowing control over which part of the camera’s image is being streamed or processed. The viewport is defined as these coordinates:

(x1,y1) (x2,y1)
(x1,y2) (x2,y2)

  • x1

    Represents the x-coordinate of the left corners of the viewport.

    Declaration

    Swift

    let x1: UInt16
  • y1

    Represents the y-coordinate of the top corners of the viewport.

    Declaration

    Swift

    let y1: UInt16
  • x2

    Represents the x-coordinate of the right corners of the viewport.

    Declaration

    Swift

    let x2: UInt16
  • y2

    Represents the y-coordinate of the bottom corners of the viewport.

    Declaration

    Swift

    let y2: UInt16
  • Creates a new Struct instance using data read from the given TraitDecoder.

    Throws

    HomeError.parseError when parsing fails.

    Declaration

    Swift

    init(decoder: TraitDecoder) throws

    Parameters

    decoder

    The raw data representing this Struct.

  • Writes this Struct to the given TraitEncoder. Throws HomeError.parseError if the data could not be encoded.

    Declaration

    Swift

    func encode(with encoder: TraitEncoder) throws
  • Returns the field corresponding to the given field ID.

    Declaration

    Swift

    static func structField(id: UInt32) -> (any Field)?