10 min ", " max These members define the upper left ( min ) and lower right ( max ) points for the rectangle. The rectangle contains the pixels "min.x \(<= " "x < " max.x and "min.y \(<= " "y < " max.y. In general, Rect coordinates should be in canonical form: min.x " \(<= " max.x and min.y " \(<= " max.y . Some functions give undefined results if the input rectangles are not canonical.
r .canon() Returns a canonical rectangle by sorting the coordinates of r .
r .dx() Returns the horizontal dimension of r .
r .dy() Returns the vertical dimension of r .
r .eq( s ) Returns non-zero if the rectangles r and s have the same coordinates and zero otherwise.
r .Xrect( s ) Returns non-zero if the rectangles r and s intersect and zero otherwise. Intersection means the rectangles share at least one pixel; zero-sized rectangles do not intersect.
r .inrect( s ) Returns non-zero if r is completely inside s and zero otherwise. Rectangles with equal coordinates are considered to be inside each other. Zero-sized rectangles contain no rectangles.
r .clip( s ) Computes the intersection between r and s . If the input rectangles intersect, clip returns the resulting rectangle and a non-zero integer value. If the rectangles do not intersect, clip returns r and a zero value.
r .combine( s ) Returns the smallest rectangle sufficient to cover all the pixels of r and s .
r .contains( p ) Returns non-zero if the rectangle r contains the pixel with the coordinates of p and zero otherwise. Zero-sized rectangles contain no points.
r .addpt( p ) Returns the rectangle ( r .min.add( p ), r .max.add( p )).
r .subpt( p ) Returns the rectangle ( r .min.sub( p ), r .max.sub( p )).
r .inset( n ) Returns the rectangle ( r .min.add(( n , n )), r .max.sub(( n , n )). The result will not be in canonical form if the inset amount is too large for the rectangle.