class_docstr: The DecomposedTransform class implements a transformation with separate
  translate, rotation, scale, skew, and transformation-center components.
class_docstr_tok: ["The","DecomposedTransform","class","implements","a","transformation","with","separate","translate",",","rotation",",","scale",",","skew",",","and","transformation-center","components","."]
code: def fromTransform(self, transform):
      # Adapted from an answer on
      # https://math.stackexchange.com/questions/13150/extracting-rotation-scale-values-from-2d-transformation-matrix
      a, b, c, d, x, y = transform
  
      sx = math.copysign(1, a)
      if sx < 0:
          a *= sx
          b *= sx
  
      delta = a * d - b * c
  
      rotation = 0
      scaleX = scaleY = 0
      skewX = skewY = 0
  
      # Apply the QR-like decomposition.
      if a != 0 or b != 0:
          r = math.sqrt(a * a + b * b)
          rotation = math.acos(a / r) if b >= 0 else -math.acos(a / r)
          scaleX, scaleY = (r, delta / r)
          skewX, skewY = (math.atan((a * c + b * d) / (r * r)), 0)
      elif c != 0 or d != 0:
          s = math.sqrt(c * c + d * d)
          rotation = math.pi / 2 - (
              math.acos(-c / s) if d >= 0 else -math.acos(c / s)
          )
          scaleX, scaleY = (delta / s, s)
          skewX, skewY = (0, math.atan((a * c + b * d) / (s * s)))
      else:
          # a = b = c = d = 0
          pass
  
      return DecomposedTransform(
          x,
          y,
          math.degrees(rotation),
          scaleX * sx,
          scaleY,
          math.degrees(skewX) * sx,
          math.degrees(skewY),
          0,
          0,
      )
  
imports: import math
  from typing import NamedTuple
  from dataclasses import dataclass
label_desc: Use image node_id 1 for calling the DecomposedTransform obj's underlying member method code with example usage: obj.fromTransform(transform) and returns: DecomposedTransform