Syphon / Processing

Syphon Implementation for Processing
Other
137 stars 33 forks source link

Support for pixelDensity(2) #39

Closed rpickering closed 3 years ago

rpickering commented 3 years ago

Unlike PGraphics, the PImage object doesn't cater for pixel densities other than 1 - more info on this decision here: https://github.com/processing/processing/issues/3364. It causes a mismatch in dimensions as getImage() uses both object types to set sizes of textures the frame they are applied to. When pixelDensity(2) is set in the main sketch, the library throws an error.

This fix smooths things over by multiplying the image dimensions by the current set pixelDensity. The result is a smaller frame in the context of the sketch, but it can be easily remedied within the Processing sketch (i.e. to resize the image coming from Syphon) and better than not working at all!

vade commented 3 years ago

LGTM!