Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 22, 2021
1 parent a11031a commit 8cb6380
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gifski/Gifski.swift
Expand Up @@ -236,7 +236,7 @@ final class Gifski {
- Parameters:
- conversion: The conversion source of the image generator.
- jobKey: The string used to identify the current conversion job.
- Returns: An `AVAssetImageGenerator` along with the times of the frames requested by the conversion.
- Returns: An `AVAssetImageGenerator` along with the times of the frames requested by the conversion.
*/
private func imageGenerator(
for conversion: Conversion,
Expand Down
20 changes: 10 additions & 10 deletions Gifski/Utilities.swift
Expand Up @@ -4190,10 +4190,10 @@ extension CGContext {
case .rgba:
byteOrder = .byteOrder32Big
alphaInfo = withAlpha ? .premultipliedLast : .noneSkipLast
case .abgr:
byteOrder = .byteOrder32Little
alphaInfo = withAlpha ? .premultipliedFirst : .noneSkipFirst
case .bgra:
byteOrder = .byteOrder32Little
alphaInfo = withAlpha ? .premultipliedFirst : .noneSkipFirst // This might look wrong, but the order is inverse because of little endian.
case .abgr:
byteOrder = .byteOrder32Little
alphaInfo = withAlpha ? .premultipliedLast : .noneSkipLast
}
Expand Down Expand Up @@ -4248,10 +4248,10 @@ extension CGImage {
case .rgba:
byteOrder = .byteOrder32Big
alphaInfo = alphaLast
case .abgr:
byteOrder = .byteOrder32Little
alphaInfo = alphaFirst
case .bgra:
byteOrder = .byteOrder32Little
alphaInfo = alphaFirst // This might look wrong, but the order is inverse because of little endian.
case .abgr:
byteOrder = .byteOrder32Little
alphaInfo = alphaLast
}
Expand Down Expand Up @@ -4337,23 +4337,23 @@ extension CGImage {
/**
Little-endian, alpha first.
*/
case abgr
case bgra

/**
Little-endian, alpha last.
*/
case bgra
case abgr

var title: String {
switch self {
case .argb:
return "ARGB"
case .rgba:
return "RGBA"
case .abgr:
return "ABGR"
case .bgra:
return "BGRA"
case .abgr:
return "ABGR"
}
}
}
Expand Down

0 comments on commit 8cb6380

Please sign in to comment.