示例#1
0
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
示例#2
0
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
示例#3
0
文件: __init__.py 项目: Scrik/sk1-wx
def check_surface_whiteness(surface):
	pixel = _libcairo.get_pixel(surface)
	if pixel[0] == pixel[1] == pixel[2] == 255: return True
	return False
示例#4
0
文件: __init__.py 项目: Scrik/sk1-wx
def get_surface_pixel(surface):
	pixel = _libcairo.get_pixel(surface)
	return pixel
示例#5
0
def check_surface_whiteness(surface):
    pixel = _libcairo.get_pixel(surface)
    if pixel[0] == pixel[1] == pixel[2] == 255: return True
    return False
示例#6
0
def get_surface_pixel(surface):
    pixel = _libcairo.get_pixel(surface)
    return pixel
示例#7
0
文件: __init__.py 项目: raboof/sk1-wx
def check_surface_whiteness(surface):
    return _libcairo.get_pixel(surface) == [255, 255, 255]
示例#8
0
文件: __init__.py 项目: raboof/sk1-wx
def get_surface_pixel(surface):
    return _libcairo.get_pixel(surface)