def is_point_in_path(point, trafo, obj, stroke_width=5.0, fill_flag=True): dx, dy = point trafo = [] + trafo trafo[4] -= dx trafo[5] -= dy CTX.set_matrix(DIRECT_MATRIX) CTX.set_tolerance(3.0) CTX.set_source_rgb(1, 1, 1) CTX.paint() _draw_object(obj, trafo, stroke_width, fill_flag) pixel = _libcairo.get_pixel(SURFACE) CTX.set_tolerance(0.1) if pixel[0] == pixel[1] == pixel[2] == 255: return False else: return True
def check_surface_whiteness(surface): pixel = _libcairo.get_pixel(surface) if pixel[0] == pixel[1] == pixel[2] == 255: return True return False
def get_surface_pixel(surface): pixel = _libcairo.get_pixel(surface) return pixel
def check_surface_whiteness(surface): return _libcairo.get_pixel(surface) == [255, 255, 255]
def get_surface_pixel(surface): return _libcairo.get_pixel(surface)