aboutsummaryrefslogtreecommitdiff
path: root/Map/Data/ExportFormats.swift
blob: b0b916b48c0ade3ff89acc2004b9ba79a7e1a212 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import SwiftUI
import UniformTypeIdentifiers

enum ExportFormats: String, CaseIterable {
  case png
  case jpeg
  case tiff
  case bmp
  case gif

  var title: String {
    switch self {
    case .png:
      String(localized: "export_formats.png")
    case .jpeg:
      String(localized: "export_formats.jpeg")
    case .tiff:
      String(localized: "export_formats.tiff")
    case .bmp:
      String(localized: "export_formats.bmp")
    case .gif:
      String(localized: "export_formats.gif")
    }
  }

  var utType: UTType {
    switch self {
    case .png:
      .png
    case .jpeg:
      .jpeg
    case .tiff:
      .tiff
    case .bmp:
      .bmp
    case .gif:
      .gif
    }
  }

  var fileType: NSBitmapImageRep.FileType {
    switch self {
    case .png:
      .png
    case .jpeg:
      .jpeg
    case .tiff:
      .tiff
    case .bmp:
      .bmp
    case .gif:
      .gif
    }
  }
}