[squeak-dev] Who understand bilinear interpolation for reducing image size?

David T. Lewis lewis at mail.msen.com
Tue Dec 9 13:02:17 UTC 2014


On Tue, Dec 09, 2014 at 10:59:48AM +0100, Bert Freudenberg wrote:
> 
> > On 09.12.2014, at 00:45, tim Rowledge <tim at rowledge.org> wrote:
> > 
> > But I?m not at all knowledgeable about image processing stuff, which is why I ask.
> 
> Well, I would preserve the output (only 0 and 255 for alpha) but extend the inputs: instead of comparing input pixel value to 0 to determine if it's transparent, compare the alpha. I think if the pixel value is a sqInt then comparing "pix < 0" would work, although doing an unsigned compare with 16r7F000000 would be less obfuscated.
> 

It would not be a sqInt (because this could be 64 bits), which means it needs to
be declared explicitly, which in turn means that your "less obfuscated" approach
would be the better thing to do.

No worries, I think it's already declared correctly in #primitiveInterpolate:

    <var: 'in' declareC: 'unsigned int *in'>

Which in C is this:

    unsigned int *in;


Dave



More information about the Squeak-dev mailing list