Module bus.extra

Class RenderHintsBuilder

java.lang.Object
org.miaixz.bus.extra.image.RenderHintsBuilder
All Implemented Interfaces:
Serializable, org.miaixz.bus.core.Builder<RenderingHints>

public class RenderHintsBuilder extends Object implements org.miaixz.bus.core.Builder<RenderingHints>
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Method Details

    • of

      public static RenderHintsBuilder of()
      Creates a RenderingHints builder.
      Returns:
      A RenderingHintsBuilder.
    • setAntialiasing

      public RenderHintsBuilder setAntialiasing(RenderHintsBuilder.Antialias antialias)
      Sets whether to use anti-aliasing.
      Parameters:
      antialias - The anti-aliasing option. If null, this option is removed.
      Returns:
      this
    • setTextAntialias

      public RenderHintsBuilder setTextAntialias(RenderHintsBuilder.TextAntialias textAntialias)
      Sets whether to use anti-aliasing for text rendering.
      Parameters:
      textAntialias - The text anti-aliasing option. If null, this option is removed.
      Returns:
      this
    • setColorRendering

      public RenderHintsBuilder setColorRendering(RenderHintsBuilder.ColorRender colorRender)
      Sets the rendering method for color rendering.
      Parameters:
      colorRender - The color rendering method. If null, this option is removed.
      Returns:
      this
    • setDithering

      public RenderHintsBuilder setDithering(RenderHintsBuilder.Dither dither)
      Sets how to handle dithering. Dithering is the process of synthesizing a wider range of colors from a limited set by coloring adjacent pixels to create the illusion of a new color.
      Parameters:
      dither - How to handle dithering. If null, this option is removed.
      Returns:
      this
    • setFractionalMetrics

      public RenderHintsBuilder setFractionalMetrics(RenderHintsBuilder.FractionalMetrics fractionalMetrics)
      Sets the font metrics.
      Parameters:
      fractionalMetrics - The font metrics option. If null, this option is removed.
      Returns:
      this
    • setInterpolation

      public RenderHintsBuilder setInterpolation(RenderHintsBuilder.Interpolation interpolation)
      Sets how interpolation is performed. When transforming a source image, the transformed pixels rarely align perfectly with the target pixel positions. In such cases, the color value of each transformed pixel must be determined from the surrounding pixels. Interpolation is the process of achieving this.
      Parameters:
      interpolation - The interpolation method. If null, this option is removed.
      Returns:
      this
    • setAlphaInterpolation

      public RenderHintsBuilder setAlphaInterpolation(RenderHintsBuilder.AlphaInterpolation alphaInterpolation)
      Sets the alpha compositing adjustment.
      Parameters:
      alphaInterpolation - The alpha compositing adjustment. If null, this option is removed.
      Returns:
      this
    • setRendering

      public RenderHintsBuilder setRendering(RenderHintsBuilder.Render render)
      Sets the rendering technique, balancing speed and quality.
      Parameters:
      render - The rendering technique. If null, this option is removed.
      Returns:
      this
    • setStrokeControl

      public RenderHintsBuilder setStrokeControl(RenderHintsBuilder.StrokeControl strokeControl)
      Sets the stroke normalization control.
      Parameters:
      strokeControl - The stroke normalization control. If null, this option is removed.
      Returns:
      this
    • setTextLCDContrast

      public RenderHintsBuilder setTextLCDContrast(Integer textLCDContrast)
      Sets the LCD text contrast rendering. A positive integer between 100 and 250. Typically, the useful range is 140-180.
      Parameters:
      textLCDContrast - The LCD text contrast rendering, a positive integer between 100 and 250.
      Returns:
      this
    • build

      public RenderingHints build()
      Specified by:
      build in interface org.miaixz.bus.core.Builder<RenderingHints>