Skip to content

Instantly share code, notes, and snippets.

View CocoaBob's full-sized avatar
😃

CocoaBob CocoaBob

😃
  • Montréal
View GitHub Profile
@CocoaBob
CocoaBob / PCX.swift
Created January 21, 2023 04:46
Get UIImage from PCX data, supports both monochrome and color formats, need to install `pod "BinaryDataScanner", '1.0.3'`. Ref: https://github.com/actumn/playground/tree/master/swift/swift_load_PCX
import Foundation
import UIKit
struct PCXhead {
var identity: UInt8 = 0
var pcxver: UInt8 = 0
var compression: UInt8 = 0
var bpp: UInt8 = 0
var minX: UInt16 = 0
var minY: UInt16 = 0