smolscale
smolscale copied to clipboard
Fast, embeddable C code for smooth image scaling and pixel format conversion
We should be able to clamp passed-in premultiplied alpha values to be at least the same magnitude as the color channels. This may not already be the case if the...
I would like to point out that an identifier like “[`_SMOLSCALE_H_`](https://github.com/hpjansson/smolscale/blob/f333254e30b99714b934d89001dd2ccbccb95485/smolscale.h#L7 "Update candidate")” [does not fit](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL51-CPP.+Do+not+declare+or+define+a+reserved+identifier#DCL51CPP.Donotdeclareordefineareservedidentifier-NoncompliantCodeExample%28HeaderGuard%29 "Do not declare an identifier which is reserved for the compiler implementation.") to the...
Currently, `do_rows()` calls `malloc()` once for each scratch row, resulting in 3-4 calls per batch. We could cut this down to one call.
Use `src_`, `dest_`, `color_` (for color to composite on) prefixes instead of `_in` and `_out` suffixes. It's more common to do it this way, and it will make more sense...
Add a flag that tells the pipeline that there are no transparent pixels, even in the presence of an alpha channel. This flag can be set automatically if the input...
Add getter API for the range of rows that are usable with `smol_scale_batch ()`. This will be more convenient, and avoids confusion with compositing operations with offsets and multiple input...
I doubt relative offsets actually help with performance, and absolute offsets will be useful e.g. when looking up the final offset for subpixel edge blending.
The user could then calculate the row pointers on the fly, fetch them from an array, etc. This is useful for progressive loading and for image loader APIs that return...
Add the ability to composite the scaled output on an existing image buffer or a solid color. Allow origin outside the target image (i.e. negative top-left offsets) with clipping as...
We could allow clipping scaled output to a specific rectangle. This would be useful when zooming in on and panning around a larger image. We'll already have to deal with...