Comments (4)
Take a look into this https://en.wikipedia.org/wiki/Binary_space_partitioning ,
http://game-ai.gatech.edu/sites/default/files/documents/assignments/bsp.html
from snap.swift.
Also having this issue, CoreGraphics seems to render non-deterministic when it comes to anti aliasing, at least I get pixel values off +/- 1 or 2 with the exact same code.
Currently I use a custom compare operation via CIImage that might be a starting point, although it doesn't seem to be particularly fast: https://gist.github.com/ralfebert/4c69b264cd374c91d28ba6b54ab1062f
from snap.swift.
mmm thanks for the code @ralfebert, I'll take a deeper look into this, seems that it's a little slow but I think we can speed it up a little, I'll try to hack something and come back with the results, thanks again!!
from snap.swift.
The quickest way seems to be just to compare the bytes manually:
let d1 = referenceImageContext.data!
let d2 = imageContext.data!
for i in 0..<referenceImageSizeBytes {
let b1 = d1.load(fromByteOffset: i, as: UInt8.self)
let b2 = d2.load(fromByteOffset: i, as: UInt8.self)
if b1 != b2 {
let diff = abs(Int(b1) - Int(b2))
if diff > tolerance {
throw CompareError.notEquals
}
}
}
Doesn't seem to be particularly slow...
from snap.swift.
Related Issues (20)
- Autolayout issues
- Integrate kaleidoscope HOT 2
- SpriteKit support HOT 5
- Wrong Carthage dependencies
- Weird framework naming [in docs] HOT 5
- Alpha channels on exported images
- Make size property of Device type public HOT 1
- Support camelCase for test method names
- Remove `test` method prefix from reference files HOT 3
- Write Failed Image if Reference image not found HOT 2
- API to expect UIImage HOT 2
- Device.iPadAir.size.width = 788?
- Landscape support HOT 1
- Image metadata differs depending if images are recorded under iOS 9 or iOS 10
- UITraitCollection support HOT 1
- Debugging failure on Travis CI HOT 3
- Default simulator? HOT 1
- cocoapods release? HOT 2
- Snapchat login
- This tool is no longer required as the unc0ver team have allowed sileo to work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snap.swift.