As part of a continuing work in progress, but `clipng` is a Swift/Argument Parser wrapper around a Swift wrapper for libpng that will generate a png with random(*) pixels on Ubuntu or MacOS.

* Default system random.

TODO: Import pixels values from the Champixel region of the CPU, for the truly bespoke pixel needs.

#Swift #SwiftLang #SwiftWithC #CLI #ArgumentParser

https://github.com/carlynorama/clipng

GitHub - carlynorama/clipng

Contribute to carlynorama/clipng development by creating an account on GitHub.

GitHub

Well I did it. I got a Swift wrapper around a homebrew install of libpng working. "Hello PNG" works for both reading and writing RGBA data

Next step is to get jmpdef to translate to a function that throws in a more Swifty way.

Pretty extensive README.md and META.md for those who'd want to duplicate.

https://github.com/carlynorama/SwiftLIBPNG

#SwiftLang #C #SwiftWithC #libpng

GitHub - carlynorama/SwiftLIBPNG

Contribute to carlynorama/SwiftLIBPNG development by creating an account on GitHub.

GitHub

Well, I am still working on that Swift based mastodon bot, but it "requires" learning about Swift and C interoperability (narrator: it really doesn't)... so I spent some time last week writing a package/sample project with test code. I have to say I <3 the Swift `Unsafe` APIs. Having a pointer only exist for a closure so you can't forget to dealloc...? so so good. And `.loadasUnaligned` is going to be so handy for data protocols.

https://github.com/carlynorama/UnsafeWrapCSampler

#SwiftLang
#SwiftWithC

GitHub - carlynorama/UnsafeWrapCSampler: Package for learning how to wrap C code in Swift

Package for learning how to wrap C code in Swift. Contribute to carlynorama/UnsafeWrapCSampler development by creating an account on GitHub.

GitHub