Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fast C code for smooth image scaling
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Type||Name||Latest commit message||Commit time|
|Failed to load latest commit information.|
Smolscale ========= Smolscale is a smol piece of C code for quickly scaling images to a reasonable level of quality using CPU resources only (no GPU). It operates on 4-channel data with 32 bits per pixel, i.e. packed RGBA, ARGB, BGRA, etc. It supports both premultiplied and unassociated alpha and can convert between the two. It is host byte ordering agnostic. The design goals are: * High throughput: Optimized code, within reason. Easily parallelizable. * Decent quality: No "jaggies" as produced by nearest-neighbor scaling. * Low memory overhead: Mostly on the stack. * Simplicity: A modern C toolchain as the only dependency. * Ease of use: One-shot and row-batch APIs. Usage ----- First, read COPYING. If your project meets the requirements, you should be able to copy the following files into it and add it to your build with minimal fuss: smolscale.c smolscale.h smolscale-private.h If you want AVX2 SIMD support, optionally copy this additional file and compile everything with -DSMOL_WITH_AVX2: smolscale-avx2.c Keep in mind that this file is mostly just a straight copy of the generic code for the time being. Still, you will get a performance boost by building it with -mavx2 and letting Smolscale pick the implementation at runtime. The API documentation lives in smolscale.h along with the public declarations. Tests ----- There is a testing and benchmarking program included. It lives in test.c. You should be able to build it by simply issuing 'make'. It also allows you to test a few non-smol image scaling implementations. You need the development files for the following dependencies installed first (these are for test.c only and are not needed for Smolscale proper): * gdx-pixbuf * libpng * pixman * SDL_gfx You can also optionally build in Skia support, but then you have to build Skia in the skia/ subdir and edit the Makefile (WITH_SKIA=yes).