Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63a209fb0c | |||
| 2fa33d0e88 | |||
| 25d734d87d | |||
| a95fc1265c | |||
| 118dcd6752 |
@@ -5,10 +5,8 @@
|
|||||||
[](https://twitter.com/aslanyanhaik)
|
[](https://twitter.com/aslanyanhaik)
|
||||||
|
|
||||||
|
|
||||||
|
RoundCode is custom circular QR code with lots of customization.
|
||||||
RoundCode is a Facebook messenger like custom QR code with lots of customization.
|
Similar to Facebook messenger and Apple's App Clip Codes the RoundCode includes convenient camera scanner and decoder.
|
||||||
|
|
||||||
In addition to encoder the RoundCode also includes convenient camera scanner and decoder.
|
|
||||||
|
|
||||||
<h3 align="center">
|
<h3 align="center">
|
||||||
<img src="appearance.png" alt="Different styles of RoundCode for iOS"/>
|
<img src="appearance.png" alt="Different styles of RoundCode for iOS"/>
|
||||||
@@ -81,14 +79,14 @@ You can also decode a UIImage like this
|
|||||||
|
|
||||||
```swift
|
```swift
|
||||||
let coder = RCCoder()
|
let coder = RCCoder()
|
||||||
do {
|
do {
|
||||||
messageLabel.text = try coder.decode(UIImage(named: code)!)
|
messageLabel.text = try coder.decode(UIImage(named: code)!)
|
||||||
} catch {
|
} catch {
|
||||||
//handle errors
|
//handle errors
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Appearance
|
## Appearance
|
||||||
|
|
||||||
You can change the appearance like this
|
You can change the appearance like this
|
||||||
|
|
||||||
@@ -100,10 +98,14 @@ image.size = 300
|
|||||||
image.gradientType = .linear(angle: CGFloat.pi)
|
image.gradientType = .linear(angle: CGFloat.pi)
|
||||||
image.tintColors = [.red, .black]
|
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
|
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
|
return points
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private func scanPixelPattern(for mode: ScanMode, data: PixelContainer) -> [PixelPattern] {
|
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 pixelPatterns = [lastPattern]
|
||||||
var count = 0
|
var count = 0
|
||||||
let maxSize = size * size
|
let maxSize = size * size
|
||||||
|
|||||||
Reference in New Issue
Block a user