• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..31-Aug-2021-

COPYINGH A D03-Mar-2020728 1511

Makefile.amH A D03-Mar-2020660 2620

Makefile.inH A D31-Aug-202122.9 KiB674583

READMEH A D03-Mar-20201.3 KiB4328

smolscale-avx2.cH A D11-Jan-2021114.4 KiB2,8422,337

smolscale-private.hH A D11-Jan-20215.3 KiB189141

smolscale.cH A D11-Jan-2021117.3 KiB3,0672,522

smolscale.hH A D11-Jan-20213.1 KiB8647

README

1Smolscale
2=========
3
4Smolscale is a smol piece of C code for quickly scaling images to a reasonable
5level of quality using CPU resources only (no GPU). It operates on 4-channel
6data with 32 bits per pixel, i.e. packed RGBA, ARGB, BGRA, etc. It supports
7both premultiplied and unassociated alpha and can convert between the two. It
8is host byte ordering agnostic.
9
10The design goals are:
11
12* High throughput: Optimized code, within reason. Easily parallelizable.
13
14* Decent quality: No "jaggies" as produced by nearest-neighbor scaling.
15
16* Low memory overhead: Mostly on the stack.
17
18* Simplicity: A modern C toolchain as the only dependency.
19
20* Ease of use: One-shot and row-batch APIs.
21
22Usage
23-----
24
25First, read COPYING. If your project meets the requirements, you should be
26able to copy the following files into it and add it to your build with
27minimal fuss:
28
29  smolscale.c
30  smolscale.h
31  smolscale-private.h
32
33If you want AVX2 SIMD support, optionally copy this additional file and
34compile everything with -DSMOL_WITH_AVX2:
35
36  smolscale-avx2.c
37
38Keep in mind that this file is mostly just a straight copy of the generic
39code for the time being. Still, you will get a performance boost by building
40it with -mavx2 and letting Smolscale pick the implementation at runtime.
41
42The API documentation lives in smolscale.h along with the public declarations.
43