<div dir="ltr"><div>Hey Marco,</div><div><br></div><div>Here's the code I have for a bilinear-based implementation (attached), though I've omitted the actual NN and bilinear resampling code itself for brevity.  This does have a number of implementation-specific assumptions which would need to be reworked for the general case.  (the general case in GIS is hard and makes my brain bleed.)  So it's not really close to the point of being ready for a pull request.</div>

<div><br></div><div>It could be adapted to work on RGBA output, though with some modifications mostly involving using the alpha channel with a NN resample in place of the NODATA values.</div><div><br></div><div>It should be all ANSI C with no external dependencies. (except for one irrelevant Accelerate framework call)</div>

<div><br></div><div>Hope this is useful -- let me know if anything else is needed.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 18, 2014 at 1:14 AM, Marco Hugentobler <span dir="ltr"><<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Nick<br>
<br>
Resampling on data level does not work in case of colormap rasters, therefore the resampling filter currently comes after assigning rgba. One possibility would be to provide a user choice if resampling should be done on color values or on data.<br>


<br>
I think it is best if you post your code (as a pull request on github or via mailing list), then others can give it a try and provide feedback. I'm not really a raster power user myself (mostly working with rasters as background images for maps).<br>


<br>
Regards,<br>
Marco</blockquote></div></div></div>