Skia
2DGraphicsLibrary
|
Public Types | |
enum | CropEdge { kHasLeft_CropEdge = 0x01, kHasTop_CropEdge = 0x02, kHasWidth_CropEdge = 0x04, kHasHeight_CropEdge = 0x08, kHasAll_CropEdge = 0x0F } |
Public Member Functions | |
CropRect (const SkRect &rect, uint32_t flags=kHasAll_CropEdge) | |
uint32_t | flags () const |
const SkRect & | rect () const |
void | toString (SkString *str) const |
void | applyTo (const SkIRect &imageBounds, const SkMatrix &, bool embiggen, SkIRect *cropped) const |
Apply this cropRect to the imageBounds. More... | |
Private Attributes | |
SkRect | fRect |
uint32_t | fFlags |
void SkImageFilter::CropRect::applyTo | ( | const SkIRect & | imageBounds, |
const SkMatrix & | , | ||
bool | embiggen, | ||
SkIRect * | cropped | ||
) | const |
Apply this cropRect to the imageBounds.
If a given edge of the cropRect is not set, then the corresponding edge from imageBounds will be used. If "embiggen" is true, the crop rect is allowed to enlarge the size of the rect, otherwise it may only reduce the rect. Filters that can affect transparent black should pass "true", while all other filters should pass "false".
Note: imageBounds is in "device" space, as the output cropped rectangle will be, so the matrix is ignored for those. It is only applied the croprect's bounds.