Class: Imagekitio::Models::BaseOverlay

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/imagekitio/models/base_overlay.rb

Defined Under Namespace

Modules: LayerMode

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(layer_mode: nil, position: nil, timing: nil) ⇒ Object

Some parameter documentations has been truncated, see Imagekitio::Models::BaseOverlay for more details.

Parameters:

  • (defaults to: nil)

    Controls how the layer blends with the base image or underlying content. Maps to

  • (defaults to: nil)

    Specifies the overlay’s position relative to the parent asset.

  • (defaults to: nil)

    Specifies timing information for the overlay (only applicable if the base asset



# File 'lib/imagekitio/models/base_overlay.rb', line 46


Instance Attribute Details

#layer_modeSymbol, ...

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](imagekit.io/docs/add-overlays-on-images#layer-modes).

Returns:



29
# File 'lib/imagekitio/models/base_overlay.rb', line 29

optional :layer_mode, enum: -> { Imagekitio::BaseOverlay::LayerMode }, api_name: :layerMode

#positionImagekitio::Models::OverlayPosition?

Specifies the overlay’s position relative to the parent asset. See [Position of Layer](imagekit.io/docs/transformations#position-of-layer).

Returns:



36
# File 'lib/imagekitio/models/base_overlay.rb', line 36

optional :position, -> { Imagekitio::OverlayPosition }

#timingImagekitio::Models::OverlayTiming?

Specifies timing information for the overlay (only applicable if the base asset is a video). See [Position of Layer](imagekit.io/docs/transformations#position-of-layer).

Returns:



44
# File 'lib/imagekitio/models/base_overlay.rb', line 44

optional :timing, -> { Imagekitio::OverlayTiming }