i need to draw a polygon (non-convex) into memory, so that i can query which pixels are inside the polygon and which not. I came across matplotlib which has some Polygon class in it so i presume i could use this (although so far, i didn't understand the terminology behind the library and how to string things together... patches? artists? O_O)
What is the easiest way to draw the filled polygon, defined by a sequence of points, into some 1bit raster, so that i can answer queries like "Is the pixel at [10, 12] inside the polygon?"