Swiftpack.co - lennartstolz/TGAImage as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by lennartstolz.
lennartstolz/TGAImage 1.1.1
Truevision TGA (TARGA) raster graphics support for Swift.
⭐️ 6
🕓 2 years ago
.package(url: "https://github.com/lennartstolz/TGAImage.git", from: "1.1.1")

TGAImage

Truevision TGA (TARGA) raster graphics support for Swift.

Build codecov

Requirements

  • Swift 5.3

About

This package provides a Swift interface for the Truevision TGA (TARGA) raster graphics file format.

Usage

var image = TGAImage(width: 4, height: 1, color: .white)

// 🎨 Changing the color by pixel
image[0, 0] = .red
image[1, 0] = .green
image[2, 0] = .blue
image[3, 0] = [255, 165, 0]

// 💾 Writing the '.tga' data to disk
let data = image.tgaData()
data.write(to: url)

Specification

This library follows the file format specification version 2.0 (January 1991).

Supported Image Types

# Description Support
1 Uncompressed, color-mapped images ✖️
2 Uncompressed, true-color images
3 Uncompressed, black and white (unmapped) images ✖️
9 Run-length encoded, color-mapped images ✖️
10 Run-length encoded, true-color images ✖️
 11  Run-length encoded, black and white images ✖️

License

TGAImage is MIT Licensed.

GitHub

link
Stars: 6
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics