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

/**
 * Represents the JS union `VideoCodec`, backed by a C++ enum.
 */
public typealias VideoCodec = margelo.nitro.camera.VideoCodec

public extension VideoCodec {
  /**
   * Get a VideoCodec for the given String value, or
   * return `nil` if the given value was invalid/unknown.
   */
  init?(fromString string: String) {
    switch string {
      case "unknown":
        self = .unknown
      case "jpeg":
        self = .jpeg
      case "h264":
        self = .h264
      case "h265":
        self = .h265
      case "h265-with-alpha":
        self = .h265WithAlpha
      case "pro-res-422-proxy":
        self = .proRes422Proxy
      case "pro-res-422-lt":
        self = .proRes422Lt
      case "pro-res-422":
        self = .proRes422
      case "pro-res-422-hq":
        self = .proRes422Hq
      case "pro-res-4444":
        self = .proRes4444
      case "pro-res-4444-xq":
        self = .proRes4444Xq
      case "pro-res-raw":
        self = .proResRaw
      case "pro-res-raw-hq":
        self = .proResRawHq
      default:
        return nil
    }
  }

  /**
   * Get the String value this VideoCodec represents.
   */
  var stringValue: String {
    switch self {
      case .unknown:
        return "unknown"
      case .jpeg:
        return "jpeg"
      case .h264:
        return "h264"
      case .h265:
        return "h265"
      case .h265WithAlpha:
        return "h265-with-alpha"
      case .proRes422Proxy:
        return "pro-res-422-proxy"
      case .proRes422Lt:
        return "pro-res-422-lt"
      case .proRes422:
        return "pro-res-422"
      case .proRes422Hq:
        return "pro-res-422-hq"
      case .proRes4444:
        return "pro-res-4444"
      case .proRes4444Xq:
        return "pro-res-4444-xq"
      case .proResRaw:
        return "pro-res-raw"
      case .proResRawHq:
        return "pro-res-raw-hq"
    }
  }
}
