Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== stb-image-resize [[toc:]] This is a [[http://call-cc.org|CHICKEN]] egg that wraps [[https://github.com/nothings/stb|stb''image''resize.h]] version 0.95 from Jorge L Rodriguez and friends. It works on [[http://call-cc.org|CHICKEN]] 4 and 5. == Repository [[https://github.com/kristianlm/chicken-stb-image-resize|https://github.com/kristianlm/chicken-stb-image-resize]] == API [[toc:]] <procedure> (image-resize pixels width height channels target-width target-height #!key filter region alpha-channel)</procedure> Takes in raw {{pixels}} (a srfi-4 u8/u16/u32/f32vector) of size {{width}}''{{height}}''{{channels}} and returns raw pixels after resizing. The returned type is the same as {{pixels}}' of size {{target-width}}''{{target-height}}''{{channels}}. {{channels}} must be an integer between 0 and 64 and keys are processed as follows. * {{filter:}} one of {{box}}, {{triangle}}, {{cubicbspline}}, {{catmullrom}} or {{mitchell}}. The default uses {{catmullrom}} for up-sampling and {{mitchell}} for down-sampling. * {{region:}} a vector of 4 elements {{s0 t0 s1 t1}}, representing the UV-coordinates to use as source image. This can be used to crop the image. These values must be in the range of {{[0, 1]}} and represent the fraction of the input image. {{#(0 0 0.5 1)}}, for example, cuts off the right half of the image. * {{alpha-channel:}} index of channel which is the alpha channel in the image. supply {{#f}} (default) for no alpha channel. == Examples [[toc:]] You can try {{example-thumbnail.scm}} like this: [[image:https://github.com/kristianlm/chicken-stb-image-resize/raw/master/example.png?raw=true|screenshot of running example-thumbnail.scm]] Or turn a 3x1 greyscale image into a single pixel like this: {{ $ csi -R srfi-4 -R stb-image-resize -p '(image-resize (f32vector 0 4 8) 3 1 1 1 1)' #f32(4.0) }}
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 9 by 9?