TheTechnobear / NuiLite

23 stars 0 forks source link

Displaying Images on PD via Nuilite #3

Closed oxbown closed 4 years ago

oxbown commented 4 years ago

Hello! Is there any way to display graphics via Nuilite in Pd? I found in source code mentions to display PNG images: void drawPNG(unsigned x, unsigned y, const char *filename);

oxbown commented 4 years ago

This should be work? drawpng

TheTechnobear commented 4 years ago

drawPng - lowercase ( I can't remember if pd messages are case sensitive, I always assumed they were)

certainly the low level function works , as this is how Orac draws its logo at startup. I can't remember if I tested if from pd... but the code is there and its a pretty thin wrapper so id expect it to be ok

oxbown commented 4 years ago

One more question.... is drawPNG greyscale compatible??

TheTechnobear commented 4 years ago

not tried... but I guess so. is based on libcairo cairo_image_surface_create_from_png() which has no reference to colours etc, so ive always assume its uses colour info. in cairo, there is no concept of greyscale as such, it just uses the intensity of the RGB colour - so you might need to play with image to get something that maps nicely to something like the fates/norns display which I noticed is pretty limited. ( I had to try quite a few different 'colours' on orac before I got a few that looked reasonable)