Omar Miatello

Results 3 comments of Omar Miatello

I wrote this utility: ``` fun Context.toPixelFromDip(value: Float) = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, resources.displayMetrics) ``` ``` fun View.toPixelFromDip(value: Float) = context.toPixelFromDip(value) ``` Pro: - `toPixelFromDip()` is very clear the origin and the...

I don't think so. Your application resources may have a different density. Maybe not now, but you don't know in future. Also seems correct take it from application context.

I found a faster solution for invert colors (8ms vs 200ms) https://gist.github.com/jacklt/4627f9e773aaebea12f2bce357446dc8 In Kotlin: Invert ByteArray color ```kotlin frame.grayscaleImageData.array().let { b -> val max = 0xFFFFFFFF ByteArray(b.size) { (max -...