Class FractionBasedPainter

    • Field Detail

      • displayName

        private java.lang.String displayName
        The display name of this painter.
      • fractions

        protected float[] fractions
        The fractions of this painter. If the constructor has not thrown an IllegalArgumentException, the entries in this array are strictly increasing, starting from 0.0 and ending at 1.0.
      • alphas

        protected int[] alphas
        The alphas of this painter. Each entry in this array corresponds to the matching entry in fractions and colorQueries. Each entry is applied to the matching
      • colorQueries

        protected ContainerColorTokensSingleColorQuery[] colorQueries
        The color queries of this painter. Each entry in this array corresponds to the matching index in the fractions, specifying which color will be used at the relevant gradient control point. If the constructor has not thrown an IllegalArgumentException, the size of this array is identical to the size of fractions, and there are no null entries in this array. Note that the application code can still cause an exception at runtime by throwing it in the implementation of the ContainerColorTokensSingleColorQuery.query(ContainerColorTokens) method.
    • Constructor Detail

      • FractionBasedPainter

        protected FractionBasedPainter​(java.lang.String displayName,
                                       float[] fractions,
                                       ContainerColorTokensSingleColorQuery[] colorQueries)
        Creates a new fraction-based painter.
        Parameters:
        displayName - The display name of this painter.
        fractions - The fractions of this painter. Must be strictly increasing, starting from 0.0 and ending at 1.0.
        colorQueries - The color queries of this painter. Must have the same size as the fractions array, and all entries must be non-null.
      • FractionBasedPainter

        protected FractionBasedPainter​(java.lang.String displayName,
                                       float[] fractions,
                                       int[] alphas,
                                       ContainerColorTokensSingleColorQuery[] colorQueries)
        Creates a new fraction-based painter.
        Parameters:
        displayName - The display name of this painter.
        fractions - The fractions of this painter. Must be strictly increasing, starting from 0.0 and ending at 1.0.
        alphas - Alpha channels of this painter. Must have the same size as fractions.
        colorQueries - The color queries of this painter. Must have the same size as the fractions array, and all entries must be non-null.
    • Method Detail

      • makeDefaultAlphas

        private static int[] makeDefaultAlphas​(int count)
      • getDisplayName

        public java.lang.String getDisplayName()
        Description copied from interface: RadianceTrait
        Returns the display name of this trait. This method is part of officially supported API.
        Specified by:
        getDisplayName in interface RadianceTrait
        Returns:
        The display name of this trait.
      • getFractions

        public float[] getFractions()
        Returns the fractions of this painter.
        Returns:
        Fractions of this painter.
      • getAlphas

        public int[] getAlphas()