Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63a209fb0c | |||
| 2fa33d0e88 | |||
| 25d734d87d |
@@ -5,10 +5,8 @@
|
||||
[](https://twitter.com/aslanyanhaik)
|
||||
|
||||
|
||||
|
||||
RoundCode is a Facebook messenger like custom QR code with lots of customization.
|
||||
|
||||
In addition to encoder the RoundCode also includes convenient camera scanner and decoder.
|
||||
RoundCode is custom circular QR code with lots of customization.
|
||||
Similar to Facebook messenger and Apple's App Clip Codes the RoundCode includes convenient camera scanner and decoder.
|
||||
|
||||
<h3 align="center">
|
||||
<img src="appearance.png" alt="Different styles of RoundCode for iOS"/>
|
||||
@@ -81,14 +79,14 @@ You can also decode a UIImage like this
|
||||
|
||||
```swift
|
||||
let coder = RCCoder()
|
||||
do {
|
||||
messageLabel.text = try coder.decode(UIImage(named: code)!)
|
||||
} catch {
|
||||
//handle errors
|
||||
}
|
||||
do {
|
||||
messageLabel.text = try coder.decode(UIImage(named: code)!)
|
||||
} catch {
|
||||
//handle errors
|
||||
}
|
||||
```
|
||||
|
||||
### Appearance
|
||||
## Appearance
|
||||
|
||||
You can change the appearance like this
|
||||
|
||||
@@ -100,10 +98,14 @@ image.size = 300
|
||||
image.gradientType = .linear(angle: CGFloat.pi)
|
||||
image.tintColors = [.red, .black]
|
||||
```
|
||||
If image is on dark background you should change scanning mode to `darkBackground`
|
||||
|
||||
⚠️ When choosing colors or transparent background you should keep in mind that decoder will detect the code on light background with dark colors ⚠️
|
||||
```swift
|
||||
let coder = RCCoder()
|
||||
coder.scanningMode = .darkBackground
|
||||
```
|
||||
|
||||
### Advanced
|
||||
## Advanced coding configuration
|
||||
|
||||
You can provide custom coding configuration in order to encode long text by reducing number of characters
|
||||
|
||||
|
||||
@@ -74,9 +74,8 @@ extension RCImageDecoder {
|
||||
return points
|
||||
}
|
||||
|
||||
|
||||
private func scanPixelPattern(for mode: ScanMode, data: PixelContainer) -> [PixelPattern] {
|
||||
var lastPattern = PixelPattern.init(bit: pixelThreshold.contains((data[0, 0])) ? RCBit.one : RCBit.zero, x: 0, y: 0, count: 0)
|
||||
var lastPattern = PixelPattern(bit: pixelThreshold.contains((data[0, 0])) ? RCBit.one : RCBit.zero, x: 0, y: 0, count: 0)
|
||||
var pixelPatterns = [lastPattern]
|
||||
var count = 0
|
||||
let maxSize = size * size
|
||||
|
||||
Reference in New Issue
Block a user