/**构造方法*/ publicRegion()//创建一个空的区域 publicRegion(Region region)//拷贝一个region的范围 publicRegion(Rect r)//创建一个矩形的区域 publicRegion(int left, int top, int right, int bottom)//创建一个矩形的区域 /**一系列set方法,这些set方法,和上面构造方法形式差不多*/ publicvoidsetEmpty() { publicbooleanset(Region region) publicbooleanset(Rect r) publicbooleanset(int left, int top, int right, int bottom) /*往一个Region中添加一个Path只有这种方法,参数clip代表这个整个Region的区域,在在里面裁剪出path范围的区域*/ publicbooleansetPath(Path path, Region clip)//用指定的Path和裁剪范围构建一个区域 /**几个判断方法*/ publicnativebooleanisEmpty();//判断该区域是否为空 publicnativebooleanisRect(); //是否是一个矩阵 publicnativebooleanisComplex();//是否是多个矩阵组合 /**一系列的getBound方法,返回一个Region的边界*/ public Rect getBounds() publicbooleangetBounds(Rect r) public Path getBoundaryPath() publicbooleangetBoundaryPath(Path path)
/**一系列的判断是否包含某点 和是否相交*/ publicnativebooleancontains(int x, int y);//是否包含某点 publicbooleanquickContains(Rect r)//是否包含某矩阵 publicnativebooleanquickContains(int left, int top, int right,int bottom)//是否包含某矩阵 publicbooleanquickReject(Rect r)//是否没和该矩阵相交 publicnativebooleanquickReject(int left, int top, int right, int bottom); //是否没和该矩阵相交 publicnativebooleanquickReject(Region rgn); //是否没和该矩阵相交 /**几个平移变换的方法*/ publicvoidtranslate(int dx, int dy) publicnativevoidtranslate(int dx, int dy, Region dst); publicvoidscale(float scale)//hide publicnativevoidscale(float scale, Region dst);//hide
/**一系列组合的方法*/ publicfinalbooleanunion(Rect r) publicbooleanop(Rect r, Op op) { publicbooleanop(int left, int top, int right, int bottom, Op op) publicbooleanop(Region region, Op op) publicbooleanop(Rect rect, Region region, Op op)
publicfinalbooleanunion(Rect r) publicbooleanop(Rect r, Op op) { publicbooleanop(int left, int top, int right, int bottom, Op op) publicbooleanop(Region region, Op op) publicbooleanop(Rect rect, Region region, Op op)
/**一系列的判断是否包含某点 和是否相交*/ publicnativebooleancontains(int x, int y);//是否包含某点 publicbooleanquickContains(Rect r)//是否包含某矩阵 publicnativebooleanquickContains(int left, int top, int right,int bottom)//是否包含某矩阵
publicbooleanquickReject(Rect r)//是否和该矩阵不相交 //官方注释: /** * Return true if the region is empty, or if the specified rectangle does * not intersect the region. Returning false is not a guarantee that they * intersect, but returning true is a guarantee that they do not. */ publicnativebooleanquickReject(int left, int top, int right, int bottom); //是否和该矩阵不相交 publicnativebooleanquickReject(Region rgn); //是否和该矩阵不相交