Class NSVGShape

  • All Implemented Interfaces:
    Pointer

    public class NSVGShape
    extends Struct

    Member documentation

    • id – optional 'id' attr of the shape or its group
    • fill – fill paint
    • stroke – stroke paint
    • opacity – opacity of the shape
    • strokeWidth – stroke width (scaled)
    • strokeDashOffset – stroke dash offset (scaled)
    • strokeDashArray – stroke dash array (scaled)
    • strokeDashCount – number of dash values in dash array
    • strokeLineJoin – stroke join type
    • strokeLineCap – stroke cap type
    • miterLimit – miter limit
    • fillRule – fill rule, see NSVGfillRule
    • flags – logical or of NSVG_FLAGS_* flags
    • bounds – tight bounding box of the shape [minx,miny,maxx,maxy]
    • paths – linked list of paths in the image
    • next – pointer to next shape, or NULL if last element

    Layout

    
     struct NSVGshape {
         char id[64];
         NSVGpaint fill;
         NSVGpaint stroke;
         float opacity;
         float strokeWidth;
         float strokeDashOffset;
         float strokeDashArray[8];
         char strokeDashCount;
         char strokeLineJoin;
         char strokeLineCap;
         float miterLimit;
         char fillRule;
         unsigned char flags;
         float bounds[4];
         NSVGpath * paths;
         NSVGshape * next;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ID, FILL, STROKE, OPACITY, STROKEWIDTH, STROKEDASHOFFSET, STROKEDASHARRAY, STROKEDASHCOUNT, STROKELINEJOIN, STROKELINECAP, MITERLIMIT, FILLRULE, FLAGS, BOUNDS, PATHS, NEXT

        The struct member offsets.
    • Constructor Detail

      • NSVGShape

        public NSVGShape​(java.nio.ByteBuffer container)
        Creates a NSVGShape instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • id

        public java.nio.ByteBuffer id()
        Returns a ByteBuffer view of the id field.
      • id

        public byte id​(int index)
        Returns the value at the specified index of the id field.
      • opacity

        public float opacity()
        Returns the value of the opacity field.
      • strokeWidth

        public float strokeWidth()
        Returns the value of the strokeWidth field.
      • strokeDashOffset

        public float strokeDashOffset()
        Returns the value of the strokeDashOffset field.
      • strokeDashArray

        public java.nio.FloatBuffer strokeDashArray()
        Returns a FloatBuffer view of the strokeDashArray field.
      • strokeDashArray

        public float strokeDashArray​(int index)
        Returns the value at the specified index of the strokeDashArray field.
      • strokeDashCount

        public byte strokeDashCount()
        Returns the value of the strokeDashCount field.
      • strokeLineJoin

        public byte strokeLineJoin()
        Returns the value of the strokeLineJoin field.
      • strokeLineCap

        public byte strokeLineCap()
        Returns the value of the strokeLineCap field.
      • miterLimit

        public float miterLimit()
        Returns the value of the miterLimit field.
      • fillRule

        public byte fillRule()
        Returns the value of the fillRule field.
      • flags

        public byte flags()
        Returns the value of the flags field.
      • bounds

        public java.nio.FloatBuffer bounds()
        Returns a FloatBuffer view of the bounds field.
      • bounds

        public float bounds​(int index)
        Returns the value at the specified index of the bounds field.
      • paths

        public NSVGPath paths()
        Returns a NSVGPath view of the struct pointed to by the paths field.
      • next

        public NSVGShape next()
        Returns a NSVGShape view of the struct pointed to by the next field.
      • create

        public static NSVGShape create​(long address)
        Returns a new NSVGShape instance for the specified memory address.
      • createSafe

        @Nullable
        public static NSVGShape createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static NSVGShape.Buffer create​(long address,
                                              int capacity)
        Create a NSVGShape.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static NSVGShape.Buffer createSafe​(long address,
                                                  int capacity)
        Like create, but returns null if address is NULL.
      • nid

        public static java.nio.ByteBuffer nid​(long struct)
        Unsafe version of id().
      • nid

        public static byte nid​(long struct,
                               int index)
        Unsafe version of id.
      • nfill

        public static NSVGPaint nfill​(long struct)
        Unsafe version of fill().
      • nstroke

        public static NSVGPaint nstroke​(long struct)
        Unsafe version of stroke().
      • nopacity

        public static float nopacity​(long struct)
        Unsafe version of opacity().
      • nstrokeWidth

        public static float nstrokeWidth​(long struct)
        Unsafe version of strokeWidth().
      • nstrokeDashOffset

        public static float nstrokeDashOffset​(long struct)
        Unsafe version of strokeDashOffset().
      • nstrokeDashArray

        public static java.nio.FloatBuffer nstrokeDashArray​(long struct)
        Unsafe version of strokeDashArray().
      • nstrokeDashArray

        public static float nstrokeDashArray​(long struct,
                                             int index)
        Unsafe version of strokeDashArray.
      • nstrokeDashCount

        public static byte nstrokeDashCount​(long struct)
        Unsafe version of strokeDashCount().
      • nstrokeLineJoin

        public static byte nstrokeLineJoin​(long struct)
        Unsafe version of strokeLineJoin().
      • nstrokeLineCap

        public static byte nstrokeLineCap​(long struct)
        Unsafe version of strokeLineCap().
      • nmiterLimit

        public static float nmiterLimit​(long struct)
        Unsafe version of miterLimit().
      • nfillRule

        public static byte nfillRule​(long struct)
        Unsafe version of fillRule().
      • nflags

        public static byte nflags​(long struct)
        Unsafe version of flags().
      • nbounds

        public static java.nio.FloatBuffer nbounds​(long struct)
        Unsafe version of bounds().
      • nbounds

        public static float nbounds​(long struct,
                                    int index)
        Unsafe version of bounds.
      • npaths

        public static NSVGPath npaths​(long struct)
        Unsafe version of paths().
      • nnext

        public static NSVGShape nnext​(long struct)
        Unsafe version of next().