Record Class Transform

java.lang.Object
java.lang.Record
io.leandev.appfuse.report.internal.svg.Transform

public record Transform(double a, double b, double c, double d, double e, double f) extends Record
二維仿射轉換:x' = a·x + c·y + e、y' = b·x + d·y + f(與 SVG matrix(a b c d e f) 相同)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Transform
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Transform(double a, double b, double c, double d, double e, double f)
    Creates an instance of a Transform record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    a()
    Returns the value of the a record component.
    double
    b()
    Returns the value of the b record component.
    double
    c()
    Returns the value of the c record component.
    double
    d()
    Returns the value of the d record component.
    double
    e()
    Returns the value of the e record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    f()
    Returns the value of the f record component.
    final int
    Returns a hash code value for this object.
    double
    最大縮放(線性部分的最大奇異值),用於線寬與字級
    static Transform
    rotate(double degrees)
     
    static Transform
    scale(double sx, double sy)
     
    先套用 other,再套用本轉換
    final String
    Returns a string representation of this record class.
    static Transform
    translate(double tx, double ty)
     
    double
    x(double x, double y)
     
    double
    y(double x, double y)
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • IDENTITY

      public static final Transform IDENTITY
  • Constructor Details

    • Transform

      public Transform(double a, double b, double c, double d, double e, double f)
      Creates an instance of a Transform record class.
      Parameters:
      a - the value for the a record component
      b - the value for the b record component
      c - the value for the c record component
      d - the value for the d record component
      e - the value for the e record component
      f - the value for the f record component
  • Method Details

    • translate

      public static Transform translate(double tx, double ty)
    • scale

      public static Transform scale(double sx, double sy)
    • rotate

      public static Transform rotate(double degrees)
      Parameters:
      degrees - 角度(順時針,與 SVG 相同的 y 向下座標系)
    • times

      public Transform times(Transform o)
      先套用 other,再套用本轉換
    • x

      public double x(double x, double y)
    • y

      public double y(double x, double y)
    • maxScale

      public double maxScale()
      最大縮放(線性部分的最大奇異值),用於線寬與字級
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • a

      public double a()
      Returns the value of the a record component.
      Returns:
      the value of the a record component
    • b

      public double b()
      Returns the value of the b record component.
      Returns:
      the value of the b record component
    • c

      public double c()
      Returns the value of the c record component.
      Returns:
      the value of the c record component
    • d

      public double d()
      Returns the value of the d record component.
      Returns:
      the value of the d record component
    • e

      public double e()
      Returns the value of the e record component.
      Returns:
      the value of the e record component
    • f

      public double f()
      Returns the value of the f record component.
      Returns:
      the value of the f record component