-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathCDNImageResize.swift
More file actions
24 lines (21 loc) · 921 Bytes
/
CDNImageResize.swift
File metadata and controls
24 lines (21 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
// Copyright © 2026 Stream.io Inc. All rights reserved.
//
import CoreGraphics
/// Parameters for CDN server-side image resize (Stream `w` / `h` / `resize` / `crop` query parameters).
public struct CDNImageResize: Sendable {
/// Width in points (scaled to pixels using screen scale when building the URL).
public var width: CGFloat
/// Height in points (scaled to pixels using screen scale when building the URL).
public var height: CGFloat
/// Value for the `resize` query parameter (for example `"clip"`, `"crop"`, `"fill"`, `"scale"`).
public var resizeMode: String
/// Value for the `crop` query parameter when using crop resize mode.
public var crop: String?
public init(width: CGFloat, height: CGFloat, resizeMode: String, crop: String? = nil) {
self.width = width
self.height = height
self.resizeMode = resizeMode
self.crop = crop
}
}