///
/// HybridDepthSpec.swift
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

import NitroModules

/// See ``HybridDepthSpec``
public protocol HybridDepthSpec_protocol: HybridObject {
  // Properties
  var orientation: CameraOrientation { get }
  var isMirrored: Bool { get }
  var timestamp: Double { get }
  var width: Double { get }
  var height: Double { get }
  var bytesPerRow: Double { get }
  var pixelFormat: DepthPixelFormat { get }
  var isValid: Bool { get }
  var isDepthDataFiltered: Bool { get }
  var depthDataAccuracy: DepthDataAccuracy { get }
  var depthDataQuality: DepthDataQuality { get }
  var availableDepthPixelFormats: [DepthPixelFormat] { get }
  var cameraCalibrationData: (any HybridCameraCalibrationDataSpec)? { get }

  // Methods
  func getDepthData() throws -> ArrayBuffer
  func getNativeBuffer() throws -> NativeBuffer
  func rotate(orientation: CameraOrientation, isMirrored: Bool) throws -> (any HybridDepthSpec)
  func rotateAsync(orientation: CameraOrientation, isMirrored: Bool) throws -> Promise<(any HybridDepthSpec)>
  func convert(pixelFormat: DepthPixelFormat) throws -> (any HybridDepthSpec)
  func convertAsync(pixelFormat: DepthPixelFormat) throws -> Promise<(any HybridDepthSpec)>
  func convertCameraPointToDepthPoint(cameraPoint: Point) throws -> Point
  func convertDepthPointToCameraPoint(depthPoint: Point) throws -> Point
  func toFrame() throws -> (any HybridFrameSpec)
  func toFrameAsync() throws -> Promise<(any HybridFrameSpec)>
}

public extension HybridDepthSpec_protocol {
  /// Default implementation of ``HybridObject.toString``
  func toString() -> String {
    return "[HybridObject Depth]"
  }
}

/// See ``HybridDepthSpec``
open class HybridDepthSpec_base {
  private weak var cxxWrapper: HybridDepthSpec_cxx? = nil
  public init() { }
  public func getCxxWrapper() -> HybridDepthSpec_cxx {
  #if DEBUG
    guard self is any HybridDepthSpec else {
      fatalError("`self` is not a `HybridDepthSpec`! Did you accidentally inherit from `HybridDepthSpec_base` instead of `HybridDepthSpec`?")
    }
  #endif
    if let cxxWrapper = self.cxxWrapper {
      return cxxWrapper
    } else {
      let cxxWrapper = HybridDepthSpec_cxx(self as! any HybridDepthSpec)
      self.cxxWrapper = cxxWrapper
      return cxxWrapper
    }
  }
}

/**
 * A Swift base-protocol representing the Depth HybridObject.
 * Implement this protocol to create Swift-based instances of Depth.
 * ```swift
 * class HybridDepth : HybridDepthSpec {
 *   // ...
 * }
 * ```
 */
public typealias HybridDepthSpec = HybridDepthSpec_protocol & HybridDepthSpec_base
