EFStyleResampleImageParams
public class EFStyleResampleImageParams : EFStyleParams
Parameters for resample image QR code styling.
This class defines the styling parameters for QR codes that use a resampled image as the basis for module coloring. The QR code’s modules are colored by sampling from a source image, creating a visually blended effect between the QR code and the image.
## Features
- Image-based module coloring via resampling
- Customizable alignment, timing, and position patterns
- Data module color fallback
- Icon and backdrop support
- Visually blended, artistic QR codes
## Usage
let imageParams = EFStyleResampleImageParamsImage(
image: myImage,
mode: .scaleAspectFill
)
let params = EFStyleResampleImageParams(
icon: icon,
backdrop: backdrop,
image: imageParams,
align: align,
timing: timing,
position: position,
dataColor: .black
)
let style = EFQRCodeStyle.resampleImage(params)
-
The default backdrop configuration for resample image QR codes.
Declaration
Swift
public static let defaultBackdrop: EFStyleParamBackdrop
-
The default alignment pattern configuration.
Declaration
Swift
public static let defaultAlign: EFStyleResampleImageParamsAlign
-
The default timing pattern configuration.
Declaration
Swift
public static let defaultTiming: EFStyleResampleImageParamsTiming
-
The default position detection pattern configuration.
Declaration
Swift
public static let defaultPosition: EFStyleResampleImageParamsPosition
-
The default color for data modules (black).
Declaration
Swift
public static let defaultDataColor: CGColor
-
Creates resample image QR code styling parameters.
Declaration
Swift
public init( icon: EFStyleParamIcon? = nil, backdrop: EFStyleParamBackdrop = EFStyleResampleImageParams.defaultBackdrop, image: EFStyleResampleImageParamsImage?, align: EFStyleResampleImageParamsAlign = EFStyleResampleImageParams.defaultAlign, timing: EFStyleResampleImageParamsTiming = EFStyleResampleImageParams.defaultTiming, position: EFStyleResampleImageParamsPosition = EFStyleResampleImageParams.defaultPosition, dataColor: CGColor = EFStyleResampleImageParams.defaultDataColor )
Parameters
icon
The icon to display in the center of the QR code. Defaults to nil.
backdrop
The backdrop configuration. Defaults to default backdrop.
image
The image configuration for resampling. Defaults to nil.
align
The alignment pattern configuration. Defaults to default align.
timing
The timing pattern configuration. Defaults to default timing.
position
The position detection pattern configuration. Defaults to default position.
dataColor
The fallback color for data modules. Defaults to black.