Class TextOverlay

  • All Implemented Interfaces:

    
    public final class TextOverlay
    
                        
    • Constructor Detail

    • Method Detail

      • layerMode

         final Optional<BaseOverlay.LayerMode> layerMode()

        Controls how the layer blends with the base image or underlying content. Maps to lm in the URL. By default, layers completely cover the base image beneath them. Layer modes change this behavior:

        • multiply: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints.

        • displace: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires x or y parameter to control displacement magnitude.

        • cutout: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image.

        • cutter: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. See Layer modes.

      • text

         final String text()

        Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding.

      • _type

         final JsonValue _type()

        Expected to always return the following:

        JsonValue.from("text")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • encoding

         final Optional<TextOverlay.Encoding> encoding()

        Text can be included in the layer as either i-{input} (plain text) or ie-{base64_encoded_input} (base64). By default, the SDK selects the appropriate format based on the input text. To always use base64 (ie-{base64}), set this parameter to base64. To always use plain text (i-{input}), set it to plain.

        Regardless of the encoding method, the input text is always percent-encoded to ensure it is URL-safe.

      • _text

         final JsonField<String> _text()

        Returns the raw JSON value of text.

        Unlike text, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final TextOverlay validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.