Skip to content

Truevision TGA (TARGA) raster graphics support for Swift.

License

Notifications You must be signed in to change notification settings

lennartstolz/TGAImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Truevision TGA (TARGA) raster graphics support for Swift.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages