This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.alexjlockwood.circularprogressindicator | |
| import android.os.Bundle | |
| import android.view.animation.PathInterpolator | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.compose.animation.core.* | |
| import androidx.compose.animation.transition | |
| import androidx.compose.foundation.Image | |
| import androidx.compose.foundation.layout.fillMaxHeight | |
| import androidx.compose.foundation.layout.fillMaxWidth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class Completion<R> { | |
| private let closure: (R) -> Void | |
| private var cancelled = false | |
| /// `closure` is called upon completion, if not cancelled. | |
| init(closure: (R) -> Void) { | |
| self.closure = closure | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Accelerate.vImage | |
| func getImageBuffer(from pixelBuffer: CVPixelBuffer) -> vImage_Buffer? { | |
| var buffer = vImage_Buffer() | |
| let bitmapInfo = CGBitmapInfo(rawValue: CGBitmapInfo.byteOrder32Little.rawValue | CGImageAlphaInfo.first.rawValue) | |
| var cgFormat = vImage_CGImageFormat(bitsPerComponent: 8, | |
| bitsPerPixel: 32, | |
| colorSpace: nil, | |
| bitmapInfo: bitmapInfo, | |
| version: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in a terminal | |
| # python -m pip install --user opencv-contrib-python numpy scipy matplotlib ipython jupyter pandas sympy nose | |
| import cv2 | |
| import pandas as pd | |
| import numpy as np | |
| import imutils | |
| from scipy.spatial import distance as dist | |
| from imutils import perspective |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Created by はるふ on 2017/12/11. | |
| // Copyright © 2017年 ha1f. All rights reserved. | |
| // | |
| import Foundation | |
| import CoreImage | |
| import AVFoundation | |
| extension CIFilter { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import PlaygroundSupport | |
| let view = UIView(frame: CGRect(x: 0, y: 0, width: 375, height: 647)) | |
| view.backgroundColor = UIColor.white | |
| let shadowView = UIView(frame: CGRect(x:50, y: 50, width:250, height:250)) | |
| view.addSubview(shadowView) | |
| let someView = UIView(frame: CGRect(x:50, y: 50, width:250, height:250)) | |
| someView.backgroundColor = UIColor.white |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.android.gms.common.GoogleApiAvailability | |
| import com.google.android.gms.tasks.Task | |
| import splitties.init.appCtx | |
| import kotlin.coroutines.experimental.suspendCoroutine | |
| val googleApiAvailability = GoogleApiAvailability.getInstance()!! | |
| inline val playServicesAvailability get() = googleApiAvailability.isGooglePlayServicesAvailable(appCtx) | |
| @JvmName("awaitVoid") | |
| suspend fun Task<Void>.await() = suspendCoroutine<Unit> { continuation -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.android.gms.common.GoogleApiAvailability | |
| import com.google.android.gms.tasks.Task | |
| import splitties.init.appCtx | |
| import kotlin.coroutines.experimental.suspendCoroutine | |
| val googleApiAvailability = GoogleApiAvailability.getInstance()!! | |
| inline val playServicesAvailability get() = googleApiAvailability.isGooglePlayServicesAvailable(appCtx) | |
| @JvmName("awaitVoid") | |
| suspend fun Task<Void>.await() = suspendCoroutine<Unit> { continuation -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RgbConversion(val rs: RenderScript, private val feedSize: Size, private val hasRotate: Boolean = true) { | |
| private var mInputAllocation: Allocation? = null | |
| private var mOutputAllocation: Allocation? = null | |
| private var mRotatedAllocation: Allocation? = null | |
| private val yuvToRgb = ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs)) | |
| private val rotator = ScriptC_rotator(rs) | |
| var bufferCallback: ((ByteBuffer) -> Unit)? = null | |
| val inputSurface: Surface | |
| get() = mInputAllocation!!.surface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ViewController.swift | |
| // CameraFilter | |
| // | |
| import UIKit | |
| import AVFoundation | |
| class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate { | |