Class TextWatermark.Builder

java.lang.Object
cloud.opencode.base.image.watermark.TextWatermark.Builder
Enclosing class:
TextWatermark

public static class TextWatermark.Builder extends Object
Text Watermark Builder 文字水印构建器
Since:
JDK 25, opencode-base-image V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • text

      public TextWatermark.Builder text(String text)
      Set text 设置文字
      Parameters:
      text - the text | 文字
      Returns:
      this builder | 构建器
    • position

      public TextWatermark.Builder position(Position position)
      Set position 设置位置
      Parameters:
      position - the position | 位置
      Returns:
      this builder | 构建器
    • font

      public TextWatermark.Builder font(Font font)
      Set font 设置字体
      Parameters:
      font - the font | 字体
      Returns:
      this builder | 构建器
    • font

      public TextWatermark.Builder font(String name, int size)
      Set font by name and size 按名称和大小设置字体
      Parameters:
      name - the font name | 字体名称
      size - the font size | 字体大小
      Returns:
      this builder | 构建器
    • font

      public TextWatermark.Builder font(String name, int style, int size)
      Set font by name, style and size 按名称、样式和大小设置字体
      Parameters:
      name - the font name | 字体名称
      style - the font style | 字体样式
      size - the font size | 字体大小
      Returns:
      this builder | 构建器
    • color

      public TextWatermark.Builder color(Color color)
      Set color 设置颜色
      Parameters:
      color - the color | 颜色
      Returns:
      this builder | 构建器
    • color

      public TextWatermark.Builder color(int r, int g, int b)
      Set color by RGB 按RGB设置颜色
      Parameters:
      r - red component | 红色分量
      g - green component | 绿色分量
      b - blue component | 蓝色分量
      Returns:
      this builder | 构建器
    • color

      public TextWatermark.Builder color(int r, int g, int b, int a)
      Set color by RGBA 按RGBA设置颜色
      Parameters:
      r - red component | 红色分量
      g - green component | 绿色分量
      b - blue component | 蓝色分量
      a - alpha component | 透明度分量
      Returns:
      this builder | 构建器
    • opacity

      public TextWatermark.Builder opacity(float opacity)
      Set opacity 设置透明度
      Parameters:
      opacity - the opacity | 透明度
      Returns:
      this builder | 构建器
    • margin

      public TextWatermark.Builder margin(int margin)
      Set margin 设置边距
      Parameters:
      margin - the margin | 边距
      Returns:
      this builder | 构建器
    • build

      public TextWatermark build()
      Build the watermark 构建水印
      Returns:
      the watermark | 水印