// Initialize a SkRect with left coordinates 10, top coordinates 20, // right coordinates 100, and bottom coordinates 200 SkRect rect = SkRect::MakeLTRB(10, 20, 100, 200);
// Get the center of the SkRect object SkPoint center = rect.center();
// Add 10 units of padding to the left and right sides of the SkRect object rect.inset(10, 0);
// Check if the SkRect object is empty if (rect.isEmpty()) { // Do something if it is empty }These examples use the Skia Graphics Engine (Skia) library. The SkRect class is part of the Skia core library, included in the Skia package.