EFWatermarkMode

@objc
public enum EFWatermarkMode : Int

Options to specify how watermark position and size for QR code.

  • The option to scale the watermark to fit the size of QR code by changing the aspect ratio of the watermark if necessary.

    Declaration

    Swift

    case scaleToFill = 0
  • The option to scale the watermark to fit the size of the QR code by maintaining the aspect ratio. Any remaining area of the QR code uses the background color.

    Declaration

    Swift

    case scaleAspectFit = 1
  • The option to scale the watermark to fill the size of the QR code. Some portion of the watermark may be clipped to fill the QR code.

    Declaration

    Swift

    case scaleAspectFill = 2
  • The option to center the watermark in the QR code, keeping the proportions the same.

    Declaration

    Swift

    case center = 3
  • top

    The option to center the watermark aligned at the top in the QR code.

    Declaration

    Swift

    case top = 4
  • The option to center the watermark aligned at the bottom in the QR code.

    Declaration

    Swift

    case bottom = 5
  • The option to align the watermark on the left of the QR code.

    Declaration

    Swift

    case left = 6
  • The option to align the watermark on the right of the QR code.

    Declaration

    Swift

    case right = 7
  • The option to align the watermark in the top-left corner of the QR code.

    Declaration

    Swift

    case topLeft = 8
  • The option to align the watermark in the top-right corner of the QR code.

    Declaration

    Swift

    case topRight = 9
  • The option to align the watermark in the bottom-left corner of the QR code.

    Declaration

    Swift

    case bottomLeft = 10
  • The option to align the watermark in the bottom-right corner of the QR code.

    Declaration

    Swift

    case bottomRight = 11

Utilities

  • Calculates and returns the area in canvas where the image is going to be in this mode.

    Declaration

    Swift

    public func rectForWatermark(ofSize imageSize: CGSize,
                                 inCanvasOfSize canvasSize: CGSize) -> CGRect

    Parameters

    imageSize

    size of the watermark image to place in the canvas.

    canvasSize

    size of the canvas to place the image in.

    Return Value

    the area where the image is going to be according to the watermark mode.