Disponible
amalgame-image
Lit PNG/JPG/BMP/TGA/GIF/PSD/HDR, écrit PNG/JPG/BMP/TGA, via stb_image.
Vue d'ensemble
Wrapper sur stb_image.h et stb_image_write.h (public domain), embarqués dans le paquet. Chargement et écriture d'images sans dépendance système. Pixels en RGBA 8 bits, lus et écrits un par un (GetPixel, SetPixel).
Caractéristiques
- ✓Décode : PNG, JPG, BMP, TGA, GIF (première image), PSD, HDR
- ✓Encode : PNG, JPG, BMP, TGA
- ✓Conversion entre formats par double-passe load/save
- ✓Vendored — pas de dép externe
Prévu : redimensionnement, recadrage, rotation.
Exemple
Exemple minimal d'utilisation.
amc package add image
import Amalgame.Image
public class Program {
public static void Main(string[] args) {
let img = Image.Load("input.png")
if (!Image.IsValid(img)) {
Console.WriteLine("load failed: " + Image.LastError(img))
return
}
Console.WriteLine(String_FromInt(Image.Width(img)) + "x" + String_FromInt(Image.Height(img)))
Image.SetPixel(img, 0, 0, 0xFF0000FF)
Image.SaveAsJpg(img, "output.jpg", 85)
}
}
En bref
- Licence : Apache-2.0
- Installation :
amc package add image - Code source : amalgame-lang/amalgame-image
- Index officiel : amalgame-lang/packages-index