mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 09:27:16 +01:00
1912 lines
66 KiB
Java
1912 lines
66 KiB
Java
package com.caverock.androidsvg;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.AssetManager;
|
|
import android.content.res.Resources;
|
|
import android.graphics.Canvas;
|
|
import android.graphics.Matrix;
|
|
import android.graphics.Picture;
|
|
import android.graphics.RectF;
|
|
import android.util.Log;
|
|
import androidx.biometric.ErrorUtils$$ExternalSyntheticOutline0;
|
|
import androidx.core.view.ViewCompat;
|
|
import com.amazon.alexa.mobilytics.configuration.Constants;
|
|
import com.amazon.alexa.ra.core.ui.markdown.parser.formatter.MarkdownConstants;
|
|
import com.amazon.rtcsc.service.deviceconfiguration.util.DeviceConfigConstants;
|
|
import com.caverock.androidsvg.CSSParser;
|
|
import defpackage.a$$ExternalSyntheticOutline0;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes6.dex */
|
|
public class SVG {
|
|
private static final int DEFAULT_PICTURE_HEIGHT = 512;
|
|
private static final int DEFAULT_PICTURE_WIDTH = 512;
|
|
private static final long SPECIFIED_ALL = -1;
|
|
static final long SPECIFIED_CLIP = 1048576;
|
|
static final long SPECIFIED_CLIP_PATH = 268435456;
|
|
static final long SPECIFIED_CLIP_RULE = 536870912;
|
|
static final long SPECIFIED_COLOR = 4096;
|
|
static final long SPECIFIED_DIRECTION = 68719476736L;
|
|
static final long SPECIFIED_DISPLAY = 16777216;
|
|
static final long SPECIFIED_FILL = 1;
|
|
static final long SPECIFIED_FILL_OPACITY = 4;
|
|
static final long SPECIFIED_FILL_RULE = 2;
|
|
static final long SPECIFIED_FONT_FAMILY = 8192;
|
|
static final long SPECIFIED_FONT_SIZE = 16384;
|
|
static final long SPECIFIED_FONT_STYLE = 65536;
|
|
static final long SPECIFIED_FONT_WEIGHT = 32768;
|
|
static final long SPECIFIED_IMAGE_RENDERING = 137438953472L;
|
|
static final long SPECIFIED_MARKER_END = 8388608;
|
|
static final long SPECIFIED_MARKER_MID = 4194304;
|
|
static final long SPECIFIED_MARKER_START = 2097152;
|
|
static final long SPECIFIED_MASK = 1073741824;
|
|
static final long SPECIFIED_OPACITY = 2048;
|
|
static final long SPECIFIED_OVERFLOW = 524288;
|
|
static final long SPECIFIED_SOLID_COLOR = 2147483648L;
|
|
static final long SPECIFIED_SOLID_OPACITY = 4294967296L;
|
|
static final long SPECIFIED_STOP_COLOR = 67108864;
|
|
static final long SPECIFIED_STOP_OPACITY = 134217728;
|
|
static final long SPECIFIED_STROKE = 8;
|
|
static final long SPECIFIED_STROKE_DASHARRAY = 512;
|
|
static final long SPECIFIED_STROKE_DASHOFFSET = 1024;
|
|
static final long SPECIFIED_STROKE_LINECAP = 64;
|
|
static final long SPECIFIED_STROKE_LINEJOIN = 128;
|
|
static final long SPECIFIED_STROKE_MITERLIMIT = 256;
|
|
static final long SPECIFIED_STROKE_OPACITY = 16;
|
|
static final long SPECIFIED_STROKE_WIDTH = 32;
|
|
static final long SPECIFIED_TEXT_ANCHOR = 262144;
|
|
static final long SPECIFIED_TEXT_DECORATION = 131072;
|
|
static final long SPECIFIED_VECTOR_EFFECT = 34359738368L;
|
|
static final long SPECIFIED_VIEWPORT_FILL = 8589934592L;
|
|
static final long SPECIFIED_VIEWPORT_FILL_OPACITY = 17179869184L;
|
|
static final long SPECIFIED_VISIBILITY = 33554432;
|
|
private static final double SQRT2 = 1.414213562373095d;
|
|
private static final String VERSION = "1.4";
|
|
private static boolean enableInternalEntities = true;
|
|
private static SVGExternalFileResolver externalFileResolver;
|
|
private Svg rootElement = null;
|
|
private String title = "";
|
|
private String desc = "";
|
|
private float renderDPI = 96.0f;
|
|
private CSSParser.Ruleset cssRules = new CSSParser.Ruleset();
|
|
private Map<String, SvgElementBase> idToElementMap = new HashMap();
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* renamed from: com.caverock.androidsvg.SVG$1, reason: invalid class name */
|
|
public static /* synthetic */ class AnonymousClass1 {
|
|
static final /* synthetic */ int[] $SwitchMap$com$caverock$androidsvg$SVG$Unit;
|
|
|
|
static {
|
|
int[] iArr = new int[Unit.values().length];
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit = iArr;
|
|
try {
|
|
iArr[Unit.px.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.em.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.ex.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.in.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.cm.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.mm.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.pt.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.pc.ordinal()] = 8;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
try {
|
|
$SwitchMap$com$caverock$androidsvg$SVG$Unit[Unit.percent.ordinal()] = 9;
|
|
} catch (NoSuchFieldError unused9) {
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class CSSClipRect {
|
|
Length bottom;
|
|
Length left;
|
|
Length right;
|
|
Length top;
|
|
|
|
public CSSClipRect(Length length, Length length2, Length length3, Length length4) {
|
|
this.top = length;
|
|
this.right = length2;
|
|
this.bottom = length3;
|
|
this.left = length4;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Circle extends GraphicsElement {
|
|
Length cx;
|
|
Length cy;
|
|
Length r;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "circle";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class ClipPath extends Group implements NotDirectlyRendered {
|
|
Boolean clipPathUnitsAreUser;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.Group, com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "clipPath";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Colour extends SvgPaint {
|
|
static final Colour BLACK = new Colour(ViewCompat.MEASURED_STATE_MASK);
|
|
static final Colour TRANSPARENT = new Colour(0);
|
|
int colour;
|
|
|
|
public Colour(int i) {
|
|
this.colour = i;
|
|
}
|
|
|
|
public String toString() {
|
|
return String.format("#%08x", Integer.valueOf(this.colour));
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class CurrentColor extends SvgPaint {
|
|
private static CurrentColor instance = new CurrentColor();
|
|
|
|
private CurrentColor() {
|
|
}
|
|
|
|
public static CurrentColor getInstance() {
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Defs extends Group implements NotDirectlyRendered {
|
|
@Override // com.caverock.androidsvg.SVG.Group, com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "defs";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Ellipse extends GraphicsElement {
|
|
Length cx;
|
|
Length cy;
|
|
|
|
/* renamed from: rx, reason: collision with root package name */
|
|
Length f1130rx;
|
|
Length ry;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "ellipse";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class GradientElement extends SvgElementBase implements SvgContainer {
|
|
List<SvgObject> children = new ArrayList();
|
|
Matrix gradientTransform;
|
|
Boolean gradientUnitsAreUser;
|
|
String href;
|
|
GradientSpread spreadMethod;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public void addChild(SvgObject svgObject) throws SVGParseException {
|
|
if (svgObject instanceof Stop) {
|
|
this.children.add(svgObject);
|
|
return;
|
|
}
|
|
throw new SVGParseException("Gradient elements cannot contain " + svgObject + " elements.");
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public List<SvgObject> getChildren() {
|
|
return this.children;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum GradientSpread {
|
|
pad,
|
|
reflect,
|
|
repeat
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class GraphicsElement extends SvgConditionalElement implements HasTransform {
|
|
Matrix transform;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.HasTransform
|
|
public void setTransform(Matrix matrix) {
|
|
this.transform = matrix;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Group extends SvgConditionalContainer implements HasTransform {
|
|
Matrix transform;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "group";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.HasTransform
|
|
public void setTransform(Matrix matrix) {
|
|
this.transform = matrix;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface HasTransform {
|
|
void setTransform(Matrix matrix);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Image extends SvgPreserveAspectRatioContainer implements HasTransform {
|
|
Length height;
|
|
String href;
|
|
Matrix transform;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "image";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.HasTransform
|
|
public void setTransform(Matrix matrix) {
|
|
this.transform = matrix;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Line extends GraphicsElement {
|
|
Length x1;
|
|
Length x2;
|
|
Length y1;
|
|
Length y2;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "line";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Marker extends SvgViewBoxContainer implements NotDirectlyRendered {
|
|
Length markerHeight;
|
|
boolean markerUnitsAreUser;
|
|
Length markerWidth;
|
|
Float orient;
|
|
Length refX;
|
|
Length refY;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return Constants.MARKER;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Mask extends SvgConditionalContainer implements NotDirectlyRendered {
|
|
Length height;
|
|
Boolean maskContentUnitsAreUser;
|
|
Boolean maskUnitsAreUser;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "mask";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface NotDirectlyRendered {
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class PaintReference extends SvgPaint {
|
|
SvgPaint fallback;
|
|
String href;
|
|
|
|
public PaintReference(String str, SvgPaint svgPaint) {
|
|
this.href = str;
|
|
this.fallback = svgPaint;
|
|
}
|
|
|
|
public String toString() {
|
|
return this.href + " " + this.fallback;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Path extends GraphicsElement {
|
|
PathDefinition d;
|
|
Float pathLength;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "path";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class PathDefinition implements PathInterface {
|
|
private static final byte ARCTO = 4;
|
|
private static final byte CLOSE = 8;
|
|
private static final byte CUBICTO = 2;
|
|
private static final byte LINETO = 1;
|
|
private static final byte MOVETO = 0;
|
|
private static final byte QUADTO = 3;
|
|
private int commandsLength = 0;
|
|
private int coordsLength = 0;
|
|
private byte[] commands = new byte[8];
|
|
private float[] coords = new float[16];
|
|
|
|
private void addCommand(byte b) {
|
|
int i = this.commandsLength;
|
|
byte[] bArr = this.commands;
|
|
if (i == bArr.length) {
|
|
byte[] bArr2 = new byte[bArr.length * 2];
|
|
System.arraycopy(bArr, 0, bArr2, 0, bArr.length);
|
|
this.commands = bArr2;
|
|
}
|
|
byte[] bArr3 = this.commands;
|
|
int i2 = this.commandsLength;
|
|
this.commandsLength = i2 + 1;
|
|
bArr3[i2] = b;
|
|
}
|
|
|
|
private void coordsEnsure(int i) {
|
|
float[] fArr = this.coords;
|
|
if (fArr.length < this.coordsLength + i) {
|
|
float[] fArr2 = new float[fArr.length * 2];
|
|
System.arraycopy(fArr, 0, fArr2, 0, fArr.length);
|
|
this.coords = fArr2;
|
|
}
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void arcTo(float f, float f2, float f3, boolean z, boolean z2, float f4, float f5) {
|
|
addCommand((byte) ((z ? 2 : 0) | 4 | (z2 ? 1 : 0)));
|
|
coordsEnsure(5);
|
|
float[] fArr = this.coords;
|
|
int i = this.coordsLength;
|
|
int i2 = i + 1;
|
|
this.coordsLength = i2;
|
|
fArr[i] = f;
|
|
int i3 = i + 2;
|
|
this.coordsLength = i3;
|
|
fArr[i2] = f2;
|
|
int i4 = i + 3;
|
|
this.coordsLength = i4;
|
|
fArr[i3] = f3;
|
|
int i5 = i + 4;
|
|
this.coordsLength = i5;
|
|
fArr[i4] = f4;
|
|
this.coordsLength = i + 5;
|
|
fArr[i5] = f5;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void close() {
|
|
addCommand((byte) 8);
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void cubicTo(float f, float f2, float f3, float f4, float f5, float f6) {
|
|
addCommand((byte) 2);
|
|
coordsEnsure(6);
|
|
float[] fArr = this.coords;
|
|
int i = this.coordsLength;
|
|
int i2 = i + 1;
|
|
this.coordsLength = i2;
|
|
fArr[i] = f;
|
|
int i3 = i + 2;
|
|
this.coordsLength = i3;
|
|
fArr[i2] = f2;
|
|
int i4 = i + 3;
|
|
this.coordsLength = i4;
|
|
fArr[i3] = f3;
|
|
int i5 = i + 4;
|
|
this.coordsLength = i5;
|
|
fArr[i4] = f4;
|
|
int i6 = i + 5;
|
|
this.coordsLength = i6;
|
|
fArr[i5] = f5;
|
|
this.coordsLength = i + 6;
|
|
fArr[i6] = f6;
|
|
}
|
|
|
|
public void enumeratePath(PathInterface pathInterface) {
|
|
int i = 0;
|
|
for (int i2 = 0; i2 < this.commandsLength; i2++) {
|
|
byte b = this.commands[i2];
|
|
if (b == 0) {
|
|
float[] fArr = this.coords;
|
|
int i3 = i + 1;
|
|
float f = fArr[i];
|
|
i += 2;
|
|
pathInterface.moveTo(f, fArr[i3]);
|
|
} else if (b == 1) {
|
|
float[] fArr2 = this.coords;
|
|
int i4 = i + 1;
|
|
float f2 = fArr2[i];
|
|
i += 2;
|
|
pathInterface.lineTo(f2, fArr2[i4]);
|
|
} else if (b == 2) {
|
|
float[] fArr3 = this.coords;
|
|
pathInterface.cubicTo(fArr3[i], fArr3[i + 1], fArr3[i + 2], fArr3[i + 3], fArr3[i + 4], fArr3[i + 5]);
|
|
i += 6;
|
|
} else if (b == 3) {
|
|
float[] fArr4 = this.coords;
|
|
float f3 = fArr4[i];
|
|
float f4 = fArr4[i + 1];
|
|
int i5 = i + 3;
|
|
float f5 = fArr4[i + 2];
|
|
i += 4;
|
|
pathInterface.quadTo(f3, f4, f5, fArr4[i5]);
|
|
} else if (b != 8) {
|
|
boolean z = (b & 2) != 0;
|
|
boolean z2 = (b & 1) != 0;
|
|
float[] fArr5 = this.coords;
|
|
pathInterface.arcTo(fArr5[i], fArr5[i + 1], fArr5[i + 2], z, z2, fArr5[i + 3], fArr5[i + 4]);
|
|
i += 5;
|
|
} else {
|
|
pathInterface.close();
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean isEmpty() {
|
|
return this.commandsLength == 0;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void lineTo(float f, float f2) {
|
|
addCommand((byte) 1);
|
|
coordsEnsure(2);
|
|
float[] fArr = this.coords;
|
|
int i = this.coordsLength;
|
|
int i2 = i + 1;
|
|
this.coordsLength = i2;
|
|
fArr[i] = f;
|
|
this.coordsLength = i + 2;
|
|
fArr[i2] = f2;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void moveTo(float f, float f2) {
|
|
addCommand((byte) 0);
|
|
coordsEnsure(2);
|
|
float[] fArr = this.coords;
|
|
int i = this.coordsLength;
|
|
int i2 = i + 1;
|
|
this.coordsLength = i2;
|
|
fArr[i] = f;
|
|
this.coordsLength = i + 2;
|
|
fArr[i2] = f2;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.PathInterface
|
|
public void quadTo(float f, float f2, float f3, float f4) {
|
|
addCommand((byte) 3);
|
|
coordsEnsure(4);
|
|
float[] fArr = this.coords;
|
|
int i = this.coordsLength;
|
|
int i2 = i + 1;
|
|
this.coordsLength = i2;
|
|
fArr[i] = f;
|
|
int i3 = i + 2;
|
|
this.coordsLength = i3;
|
|
fArr[i2] = f2;
|
|
int i4 = i + 3;
|
|
this.coordsLength = i4;
|
|
fArr[i3] = f3;
|
|
this.coordsLength = i + 4;
|
|
fArr[i4] = f4;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface PathInterface {
|
|
void arcTo(float f, float f2, float f3, boolean z, boolean z2, float f4, float f5);
|
|
|
|
void close();
|
|
|
|
void cubicTo(float f, float f2, float f3, float f4, float f5, float f6);
|
|
|
|
void lineTo(float f, float f2);
|
|
|
|
void moveTo(float f, float f2);
|
|
|
|
void quadTo(float f, float f2, float f3, float f4);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Pattern extends SvgViewBoxContainer implements NotDirectlyRendered {
|
|
Length height;
|
|
String href;
|
|
Boolean patternContentUnitsAreUser;
|
|
Matrix patternTransform;
|
|
Boolean patternUnitsAreUser;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "pattern";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class PolyLine extends GraphicsElement {
|
|
float[] points;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "polyline";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Polygon extends PolyLine {
|
|
@Override // com.caverock.androidsvg.SVG.PolyLine, com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "polygon";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Rect extends GraphicsElement {
|
|
Length height;
|
|
|
|
/* renamed from: rx, reason: collision with root package name */
|
|
Length f1131rx;
|
|
Length ry;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "rect";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Style implements Cloneable {
|
|
static final int FONT_WEIGHT_BOLD = 700;
|
|
static final int FONT_WEIGHT_BOLDER = 1;
|
|
static final int FONT_WEIGHT_LIGHTER = -1;
|
|
static final int FONT_WEIGHT_NORMAL = 400;
|
|
CSSClipRect clip;
|
|
String clipPath;
|
|
FillRule clipRule;
|
|
Colour color;
|
|
TextDirection direction;
|
|
Boolean display;
|
|
SvgPaint fill;
|
|
Float fillOpacity;
|
|
FillRule fillRule;
|
|
List<String> fontFamily;
|
|
Length fontSize;
|
|
FontStyle fontStyle;
|
|
Integer fontWeight;
|
|
RenderQuality imageRendering;
|
|
String markerEnd;
|
|
String markerMid;
|
|
String markerStart;
|
|
String mask;
|
|
Float opacity;
|
|
Boolean overflow;
|
|
SvgPaint solidColor;
|
|
Float solidOpacity;
|
|
long specifiedFlags = 0;
|
|
SvgPaint stopColor;
|
|
Float stopOpacity;
|
|
SvgPaint stroke;
|
|
Length[] strokeDashArray;
|
|
Length strokeDashOffset;
|
|
LineCap strokeLineCap;
|
|
LineJoin strokeLineJoin;
|
|
Float strokeMiterLimit;
|
|
Float strokeOpacity;
|
|
Length strokeWidth;
|
|
TextAnchor textAnchor;
|
|
TextDecoration textDecoration;
|
|
VectorEffect vectorEffect;
|
|
SvgPaint viewportFill;
|
|
Float viewportFillOpacity;
|
|
Boolean visibility;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum FillRule {
|
|
NonZero,
|
|
EvenOdd
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum FontStyle {
|
|
Normal,
|
|
Italic,
|
|
Oblique
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum LineCap {
|
|
Butt,
|
|
Round,
|
|
Square
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum LineJoin {
|
|
Miter,
|
|
Round,
|
|
Bevel
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum RenderQuality {
|
|
auto,
|
|
optimizeQuality,
|
|
optimizeSpeed
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum TextAnchor {
|
|
Start,
|
|
Middle,
|
|
End
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum TextDecoration {
|
|
None,
|
|
Underline,
|
|
Overline,
|
|
LineThrough,
|
|
Blink
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum TextDirection {
|
|
LTR,
|
|
RTL
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum VectorEffect {
|
|
None,
|
|
NonScalingStroke
|
|
}
|
|
|
|
public static Style getDefaultStyle() {
|
|
Style style = new Style();
|
|
style.specifiedFlags = -1L;
|
|
Colour colour = Colour.BLACK;
|
|
style.fill = colour;
|
|
FillRule fillRule = FillRule.NonZero;
|
|
style.fillRule = fillRule;
|
|
Float valueOf = Float.valueOf(1.0f);
|
|
style.fillOpacity = valueOf;
|
|
style.stroke = null;
|
|
style.strokeOpacity = valueOf;
|
|
style.strokeWidth = new Length(1.0f);
|
|
style.strokeLineCap = LineCap.Butt;
|
|
style.strokeLineJoin = LineJoin.Miter;
|
|
style.strokeMiterLimit = Float.valueOf(4.0f);
|
|
style.strokeDashArray = null;
|
|
style.strokeDashOffset = new Length(0.0f);
|
|
style.opacity = valueOf;
|
|
style.color = colour;
|
|
style.fontFamily = null;
|
|
style.fontSize = new Length(12.0f, Unit.pt);
|
|
style.fontWeight = 400;
|
|
style.fontStyle = FontStyle.Normal;
|
|
style.textDecoration = TextDecoration.None;
|
|
style.direction = TextDirection.LTR;
|
|
style.textAnchor = TextAnchor.Start;
|
|
Boolean bool = Boolean.TRUE;
|
|
style.overflow = bool;
|
|
style.clip = null;
|
|
style.markerStart = null;
|
|
style.markerMid = null;
|
|
style.markerEnd = null;
|
|
style.display = bool;
|
|
style.visibility = bool;
|
|
style.stopColor = colour;
|
|
style.stopOpacity = valueOf;
|
|
style.clipPath = null;
|
|
style.clipRule = fillRule;
|
|
style.mask = null;
|
|
style.solidColor = null;
|
|
style.solidOpacity = valueOf;
|
|
style.viewportFill = null;
|
|
style.viewportFillOpacity = valueOf;
|
|
style.vectorEffect = VectorEffect.None;
|
|
style.imageRendering = RenderQuality.auto;
|
|
return style;
|
|
}
|
|
|
|
public Object clone() throws CloneNotSupportedException {
|
|
Style style = (Style) super.clone();
|
|
Length[] lengthArr = this.strokeDashArray;
|
|
if (lengthArr != null) {
|
|
style.strokeDashArray = (Length[]) lengthArr.clone();
|
|
}
|
|
return style;
|
|
}
|
|
|
|
public void resetNonInheritingProperties(boolean z) {
|
|
Float valueOf = Float.valueOf(1.0f);
|
|
Boolean bool = Boolean.TRUE;
|
|
this.display = bool;
|
|
if (!z) {
|
|
bool = Boolean.FALSE;
|
|
}
|
|
this.overflow = bool;
|
|
this.clip = null;
|
|
this.clipPath = null;
|
|
this.opacity = valueOf;
|
|
this.stopColor = Colour.BLACK;
|
|
this.stopOpacity = valueOf;
|
|
this.mask = null;
|
|
this.solidColor = null;
|
|
this.solidOpacity = valueOf;
|
|
this.viewportFill = null;
|
|
this.viewportFillOpacity = valueOf;
|
|
this.vectorEffect = VectorEffect.None;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Svg extends SvgViewBoxContainer {
|
|
Length height;
|
|
public String version;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "svg";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface SvgConditional {
|
|
String getRequiredExtensions();
|
|
|
|
Set<String> getRequiredFeatures();
|
|
|
|
Set<String> getRequiredFonts();
|
|
|
|
Set<String> getRequiredFormats();
|
|
|
|
Set<String> getSystemLanguage();
|
|
|
|
void setRequiredExtensions(String str);
|
|
|
|
void setRequiredFeatures(Set<String> set);
|
|
|
|
void setRequiredFonts(Set<String> set);
|
|
|
|
void setRequiredFormats(Set<String> set);
|
|
|
|
void setSystemLanguage(Set<String> set);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgConditionalContainer extends SvgElement implements SvgContainer, SvgConditional {
|
|
List<SvgObject> children = new ArrayList();
|
|
Set<String> requiredFeatures = null;
|
|
String requiredExtensions = null;
|
|
Set<String> systemLanguage = null;
|
|
Set<String> requiredFormats = null;
|
|
Set<String> requiredFonts = null;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public void addChild(SvgObject svgObject) throws SVGParseException {
|
|
this.children.add(svgObject);
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public List<SvgObject> getChildren() {
|
|
return this.children;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public String getRequiredExtensions() {
|
|
return this.requiredExtensions;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFeatures() {
|
|
return this.requiredFeatures;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFonts() {
|
|
return this.requiredFonts;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFormats() {
|
|
return this.requiredFormats;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getSystemLanguage() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredExtensions(String str) {
|
|
this.requiredExtensions = str;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFeatures(Set<String> set) {
|
|
this.requiredFeatures = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFonts(Set<String> set) {
|
|
this.requiredFonts = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFormats(Set<String> set) {
|
|
this.requiredFormats = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setSystemLanguage(Set<String> set) {
|
|
this.systemLanguage = set;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgConditionalElement extends SvgElement implements SvgConditional {
|
|
Set<String> requiredFeatures = null;
|
|
String requiredExtensions = null;
|
|
Set<String> systemLanguage = null;
|
|
Set<String> requiredFormats = null;
|
|
Set<String> requiredFonts = null;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public String getRequiredExtensions() {
|
|
return this.requiredExtensions;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFeatures() {
|
|
return this.requiredFeatures;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFonts() {
|
|
return this.requiredFonts;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getRequiredFormats() {
|
|
return this.requiredFormats;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public Set<String> getSystemLanguage() {
|
|
return this.systemLanguage;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredExtensions(String str) {
|
|
this.requiredExtensions = str;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFeatures(Set<String> set) {
|
|
this.requiredFeatures = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFonts(Set<String> set) {
|
|
this.requiredFonts = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setRequiredFormats(Set<String> set) {
|
|
this.requiredFormats = set;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditional
|
|
public void setSystemLanguage(Set<String> set) {
|
|
this.systemLanguage = set;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface SvgContainer {
|
|
void addChild(SvgObject svgObject) throws SVGParseException;
|
|
|
|
List<SvgObject> getChildren();
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgElement extends SvgElementBase {
|
|
Box boundingBox = null;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgElementBase extends SvgObject {
|
|
String id = null;
|
|
Boolean spacePreserve = null;
|
|
Style baseStyle = null;
|
|
Style style = null;
|
|
List<String> classNames = null;
|
|
|
|
public String toString() {
|
|
return getNodeName();
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class SvgLinearGradient extends GradientElement {
|
|
Length x1;
|
|
Length x2;
|
|
Length y1;
|
|
Length y2;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "linearGradient";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class SvgObject {
|
|
SVG document;
|
|
SvgContainer parent;
|
|
|
|
public String getNodeName() {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgPaint implements Cloneable {
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgPreserveAspectRatioContainer extends SvgConditionalContainer {
|
|
PreserveAspectRatio preserveAspectRatio = null;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class SvgRadialGradient extends GradientElement {
|
|
Length cx;
|
|
Length cy;
|
|
Length fx;
|
|
Length fy;
|
|
Length r;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "radialGradient";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class SvgViewBoxContainer extends SvgPreserveAspectRatioContainer {
|
|
Box viewBox;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Switch extends Group {
|
|
@Override // com.caverock.androidsvg.SVG.Group, com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "switch";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Symbol extends SvgViewBoxContainer implements NotDirectlyRendered {
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "symbol";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class TRef extends TextContainer implements TextChild {
|
|
String href;
|
|
private TextRoot textRoot;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "tref";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public TextRoot getTextRoot() {
|
|
return this.textRoot;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public void setTextRoot(TextRoot textRoot) {
|
|
this.textRoot = textRoot;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class TSpan extends TextPositionedContainer implements TextChild {
|
|
private TextRoot textRoot;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "tspan";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public TextRoot getTextRoot() {
|
|
return this.textRoot;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public void setTextRoot(TextRoot textRoot) {
|
|
this.textRoot = textRoot;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Text extends TextPositionedContainer implements TextRoot, HasTransform {
|
|
Matrix transform;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "text";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.HasTransform
|
|
public void setTransform(Matrix matrix) {
|
|
this.transform = matrix;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface TextChild {
|
|
TextRoot getTextRoot();
|
|
|
|
void setTextRoot(TextRoot textRoot);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class TextContainer extends SvgConditionalContainer {
|
|
@Override // com.caverock.androidsvg.SVG.SvgConditionalContainer, com.caverock.androidsvg.SVG.SvgContainer
|
|
public void addChild(SvgObject svgObject) throws SVGParseException {
|
|
if (svgObject instanceof TextChild) {
|
|
this.children.add(svgObject);
|
|
return;
|
|
}
|
|
throw new SVGParseException("Text content elements cannot contain " + svgObject + " elements.");
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class TextPath extends TextContainer implements TextChild {
|
|
String href;
|
|
Length startOffset;
|
|
private TextRoot textRoot;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "textPath";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public TextRoot getTextRoot() {
|
|
return this.textRoot;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public void setTextRoot(TextRoot textRoot) {
|
|
this.textRoot = textRoot;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static abstract class TextPositionedContainer extends TextContainer {
|
|
List<Length> dx;
|
|
List<Length> dy;
|
|
List<Length> x;
|
|
List<Length> y;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public interface TextRoot {
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class TextSequence extends SvgObject implements TextChild {
|
|
String text;
|
|
private TextRoot textRoot;
|
|
|
|
public TextSequence(String str) {
|
|
this.text = str;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public TextRoot getTextRoot() {
|
|
return this.textRoot;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.TextChild
|
|
public void setTextRoot(TextRoot textRoot) {
|
|
this.textRoot = textRoot;
|
|
}
|
|
|
|
public String toString() {
|
|
return a$$ExternalSyntheticOutline0.m(new StringBuilder("TextChild: '"), this.text, "'");
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public enum Unit {
|
|
px,
|
|
em,
|
|
ex,
|
|
in,
|
|
cm,
|
|
mm,
|
|
pt,
|
|
pc,
|
|
percent
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Use extends Group {
|
|
Length height;
|
|
String href;
|
|
Length width;
|
|
Length x;
|
|
Length y;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.Group, com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "use";
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class View extends SvgViewBoxContainer implements NotDirectlyRendered {
|
|
static final String NODE_NAME = "view";
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "view";
|
|
}
|
|
}
|
|
|
|
private String cssQuotedString(String str) {
|
|
if (str.startsWith(DeviceConfigConstants.DOUBLE_QUOTE) && str.endsWith(DeviceConfigConstants.DOUBLE_QUOTE)) {
|
|
str = str.substring(1, str.length() - 1).replace("\\\"", DeviceConfigConstants.DOUBLE_QUOTE);
|
|
} else if (str.startsWith("'") && str.endsWith("'")) {
|
|
str = str.substring(1, str.length() - 1).replace("\\'", "'");
|
|
}
|
|
return str.replace("\\\n", "").replace("\\A", "\n");
|
|
}
|
|
|
|
public static void deregisterExternalFileResolver() {
|
|
externalFileResolver = null;
|
|
}
|
|
|
|
private Box getDocumentDimensions(float f) {
|
|
Unit unit;
|
|
Unit unit2;
|
|
Unit unit3;
|
|
Unit unit4;
|
|
float f2;
|
|
Unit unit5;
|
|
Svg svg = this.rootElement;
|
|
Length length = svg.width;
|
|
Length length2 = svg.height;
|
|
if (length == null || length.isZero() || (unit = length.unit) == (unit2 = Unit.percent) || unit == (unit3 = Unit.em) || unit == (unit4 = Unit.ex)) {
|
|
return new Box(-1.0f, -1.0f, -1.0f, -1.0f);
|
|
}
|
|
float floatValue = length.floatValue(f);
|
|
if (length2 == null) {
|
|
Box box = this.rootElement.viewBox;
|
|
f2 = box != null ? (box.height * floatValue) / box.width : floatValue;
|
|
} else {
|
|
if (length2.isZero() || (unit5 = length2.unit) == unit2 || unit5 == unit3 || unit5 == unit4) {
|
|
return new Box(-1.0f, -1.0f, -1.0f, -1.0f);
|
|
}
|
|
f2 = length2.floatValue(f);
|
|
}
|
|
return new Box(0.0f, 0.0f, floatValue, f2);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private SvgElementBase getElementById(SvgContainer svgContainer, String str) {
|
|
SvgElementBase elementById;
|
|
SvgElementBase svgElementBase = (SvgElementBase) svgContainer;
|
|
if (str.equals(svgElementBase.id)) {
|
|
return svgElementBase;
|
|
}
|
|
for (Object obj : svgContainer.getChildren()) {
|
|
if (obj instanceof SvgElementBase) {
|
|
SvgElementBase svgElementBase2 = (SvgElementBase) obj;
|
|
if (str.equals(svgElementBase2.id)) {
|
|
return svgElementBase2;
|
|
}
|
|
if ((obj instanceof SvgContainer) && (elementById = getElementById((SvgContainer) obj, str)) != null) {
|
|
return elementById;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private void getElementsByTagName(List<SvgObject> list, SvgObject svgObject, String str) {
|
|
if (svgObject.getNodeName().equals(str)) {
|
|
list.add(svgObject);
|
|
}
|
|
if (svgObject instanceof SvgContainer) {
|
|
Iterator<SvgObject> it2 = ((SvgContainer) svgObject).getChildren().iterator();
|
|
while (it2.hasNext()) {
|
|
getElementsByTagName(list, it2.next(), str);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static SVGExternalFileResolver getFileResolver() {
|
|
return externalFileResolver;
|
|
}
|
|
|
|
public static SVG getFromAsset(AssetManager assetManager, String str) throws SVGParseException, IOException {
|
|
SVGParser sVGParser = new SVGParser();
|
|
InputStream open = assetManager.open(str);
|
|
try {
|
|
return sVGParser.parse(open, enableInternalEntities);
|
|
} finally {
|
|
try {
|
|
open.close();
|
|
} catch (IOException unused) {
|
|
}
|
|
}
|
|
}
|
|
|
|
public static SVG getFromInputStream(InputStream inputStream) throws SVGParseException {
|
|
return new SVGParser().parse(inputStream, enableInternalEntities);
|
|
}
|
|
|
|
public static SVG getFromResource(Resources resources, int i) throws SVGParseException {
|
|
SVGParser sVGParser = new SVGParser();
|
|
InputStream openRawResource = resources.openRawResource(i);
|
|
try {
|
|
return sVGParser.parse(openRawResource, enableInternalEntities);
|
|
} finally {
|
|
try {
|
|
openRawResource.close();
|
|
} catch (IOException unused) {
|
|
}
|
|
}
|
|
}
|
|
|
|
public static SVG getFromString(String str) throws SVGParseException {
|
|
return new SVGParser().parse(new ByteArrayInputStream(str.getBytes()), enableInternalEntities);
|
|
}
|
|
|
|
public static String getVersion() {
|
|
return "1.4";
|
|
}
|
|
|
|
public static boolean isInternalEntitiesEnabled() {
|
|
return enableInternalEntities;
|
|
}
|
|
|
|
public static void registerExternalFileResolver(SVGExternalFileResolver sVGExternalFileResolver) {
|
|
externalFileResolver = sVGExternalFileResolver;
|
|
}
|
|
|
|
public static void setInternalEntitiesEnabled(boolean z) {
|
|
enableInternalEntities = z;
|
|
}
|
|
|
|
public void addCSSRules(CSSParser.Ruleset ruleset) {
|
|
this.cssRules.addAll(ruleset);
|
|
}
|
|
|
|
public void clearRenderCSSRules() {
|
|
this.cssRules.removeFromSource(CSSParser.Source.RenderOptions);
|
|
}
|
|
|
|
public List<CSSParser.Rule> getCSSRules() {
|
|
return this.cssRules.getRules();
|
|
}
|
|
|
|
public float getDocumentAspectRatio() {
|
|
Svg svg = this.rootElement;
|
|
if (svg == null) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return 0.0f;
|
|
}
|
|
Length length = svg.width;
|
|
Length length2 = svg.height;
|
|
if (length != null && length2 != null) {
|
|
Unit unit = length.unit;
|
|
Unit unit2 = Unit.percent;
|
|
if (unit != unit2 && length2.unit != unit2) {
|
|
if (length.isZero() || length2.isZero()) {
|
|
return -1.0f;
|
|
}
|
|
return length.floatValue(this.renderDPI) / length2.floatValue(this.renderDPI);
|
|
}
|
|
}
|
|
Box box = svg.viewBox;
|
|
if (box != null) {
|
|
float f = box.width;
|
|
if (f != 0.0f) {
|
|
float f2 = box.height;
|
|
if (f2 != 0.0f) {
|
|
return f / f2;
|
|
}
|
|
}
|
|
}
|
|
return -1.0f;
|
|
}
|
|
|
|
public String getDocumentDescription() {
|
|
if (this.rootElement != null) {
|
|
return this.desc;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
|
|
public float getDocumentHeight() {
|
|
if (this.rootElement != null) {
|
|
return getDocumentDimensions(this.renderDPI).height;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return 0.0f;
|
|
}
|
|
|
|
public PreserveAspectRatio getDocumentPreserveAspectRatio() {
|
|
Svg svg = this.rootElement;
|
|
if (svg == null) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
PreserveAspectRatio preserveAspectRatio = svg.preserveAspectRatio;
|
|
if (preserveAspectRatio == null) {
|
|
return null;
|
|
}
|
|
return preserveAspectRatio;
|
|
}
|
|
|
|
public String getDocumentSVGVersion() {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
return svg.version;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
|
|
public String getDocumentTitle() {
|
|
if (this.rootElement != null) {
|
|
return this.title;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
|
|
public RectF getDocumentViewBox() {
|
|
Svg svg = this.rootElement;
|
|
if (svg == null) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
Box box = svg.viewBox;
|
|
if (box == null) {
|
|
return null;
|
|
}
|
|
return box.toRectF();
|
|
}
|
|
|
|
public float getDocumentWidth() {
|
|
if (this.rootElement != null) {
|
|
return getDocumentDimensions(this.renderDPI).width;
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return 0.0f;
|
|
}
|
|
|
|
public float getRenderDPI() {
|
|
return this.renderDPI;
|
|
}
|
|
|
|
public Svg getRootElement() {
|
|
return this.rootElement;
|
|
}
|
|
|
|
public Set<String> getViewList() {
|
|
if (this.rootElement == null) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
return null;
|
|
}
|
|
List<SvgObject> elementsByTagName = getElementsByTagName("view");
|
|
HashSet hashSet = new HashSet(elementsByTagName.size());
|
|
Iterator<SvgObject> it2 = elementsByTagName.iterator();
|
|
while (it2.hasNext()) {
|
|
String str = ((View) it2.next()).id;
|
|
if (str != null) {
|
|
hashSet.add(str);
|
|
} else {
|
|
Log.w("AndroidSVG", "getViewList(): found a <view> without an id attribute");
|
|
}
|
|
}
|
|
return hashSet;
|
|
}
|
|
|
|
public boolean hasCSSRules() {
|
|
return !this.cssRules.isEmpty();
|
|
}
|
|
|
|
public void renderToCanvas(Canvas canvas, RectF rectF) {
|
|
RenderOptions renderOptions = new RenderOptions();
|
|
if (rectF != null) {
|
|
renderOptions.viewPort(rectF.left, rectF.top, rectF.width(), rectF.height());
|
|
} else {
|
|
renderOptions.viewPort(0.0f, 0.0f, canvas.getWidth(), canvas.getHeight());
|
|
}
|
|
new SVGAndroidRenderer(canvas, this.renderDPI).renderDocument(this, renderOptions);
|
|
}
|
|
|
|
public Picture renderToPicture(RenderOptions renderOptions) {
|
|
Length length;
|
|
Box box = (renderOptions == null || !renderOptions.hasViewBox()) ? this.rootElement.viewBox : renderOptions.viewBox;
|
|
if (renderOptions != null && renderOptions.hasViewPort()) {
|
|
return renderToPicture((int) Math.ceil(renderOptions.viewPort.maxX()), (int) Math.ceil(renderOptions.viewPort.maxY()), renderOptions);
|
|
}
|
|
Svg svg = this.rootElement;
|
|
Length length2 = svg.width;
|
|
if (length2 != null) {
|
|
Unit unit = length2.unit;
|
|
Unit unit2 = Unit.percent;
|
|
if (unit != unit2 && (length = svg.height) != null && length.unit != unit2) {
|
|
return renderToPicture((int) Math.ceil(length2.floatValue(this.renderDPI)), (int) Math.ceil(this.rootElement.height.floatValue(this.renderDPI)), renderOptions);
|
|
}
|
|
}
|
|
if (length2 != null && box != null) {
|
|
return renderToPicture((int) Math.ceil(length2.floatValue(this.renderDPI)), (int) Math.ceil((box.height * r1) / box.width), renderOptions);
|
|
}
|
|
Length length3 = svg.height;
|
|
if (length3 == null || box == null) {
|
|
return renderToPicture(512, 512, renderOptions);
|
|
}
|
|
return renderToPicture((int) Math.ceil((box.width * r1) / box.height), (int) Math.ceil(length3.floatValue(this.renderDPI)), renderOptions);
|
|
}
|
|
|
|
public void renderViewToCanvas(String str, Canvas canvas, RectF rectF) {
|
|
RenderOptions view = RenderOptions.create().view(str);
|
|
if (rectF != null) {
|
|
view.viewPort(rectF.left, rectF.top, rectF.width(), rectF.height());
|
|
}
|
|
renderToCanvas(canvas, view);
|
|
}
|
|
|
|
public Picture renderViewToPicture(String str, int i, int i2) {
|
|
RenderOptions renderOptions = new RenderOptions();
|
|
renderOptions.view(str).viewPort(0.0f, 0.0f, i, i2);
|
|
Picture picture = new Picture();
|
|
new SVGAndroidRenderer(picture.beginRecording(i, i2), this.renderDPI).renderDocument(this, renderOptions);
|
|
picture.endRecording();
|
|
return picture;
|
|
}
|
|
|
|
public SvgObject resolveIRI(String str) {
|
|
if (str == null) {
|
|
return null;
|
|
}
|
|
String cssQuotedString = cssQuotedString(str);
|
|
if (cssQuotedString.length() <= 1 || !cssQuotedString.startsWith("#")) {
|
|
return null;
|
|
}
|
|
return getElementById(cssQuotedString.substring(1));
|
|
}
|
|
|
|
public void setDesc(String str) {
|
|
this.desc = str;
|
|
}
|
|
|
|
public void setDocumentHeight(float f) {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.height = new Length(f);
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
public void setDocumentPreserveAspectRatio(PreserveAspectRatio preserveAspectRatio) {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.preserveAspectRatio = preserveAspectRatio;
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
public void setDocumentViewBox(float f, float f2, float f3, float f4) {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.viewBox = new Box(f, f2, f3, f4);
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
public void setDocumentWidth(float f) {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.width = new Length(f);
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
public void setRenderDPI(float f) {
|
|
this.renderDPI = f;
|
|
}
|
|
|
|
public void setRootElement(Svg svg) {
|
|
this.rootElement = svg;
|
|
}
|
|
|
|
public void setTitle(String str) {
|
|
this.title = str;
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Length implements Cloneable {
|
|
Unit unit;
|
|
float value;
|
|
|
|
public Length(float f) {
|
|
this.value = f;
|
|
this.unit = Unit.px;
|
|
}
|
|
|
|
public float floatValue(float f) {
|
|
int i = AnonymousClass1.$SwitchMap$com$caverock$androidsvg$SVG$Unit[this.unit.ordinal()];
|
|
if (i == 1) {
|
|
return this.value;
|
|
}
|
|
switch (i) {
|
|
case 4:
|
|
return this.value * f;
|
|
case 5:
|
|
return (this.value * f) / 2.54f;
|
|
case 6:
|
|
return (this.value * f) / 25.4f;
|
|
case 7:
|
|
return (this.value * f) / 72.0f;
|
|
case 8:
|
|
return (this.value * f) / 6.0f;
|
|
default:
|
|
return this.value;
|
|
}
|
|
}
|
|
|
|
public float floatValueX(SVGAndroidRenderer sVGAndroidRenderer) {
|
|
switch (AnonymousClass1.$SwitchMap$com$caverock$androidsvg$SVG$Unit[this.unit.ordinal()]) {
|
|
case 1:
|
|
return this.value;
|
|
case 2:
|
|
return this.value * sVGAndroidRenderer.getCurrentFontSize();
|
|
case 3:
|
|
return this.value * sVGAndroidRenderer.getCurrentFontXHeight();
|
|
case 4:
|
|
return this.value * sVGAndroidRenderer.getDPI();
|
|
case 5:
|
|
return (this.value * sVGAndroidRenderer.getDPI()) / 2.54f;
|
|
case 6:
|
|
return (this.value * sVGAndroidRenderer.getDPI()) / 25.4f;
|
|
case 7:
|
|
return (this.value * sVGAndroidRenderer.getDPI()) / 72.0f;
|
|
case 8:
|
|
return (this.value * sVGAndroidRenderer.getDPI()) / 6.0f;
|
|
case 9:
|
|
Box currentViewPortInUserUnits = sVGAndroidRenderer.getCurrentViewPortInUserUnits();
|
|
float f = this.value;
|
|
return currentViewPortInUserUnits == null ? f : (f * currentViewPortInUserUnits.width) / 100.0f;
|
|
default:
|
|
return this.value;
|
|
}
|
|
}
|
|
|
|
public float floatValueY(SVGAndroidRenderer sVGAndroidRenderer) {
|
|
if (this.unit != Unit.percent) {
|
|
return floatValueX(sVGAndroidRenderer);
|
|
}
|
|
Box currentViewPortInUserUnits = sVGAndroidRenderer.getCurrentViewPortInUserUnits();
|
|
float f = this.value;
|
|
return currentViewPortInUserUnits == null ? f : (f * currentViewPortInUserUnits.height) / 100.0f;
|
|
}
|
|
|
|
public boolean isNegative() {
|
|
return this.value < 0.0f;
|
|
}
|
|
|
|
public boolean isZero() {
|
|
return this.value == 0.0f;
|
|
}
|
|
|
|
public String toString() {
|
|
return String.valueOf(this.value) + this.unit;
|
|
}
|
|
|
|
public Length(float f, Unit unit) {
|
|
this.value = f;
|
|
this.unit = unit;
|
|
}
|
|
|
|
public float floatValue(SVGAndroidRenderer sVGAndroidRenderer) {
|
|
float sqrt;
|
|
if (this.unit == Unit.percent) {
|
|
Box currentViewPortInUserUnits = sVGAndroidRenderer.getCurrentViewPortInUserUnits();
|
|
if (currentViewPortInUserUnits == null) {
|
|
return this.value;
|
|
}
|
|
float f = currentViewPortInUserUnits.width;
|
|
if (f == currentViewPortInUserUnits.height) {
|
|
sqrt = this.value * f;
|
|
} else {
|
|
sqrt = this.value * ((float) (Math.sqrt((r6 * r6) + (f * f)) / SVG.SQRT2));
|
|
}
|
|
return sqrt / 100.0f;
|
|
}
|
|
return floatValueX(sVGAndroidRenderer);
|
|
}
|
|
|
|
public float floatValue(SVGAndroidRenderer sVGAndroidRenderer, float f) {
|
|
if (this.unit == Unit.percent) {
|
|
return (this.value * f) / 100.0f;
|
|
}
|
|
return floatValueX(sVGAndroidRenderer);
|
|
}
|
|
|
|
public float floatValue() {
|
|
return this.value;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class SolidColor extends SvgElementBase implements SvgContainer {
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public List<SvgObject> getChildren() {
|
|
return Collections.EMPTY_LIST;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "solidColor";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public void addChild(SvgObject svgObject) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Stop extends SvgElementBase implements SvgContainer {
|
|
Float offset;
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public List<SvgObject> getChildren() {
|
|
return Collections.EMPTY_LIST;
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgObject
|
|
public String getNodeName() {
|
|
return "stop";
|
|
}
|
|
|
|
@Override // com.caverock.androidsvg.SVG.SvgContainer
|
|
public void addChild(SvgObject svgObject) {
|
|
}
|
|
}
|
|
|
|
public void setDocumentHeight(String str) throws SVGParseException {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.height = SVGParser.parseLength(str);
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
public void setDocumentWidth(String str) throws SVGParseException {
|
|
Svg svg = this.rootElement;
|
|
if (svg != null) {
|
|
svg.width = SVGParser.parseLength(str);
|
|
} else {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("SVG document is empty");
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
public static class Box {
|
|
float height;
|
|
float minX;
|
|
float minY;
|
|
float width;
|
|
|
|
public Box(Box box) {
|
|
this.minX = box.minX;
|
|
this.minY = box.minY;
|
|
this.width = box.width;
|
|
this.height = box.height;
|
|
}
|
|
|
|
public static Box fromLimits(float f, float f2, float f3, float f4) {
|
|
return new Box(f, f2, f3 - f, f4 - f2);
|
|
}
|
|
|
|
public float maxX() {
|
|
return this.minX + this.width;
|
|
}
|
|
|
|
public float maxY() {
|
|
return this.minY + this.height;
|
|
}
|
|
|
|
public RectF toRectF() {
|
|
return new RectF(this.minX, this.minY, maxX(), maxY());
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder(MarkdownConstants.LEFT_BRACKET);
|
|
sb.append(this.minX);
|
|
sb.append(" ");
|
|
sb.append(this.minY);
|
|
sb.append(" ");
|
|
sb.append(this.width);
|
|
sb.append(" ");
|
|
return ErrorUtils$$ExternalSyntheticOutline0.m(sb, MarkdownConstants.RIGHT_BRACKET, this.height);
|
|
}
|
|
|
|
public void union(Box box) {
|
|
float f = box.minX;
|
|
if (f < this.minX) {
|
|
this.minX = f;
|
|
}
|
|
float f2 = box.minY;
|
|
if (f2 < this.minY) {
|
|
this.minY = f2;
|
|
}
|
|
if (box.maxX() > maxX()) {
|
|
this.width = box.maxX() - this.minX;
|
|
}
|
|
if (box.maxY() > maxY()) {
|
|
this.height = box.maxY() - this.minY;
|
|
}
|
|
}
|
|
|
|
public Box(float f, float f2, float f3, float f4) {
|
|
this.minX = f;
|
|
this.minY = f2;
|
|
this.width = f3;
|
|
this.height = f4;
|
|
}
|
|
}
|
|
|
|
public static SVG getFromResource(Context context, int i) throws SVGParseException {
|
|
return getFromResource(context.getResources(), i);
|
|
}
|
|
|
|
public void renderViewToCanvas(String str, Canvas canvas) {
|
|
renderToCanvas(canvas, RenderOptions.create().view(str));
|
|
}
|
|
|
|
private List<SvgObject> getElementsByTagName(String str) {
|
|
ArrayList arrayList = new ArrayList();
|
|
getElementsByTagName(arrayList, this.rootElement, str);
|
|
return arrayList;
|
|
}
|
|
|
|
public void renderToCanvas(Canvas canvas) {
|
|
renderToCanvas(canvas, (RenderOptions) null);
|
|
}
|
|
|
|
public void renderToCanvas(Canvas canvas, RenderOptions renderOptions) {
|
|
if (renderOptions == null) {
|
|
renderOptions = new RenderOptions();
|
|
}
|
|
if (!renderOptions.hasViewPort()) {
|
|
renderOptions.viewPort(0.0f, 0.0f, canvas.getWidth(), canvas.getHeight());
|
|
}
|
|
new SVGAndroidRenderer(canvas, this.renderDPI).renderDocument(this, renderOptions);
|
|
}
|
|
|
|
public SvgElementBase getElementById(String str) {
|
|
if (str == null || str.length() == 0) {
|
|
return null;
|
|
}
|
|
if (str.equals(this.rootElement.id)) {
|
|
return this.rootElement;
|
|
}
|
|
if (this.idToElementMap.containsKey(str)) {
|
|
return this.idToElementMap.get(str);
|
|
}
|
|
SvgElementBase elementById = getElementById(this.rootElement, str);
|
|
this.idToElementMap.put(str, elementById);
|
|
return elementById;
|
|
}
|
|
|
|
public Picture renderToPicture(int i, int i2) {
|
|
return renderToPicture(i, i2, null);
|
|
}
|
|
|
|
public Picture renderToPicture() {
|
|
return renderToPicture(null);
|
|
}
|
|
|
|
public Picture renderToPicture(int i, int i2, RenderOptions renderOptions) {
|
|
Picture picture = new Picture();
|
|
Canvas beginRecording = picture.beginRecording(i, i2);
|
|
if (renderOptions == null || renderOptions.viewPort == null) {
|
|
renderOptions = renderOptions == null ? new RenderOptions() : new RenderOptions(renderOptions);
|
|
renderOptions.viewPort(0.0f, 0.0f, i, i2);
|
|
}
|
|
new SVGAndroidRenderer(beginRecording, this.renderDPI).renderDocument(this, renderOptions);
|
|
picture.endRecording();
|
|
return picture;
|
|
}
|
|
}
|