Package 

Class ColorGrading.Builder

    • Constructor Detail

      • ColorGrading.Builder

        ColorGrading.Builder()
        Use Builder to construct a ColorGrading object instance.
    • Method Detail

      • quality

         ColorGrading.Builder quality(ColorGrading.QualityLevel qualityLevel)

        Sets the quality level of the color grading. When color grading is implemented usinga 3D LUT, the quality level may impact the resolution and bit depth of the backing3D texture. For instance, a low quality level will use a 16x16x16 10 bit LUT, a mediumquality level will use a 32x32x32 10 bit LUT, a high quality will use a 32x32x32 16 bitLUT, and a ultra quality will use a 64x64x64 16 bit LUT.The default quality is MEDIUM.

        Parameters:
        qualityLevel - The desired quality of the color grading process
      • format

         ColorGrading.Builder format(ColorGrading.LutFormat format)

        When color grading is implemented using a 3D LUT, this sets the texture format ofof the LUT. This overrides the value set by quality().The default is INTEGER

        Parameters:
        format - The desired format of the 3D LUT.
      • dimensions

         ColorGrading.Builder dimensions(int dim)

        When color grading is implemented using a 3D LUT, this sets the dimension of the LUT.This overrides the value set by quality().The default is 32

        Parameters:
        dim - The desired dimension of the LUT.
      • toneMapper

         ColorGrading.Builder toneMapper(ToneMapper toneMapper)

        Selects the tone mapping operator to apply to the HDR color buffer as the lastoperation of the color grading post-processing step.The default tone mapping operator is ToneMapper.ACESLegacy.The specified tone mapper must have a lifecycle that exceeds the lifetime ofthis builder. Since the build(Engine&) method is synchronous, it is safe todelete the tone mapper object after that finishes executing.

        Parameters:
        toneMapper - The tone mapping operator to apply to the HDR color buffer
      • toneMapping

        @Deprecated() ColorGrading.Builder toneMapping(ColorGrading.ToneMapping toneMapping)

        Selects the tone mapping operator to apply to the HDR color buffer as the lastoperation of the color grading post-processing step.The default tone mapping operator is ACES_LEGACY.

        Parameters:
        toneMapping - The tone mapping operator to apply to the HDR color buffer
      • luminanceScaling

         ColorGrading.Builder luminanceScaling(boolean luminanceScaling)

        Enables or disables the luminance scaling component (LICH) from the exposure valueinvariant luminance system (EVILS). When this setting is enabled, pixels with highchromatic values will roll-off to white to offer a more natural rendering. This stepalso helps avoid undesirable hue skews caused by out of gamut colors clippedto the destination color gamut.When luminance scaling is enabled, tone mapping is performed on the luminance of eachpixel instead of per-channel.

        Parameters:
        luminanceScaling - Enables or disables EVILS post-tone mapping
      • gamutMapping

         ColorGrading.Builder gamutMapping(boolean gamutMapping)

        Enables or disables gamut mapping to the destination color space's gamut. When gamutmapping is turned off, out-of-gamut colors are clipped to the destination's gamut,which may produce hue skews (blue skewing to purple, green to yellow, etc.). Whengamut mapping is enabled, out-of-gamut colors are brought back in gamut by trying topreserve the perceived chroma and lightness of the original values.

        Parameters:
        gamutMapping - Enables or disables gamut mapping
      • exposure

         ColorGrading.Builder exposure(float exposure)

        Adjusts the exposure of this image. The exposure is specified in stops:each stop brightens (positive values) or darkens (negative values) the image bya factor of 2. This means that an exposure of 3 will brighten the image 8 timesmore than an exposure of 0 (2^3 = 8 and 2^0 = 1). Contrary to the camera's exposure,this setting is applied after all post-processing (bloom, etc.) are applied.

        Parameters:
        exposure - Value in EV stops.
      • nightAdaptation

         ColorGrading.Builder nightAdaptation(float adaptation)

        Controls the amount of night adaptation to replicate a more natural representation oflow-light conditions as perceived by the human vision system. In low-light conditions,peak luminance sensitivity of the eye shifts toward the blue end of the color spectrum:darker tones appear brighter, reducing contrast, and colors are blue shifted (the darkerthe more intense the effect).

        Parameters:
        adaptation - Amount of adaptation, between 0 (no adaptation) and 1 (full adaptation).
      • whiteBalance

         ColorGrading.Builder whiteBalance(float temperature, float tint)

        Adjusts the while balance of the image. This can be used to remove color castsand correct the appearance of the white point in the scene, or to alter theoverall chromaticity of the image for artistic reasons (to make the image appearcooler or warmer for instance).The while balance adjustment is defined with two values:

        • Temperature, to modify the color temperature. This value will modify the colorson a blue/yellow axis. Lower values apply a cool color temperature, and highervalues apply a warm color temperature. The lowest value, -1.0f, is equivalent toa temperature of 50,000K. The highest value, 1.0f, is equivalent to a temperatureof 2,000K.
        • Tint, to modify the colors on a green/magenta axis. The lowest value, -1.0f, willapply a strong green cast, and the highest value, 1.0f, will apply a strong magentacast.
        Both values are expected to be in the range [-1.0..+1.0]. Values outsideof that range will be clipped to that range.
        Parameters:
        temperature - Modification on the blue/yellow axis, as a value between -1.0 and +1.0.
        tint - Modification on the green/magenta axis, as a value between -1.0 and +1.0.
      • channelMixer

         ColorGrading.Builder channelMixer(@NonNull() @Size(min = 3) Array<float> outRed, @NonNull() @Size(min = 3) Array<float> outGreen, @NonNull() @Size(min = 3) Array<float> outBlue)

        The channel mixer adjustment modifies each output color channel using the specifiedmix of the source color channels.By default each output color channel is set to use 100% of the corresponding sourcechannel and 0% of the other channels. For instance, the output red channel is set to{1.0, 0.0, 1.0} or 100% red, 0% green and 0% blue.Each output channel can add or subtract data from the source channel by using valuesin the range [-2.0..+2.0]. Values outside of that range will be clippedto that range.Using the channel mixer adjustment you can for instance create a monochrome outputby setting all 3 output channels to the same mix. For instance:{0.4, 0.4, 0.2} for all 3 output channels(40% red, 40% green and 20% blue).More complex mixes can be used to create more complex effects. For instance, here isa mix that creates a sepia tone effect:

        • outRed = {0.255, 0.858, 0.087}
        • outGreen = {0.213, 0.715, 0.072}
        • outBlue = {0.170, 0.572, 0.058}
        Parameters:
        outRed - The mix of source RGB for the output red channel, between -2.0 and +2.
        outGreen - The mix of source RGB for the output green channel, between -2.0 and +2.
        outBlue - The mix of source RGB for the output blue channel, between -2.0 and +2.
      • shadowsMidtonesHighlights

         ColorGrading.Builder shadowsMidtonesHighlights(@NonNull() @Size(min = 4) Array<float> shadows, @NonNull() @Size(min = 4) Array<float> midtones, @NonNull() @Size(min = 4) Array<float> highlights, @NonNull() @Size(min = 4) Array<float> ranges)

        Adjusts the colors separately in 3 distinct tonal ranges or zones: shadows, mid-tones,and highlights.The tonal zones are by the ranges parameter: the x and y components define the beginningand end of the transition from shadows to mid-tones, and the z and w components definethe beginning and end of the transition from mid-tones to highlights.A smooth transition is applied between the zones which means for instance that thecorrection color of the shadows range will partially apply to the mid-tones, and theother way around. This ensure smooth visual transitions in the final image.Each correction color is defined as a linear RGB color and a weight. The weight is avalue (which may be positive or negative) that is added to the linear RGB color beforemixing. This can be used to darken or brighten the selected tonal range.Shadows/mid-tones/highlights adjustment are performed linear space.

        Parameters:
        shadows - Linear RGB color (.rgb) and weight (.
        midtones - Linear RGB color (.rgb) and weight (.
        highlights - Linear RGB color (.rgb) and weight (.
        ranges - Range of the shadows (x and y), and range of the highlights (z and w)
      • slopeOffsetPower

         ColorGrading.Builder slopeOffsetPower(@NonNull() @Size(min = 3) Array<float> slope, @NonNull() @Size(min = 3) Array<float> offset, @NonNull() @Size(min = 3) Array<float> power)

        Applies a slope, offset, and power, as defined by the ASC CDL (American Society ofCinematographers Color Decision List) to the image. The CDL can be used to adjust thecolors of different tonal ranges in the image.The ASC CDL is similar to the lift/gamma/gain controls found in many color grading tools.Lift is equivalent to a combination of offset and slope, gain is equivalent to slope,and gamma is equivalent to power.The slope and power values must be strictly positive. Values less than or equal to 0 willbe clamped to a small positive value, offset can be any positive or negative value.Version 1.2 of the ASC CDL adds saturation control, which is here provided as a separateAPI. See the saturation() method for more information.Slope/offset/power adjustments are performed in log space.

        Parameters:
        slope - Multiplier of the input color, must be a strictly positive number
        offset - Added to the input color, can be a negative or positive number, including 0
        power - Power exponent of the input color, must be a strictly positive number
      • contrast

         ColorGrading.Builder contrast(float contrast)

        Adjusts the contrast of the image. Lower values decrease the contrast of the image(the tonal range is narrowed), and higher values increase the contrast of the image(the tonal range is widened). A value of 1.0 has no effect.The contrast is defined as a value in the range [0.0...2.0]. Valuesoutside of that range will be clipped to that range.Contrast adjustment is performed in log space.

        Parameters:
        contrast - Contrast expansion, between 0.0 and 2.0.
      • vibrance

         ColorGrading.Builder vibrance(float vibrance)

        Adjusts the saturation of the image based on the input color's saturation level.Colors with a high level of saturation are less affected than colors with low saturationlevels.Lower vibrance values decrease intensity of the colors present in the image, andhigher values increase the intensity of the colors in the image. A value of 1.0 hasno effect.The vibrance is defined as a value in the range [0.0...2.0]. Values outsideof that range will be clipped to that range.Vibrance adjustment is performed in linear space.

        Parameters:
        vibrance - Vibrance, between 0.0 and 2.0.
      • saturation

         ColorGrading.Builder saturation(float saturation)

        Adjusts the saturation of the image. Lower values decrease intensity of the colorspresent in the image, and higher values increase the intensity of the colors in theimage. A value of 1.0 has no effect.The saturation is defined as a value in the range [0.0...2.0].Values outside of that range will be clipped to that range.Saturation adjustment is performed in linear space.

        Parameters:
        saturation - Saturation, between 0.0 and 2.0.
      • curves

         ColorGrading.Builder curves(@NonNull() @Size(min = 3) Array<float> shadowGamma, @NonNull() @Size(min = 3) Array<float> midPoint, @NonNull() @Size(min = 3) Array<float> highlightScale)

        Applies a curve to each RGB channel of the image. Each curve is defined by 3 values:a gamma value applied to the shadows only, a mid-point indicating where shadows stopand highlights start, and a scale factor for the highlights.The gamma and mid-point must be strictly positive values. If they are not, they will beclamped to a small positive value. The scale can be any negative of positive value.Curves are applied in linear space.

        Parameters:
        shadowGamma - Power value to apply to the shadows, must be strictly positive
        midPoint - Mid-point defining where shadows stop and highlights start, must be strictly positive
        highlightScale - Scale factor for the highlights, can be any negative or positive value