def test_Image_makeWithFilter(image, context): outSubset = skia.IRect(100, 100) offset = skia.IPoint(0, 0) assert isinstance( image.makeWithFilter(context, skia.ImageFilters.Blur(1., 1.), skia.IRect(100, 100), skia.IRect(100, 100), outSubset, offset), skia.Image)
def test_IRect_setLTRB(irect): irect.setLTRB(0, 0, 240, 120) def test_IRect_setXYWH(irect): irect.setXYWH(0, 0, 240, 120) def test_IRect_setWH(irect): irect.setWH(240, 120) @pytest.mark.parametrize('args', [ (10, 10), (skia.IPoint(10, 10), ), ]) def test_IRect_makeOffset(irect, args): assert isinstance(irect.makeOffset(*args), skia.IRect) def test_IRect_makeInset(irect): assert isinstance(irect.makeInset(10, 10), skia.IRect) def test_IRect_makeOutset(irect): assert isinstance(irect.makeOutset(10, 10), skia.IRect) @pytest.mark.parametrize('args', [ (10, 10),
def test_Canvas_accessTopLayerPixels(canvas): point = skia.IPoint(0, 0) assert isinstance(canvas.accessTopLayerPixels(point), (type(None), memoryview))
def test_IPoint_init(): assert isinstance(skia.IPoint(4, 3), skia.IPoint) assert isinstance(skia.IPoint.Make(4, 3), skia.IPoint)
def test_Matrix_setScaleTranslate(matrix): matrix.setScaleTranslate(1, 1, 0, 0) def test_Matrix_isFinite(matrix): assert isinstance(matrix.isFinite(), bool) def test_Matrix_MakeScale(): assert isinstance(skia.Matrix.MakeScale(1, 1), skia.Matrix) @pytest.mark.parametrize('args', [ (0, 0), (skia.Point(0, 0), ), (skia.IPoint(0, 0), ), ]) def test_Matrix_MakeTrans(args): assert isinstance(skia.Matrix.MakeTrans(*args), skia.Matrix) def test_Matrix_MakeAll(): assert isinstance(skia.Matrix.MakeAll(1, 0, 0, 0, 1, 0, 0, 0, 1), skia.Matrix) def test_Matrix_MakeRectToRect(): assert isinstance( skia.Matrix.MakeRectToRect(skia.Rect(100, 100), skia.Rect(100, 100), skia.Matrix.kCenter_ScaleToFit), skia.Matrix)
def test_IPoint_ne(ipoint): assert ipoint != skia.IPoint(4, 0)
def test_ImageFilters_MatrixConvolution(): assert isinstance(skia.ImageFilters.MatrixConvolution( skia.ISize(5, 5), [1. for i in range(25)], 1. / 25., 0, skia.IPoint(2, 2), skia.TileMode.kClamp, False), skia.ImageFilter)
def test_IPoint_eq(ipoint): assert ipoint == skia.IPoint(4, 3) assert ipoint == (4, 3)
def test_IPoint_isub(ipoint): ipoint -= skia.IPoint(1, 1) assert ipoint.equals(3, 2)
def test_IPoint_iadd(ipoint): ipoint += skia.IPoint(1, 1) assert ipoint.equals(5, 4)
def test_IPoint_init(args): assert isinstance(skia.IPoint(*args), skia.IPoint)
ipoint.fX = 4 ipoint.fY = 3 assert ipoint.fX == 4 assert ipoint.fY == 3 def test_IPoint_eq(ipoint): assert ipoint == skia.IPoint(4, 3) assert ipoint == (4, 3) def test_IPoint_ne(ipoint): assert ipoint != skia.IPoint(4, 0) @pytest.mark.parametrize('other', [skia.IPoint(0, 0), (1, 0)]) def test_IPoint_add(ipoint, other): assert isinstance(ipoint + other, skia.IPoint) @pytest.mark.parametrize('other', [skia.IPoint(0, 0), (1, 0)]) def test_IPoint_sub(ipoint, other): assert isinstance(ipoint - other, skia.IPoint) def test_IPoint_Make(): assert isinstance(skia.IPoint.Make(4, 3), skia.IPoint) def test_IPoint_iter(ipoint): assert tuple(ipoint) == (4, 3)