package androidx.core.graphics;

import android.annotation.SuppressLint;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import kotlin.jvm.internal.l;

/* JADX INFO: loaded from: classes.dex */
public final class RectKt {
    @SuppressLint({"CheckResult"})
    public static final Rect and(Rect rect, Rect r2) {
        l.e(rect, "<this>");
        l.e(r2, "r");
        Rect rect2 = new Rect(rect);
        rect2.intersect(r2);
        return rect2;
    }

    public static final int component1(Rect rect) {
        l.e(rect, "<this>");
        return rect.left;
    }

    public static final int component2(Rect rect) {
        l.e(rect, "<this>");
        return rect.top;
    }

    public static final int component3(Rect rect) {
        l.e(rect, "<this>");
        return rect.right;
    }

    public static final int component4(Rect rect) {
        l.e(rect, "<this>");
        return rect.bottom;
    }

    public static final boolean contains(Rect rect, Point p2) {
        l.e(rect, "<this>");
        l.e(p2, "p");
        return rect.contains(p2.x, p2.y);
    }

    public static final Region minus(Rect rect, Rect r2) {
        l.e(rect, "<this>");
        l.e(r2, "r");
        Region region = new Region(rect);
        region.op(r2, Region.Op.DIFFERENCE);
        return region;
    }

    public static final Rect or(Rect rect, Rect r2) {
        l.e(rect, "<this>");
        l.e(r2, "r");
        Rect rect2 = new Rect(rect);
        rect2.union(r2);
        return rect2;
    }

    public static final Rect plus(Rect rect, Rect r2) {
        l.e(rect, "<this>");
        l.e(r2, "r");
        Rect rect2 = new Rect(rect);
        rect2.union(r2);
        return rect2;
    }

    public static final Rect times(Rect rect, int i2) {
        l.e(rect, "<this>");
        Rect rect2 = new Rect(rect);
        rect2.top *= i2;
        rect2.left *= i2;
        rect2.right *= i2;
        rect2.bottom *= i2;
        return rect2;
    }

    public static final Rect toRect(RectF rectF) {
        l.e(rectF, "<this>");
        Rect rect = new Rect();
        rectF.roundOut(rect);
        return rect;
    }

    public static final RectF toRectF(Rect rect) {
        l.e(rect, "<this>");
        return new RectF(rect);
    }

    public static final Region toRegion(Rect rect) {
        l.e(rect, "<this>");
        return new Region(rect);
    }

    public static final RectF transform(RectF rectF, Matrix m2) {
        l.e(rectF, "<this>");
        l.e(m2, "m");
        m2.mapRect(rectF);
        return rectF;
    }

    public static final Region xor(Rect rect, Rect r2) {
        l.e(rect, "<this>");
        l.e(r2, "r");
        Region region = new Region(rect);
        region.op(r2, Region.Op.XOR);
        return region;
    }

    public static final float component1(RectF rectF) {
        l.e(rectF, "<this>");
        return rectF.left;
    }

    public static final float component2(RectF rectF) {
        l.e(rectF, "<this>");
        return rectF.top;
    }

    public static final float component3(RectF rectF) {
        l.e(rectF, "<this>");
        return rectF.right;
    }

    public static final float component4(RectF rectF) {
        l.e(rectF, "<this>");
        return rectF.bottom;
    }

    public static final boolean contains(RectF rectF, PointF p2) {
        l.e(rectF, "<this>");
        l.e(p2, "p");
        return rectF.contains(p2.x, p2.y);
    }

    public static final Region toRegion(RectF rectF) {
        l.e(rectF, "<this>");
        Rect rect = new Rect();
        rectF.roundOut(rect);
        return new Region(rect);
    }

    @SuppressLint({"CheckResult"})
    public static final RectF and(RectF rectF, RectF r2) {
        l.e(rectF, "<this>");
        l.e(r2, "r");
        RectF rectF2 = new RectF(rectF);
        rectF2.intersect(r2);
        return rectF2;
    }

    public static final Region minus(RectF rectF, RectF r2) {
        l.e(rectF, "<this>");
        l.e(r2, "r");
        Rect rect = new Rect();
        rectF.roundOut(rect);
        Region region = new Region(rect);
        Rect rect2 = new Rect();
        r2.roundOut(rect2);
        region.op(rect2, Region.Op.DIFFERENCE);
        return region;
    }

    public static final RectF or(RectF rectF, RectF r2) {
        l.e(rectF, "<this>");
        l.e(r2, "r");
        RectF rectF2 = new RectF(rectF);
        rectF2.union(r2);
        return rectF2;
    }

    public static final RectF plus(RectF rectF, RectF r2) {
        l.e(rectF, "<this>");
        l.e(r2, "r");
        RectF rectF2 = new RectF(rectF);
        rectF2.union(r2);
        return rectF2;
    }

    public static final Region xor(RectF rectF, RectF r2) {
        l.e(rectF, "<this>");
        l.e(r2, "r");
        Rect rect = new Rect();
        rectF.roundOut(rect);
        Region region = new Region(rect);
        Rect rect2 = new Rect();
        r2.roundOut(rect2);
        region.op(rect2, Region.Op.XOR);
        return region;
    }

    public static final Rect plus(Rect rect, int i2) {
        l.e(rect, "<this>");
        Rect rect2 = new Rect(rect);
        rect2.offset(i2, i2);
        return rect2;
    }

    public static final RectF times(RectF rectF, float f2) {
        l.e(rectF, "<this>");
        RectF rectF2 = new RectF(rectF);
        rectF2.top *= f2;
        rectF2.left *= f2;
        rectF2.right *= f2;
        rectF2.bottom *= f2;
        return rectF2;
    }

    public static final RectF plus(RectF rectF, float f2) {
        l.e(rectF, "<this>");
        RectF rectF2 = new RectF(rectF);
        rectF2.offset(f2, f2);
        return rectF2;
    }

    public static final Rect plus(Rect rect, Point xy) {
        l.e(rect, "<this>");
        l.e(xy, "xy");
        Rect rect2 = new Rect(rect);
        rect2.offset(xy.x, xy.y);
        return rect2;
    }

    public static final Rect minus(Rect rect, int i2) {
        l.e(rect, "<this>");
        Rect rect2 = new Rect(rect);
        int i3 = -i2;
        rect2.offset(i3, i3);
        return rect2;
    }

    public static final RectF plus(RectF rectF, PointF xy) {
        l.e(rectF, "<this>");
        l.e(xy, "xy");
        RectF rectF2 = new RectF(rectF);
        rectF2.offset(xy.x, xy.y);
        return rectF2;
    }

    public static final RectF times(RectF rectF, int i2) {
        l.e(rectF, "<this>");
        float f2 = i2;
        RectF rectF2 = new RectF(rectF);
        rectF2.top *= f2;
        rectF2.left *= f2;
        rectF2.right *= f2;
        rectF2.bottom *= f2;
        return rectF2;
    }

    public static final RectF minus(RectF rectF, float f2) {
        l.e(rectF, "<this>");
        RectF rectF2 = new RectF(rectF);
        float f3 = -f2;
        rectF2.offset(f3, f3);
        return rectF2;
    }

    public static final Rect minus(Rect rect, Point xy) {
        l.e(rect, "<this>");
        l.e(xy, "xy");
        Rect rect2 = new Rect(rect);
        rect2.offset(-xy.x, -xy.y);
        return rect2;
    }

    public static final RectF minus(RectF rectF, PointF xy) {
        l.e(rectF, "<this>");
        l.e(xy, "xy");
        RectF rectF2 = new RectF(rectF);
        rectF2.offset(-xy.x, -xy.y);
        return rectF2;
    }
}
