XCUImage (Explicitus Image) is a simple library for loading/decoding images, with additional utilities based on stb_image.
import xcuimg.XCUImage : XCUImage, XCULoadImage;
void main() {
XCUImage image = XCULoadImage("MyImage.jpg", 3);
int[][] pixels = image.GetImagePixelArray();
}Reading JPG image's pixel array.
Check out the specification for desired channels here.
Basic steps:git clone https://github.com/xzripper/xcuimg.d
cd xcuimg.d
Pre-built object file:
wget -q https://github.com/xzripper/xcuimg.d/releases/download/v1.1/xcuimg.o -O xcuimg/cbg/xcuimg.o
Object file is the same since V1.1
Building manually:
wget -q https://github.com/nothings/stb/blob/master/stb_image.h?raw=true -O xcuimg/cbg/stb_image.h
gcc -c xcuimg/cbg/xcuimg.c -o xcuimg/cbg/xcuimg.o
After you finished building/downloading the object file, you can drag xcuimg directory into your project.
Run your code with:
dmd [FILE(S)] xcuimg/cbg/xcuimg.o -I. -i