Skip to content

Commit

Permalink
added javadoc that describes issue alexzhirkevich#15
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhirkevich committed Jan 22, 2023
1 parent f80a9b8 commit dfb0b3e
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
package com.github.alexzhirkevich.customqrgenerator.vector.style

import com.github.alexzhirkevich.customqrgenerator.SerializationProvider
import com.github.alexzhirkevich.customqrgenerator.style.QrLogoPadding.Accurate
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialName
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass

/**
* Type of padding applied to the logo.
* Padding applied even if logo drawable is not specified.
*
* Prefer empty padding if your qr code encodes large amount of data
* to avoid performance issues.
* */
sealed interface QrVectorLogoPadding {

val value : Float


/**
* Logo will be drawn on top of QR code without any padding.
* QR code pixels might be visible through transparent logo.
*
* Prefer empty padding if your qr code encodes large amount of data
* to avoid performance issues.
* */
@kotlinx.serialization.Serializable
@SerialName("Empty")
object Empty : QrVectorLogoPadding {
override val value: Float get() = 0f
}


/**
* Padding will be applied directly according to the shape of logo.
* Some QR code pixels can be cut.
*
* WARNING: this padding can cause performance issues for qr codes with
* large amount out data
* */
@kotlinx.serialization.Serializable
@SerialName("Accurate")
data class Accurate(override val value: Float) : QrVectorLogoPadding


/**
* Works like [Accurate] but all clipped pixels will be removed.
*
* This padding can also cause a little performance issues wen applied
* to large-data qr codes, but not as much as [Accurate].
* */
@kotlinx.serialization.Serializable
@SerialName("Natural")
data class Natural(override val value: Float) : QrVectorLogoPadding
Expand Down

0 comments on commit dfb0b3e

Please sign in to comment.