adobe-photoshop/generator-core — pull request #203 by iwehrman (2014-05-02 18:56:07+00:00)
Title: Add interpolationType parameter Generator.prototype.getPixmap

This pull request adds an optional property to the settings parameter of `Generator.prototype.getPixmap` to control the interpolation method used for scaling pixmaps. The value of this property can either be one of the newly defined `Generator.prototype.INTERPOLATION` constants, or undefined. If undefined, the interpolation method is left up to Photoshop, which can be observed and changed in `Preferences > Image Interpolation`. The default for this setting seems to be `Bicubic Automatic`.

To test this, I suggest the following:

1. Make sure Image Interpolation has the default `Bicubic Automatic` setting and confirm that all tests pass with the Assets Automation plugin.
2. Download and open this [test PSD](http://cloud.wehrman.org/3s2e0b1Q3V3y).
3. Fire up Generator and observe the output PNG's smooth edges.
4. Disabled Generator, change the default interpolation method in `Preferences > Image Interpolation` to `Nearest Neighbor` and re-enable Generator. Observe the output PNG's jaggy edges.
5. Open up [`lib/dom/renderer.js`](https://github.com/adobe-photoshop/generator-assets/blob/iwehrman/v2/lib/renderer.js#L323) and add an `interpolationType` property to the settings parameter in the call to `getPixmap`. (The link above takes you to the right place to do this.) Try setting it to `this._generator.INTERPOLATION_BICUBIC_AUTOMATIC`. Re-run generator and observe the return of the output PNG's smooth edges.
6. Try setting `interpolationType` to the other `Generator.prototype.INTERPOLATION` constants and observe the changes in the output PNG.

Note: I thought about defining these constants directly on the Generator constructor, but decided against it because it isn't common for client code to require the Generator module directly.

Thanks to @timothynoel for the hint about both on the thumbnail and the transform having interpolation types.

Over to @joelrbrandt for review. If you merge this, don't forget to update the [API changes wiki page](https://github.com/adobe-photoshop/generator-core/wiki/API-Changes) accordingly.

Addresses #202.