Class ConicGradientNode

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ConicGradientNode extends RenderNode
A render node for a conic gradient.
  • Constructor Details

    • ConicGradientNode

      public ConicGradientNode(MemorySegment address)
      Create a ConicGradientNode instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • ConicGradientNode

      public ConicGradientNode(Rect bounds, Point center, float rotation, @Nullable ColorStop @Nullable [] colorStops)

      Creates a GskRenderNode that draws a conic gradient.

      The conic gradient starts around center in the direction of rotation. A rotation of 0 means that the gradient points up. Color stops are then added clockwise.

      Parameters:
      bounds - the bounds of the node
      center - the center of the gradient
      rotation - the rotation of the gradient in degrees
      colorStops - a pointer to an array of GskColorStop defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ConicGradientNode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected ConicGradientNode asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class RenderNode
      Returns:
      the instance as if it were its parent type
    • getAngle

      public float getAngle()

      Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].

      The angle is starting at the top and going clockwise, as expressed in the css specification:

      angle = 90 - gsk_conic_gradient_node_get_rotation()
      
      Returns:
      the angle for the gradient
      Since:
      4.2
    • getCenter

      public Point getCenter()
      Retrieves the center pointer for the gradient.
      Returns:
      the center point for the gradient
    • getColorStops

      public ColorStop[] getColorStops()
      Retrieves the color stops in the gradient.
      Returns:
      the color stops in the gradient
    • getNColorStops

      public long getNColorStops()
      Retrieves the number of color stops in the gradient.
      Returns:
      the number of color stops
    • getRotation

      public float getRotation()
      Retrieves the rotation for the gradient in degrees.
      Returns:
      the rotation for the gradient