This file contains 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 'dart:async'; | |
Future<String> networkCallGetString() async { | |
await Future.delayed(Duration(seconds: 5)); | |
return "Simulated Network Call"; | |
} | |
doNetworkCall() async { | |
var result = networkCallGetString(); | |
print(result); |
This file contains 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
extension NumberParsing on String { | |
int parseInt() { | |
return int.parse(this); | |
} | |
double parseDouble() { | |
return double.parse(this); | |
} | |
} |
This file contains 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.netvirta.ci_image_resize_plugin | |
import javax.imageio.ImageIO | |
import java.awt.image.BufferedImage; | |
import java.io.File | |
import javax.imageio.stream.ImageInputStream | |
class CiImageResize { | |
fun resize(inputJpgFilePath: String, outputJpgFilePath: String, outputWidth: Int, outputHeight: Int) { |
This file contains 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.liewjuntung.symbolicPlugin | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.TaskAction | |
import java.io.File | |
abstract class SymbolicLink: DefaultTask() { | |
var actualFilePath: String? = null |
This file contains 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
plugins { | |
kotlin("jvm") version "1.3.41" | |
`java-gradle-plugin` | |
id("com.gradle.plugin-publish") version "0.10.0" | |
} | |
pluginBundle { | |
website = "<substitute your project website>" |
This file contains 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
abstract class SymbolicLinkTask : DefaultTask() { | |
var actualFilePath: String? = null | |
var symbolicDirPath: String? = null | |
var rename: String? = null | |
@TaskAction | |
fun link() { | |
val aPath = actualFilePath ?: throw Exception("actualPath not set") | |
val sPath = symbolicDirPath ?: throw Exception("symbolicPath not set") |
This file contains 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
fun rotateBitmap(context: Context, bitmap: Bitmap): Bitmap{ | |
val rs = RenderScript.create(context) | |
val allocation = Allocation.createFromBitmap(rs, bitmap) | |
val rotated = Allocation.createTyped(rs, Type.createXY(rs, Element.RGBA_8888(rs), bitmap.height, bitmap.width)) | |
ScriptC_rotator(rs).apply { | |
_inImage = allocation | |
_inHeight = bitmap.height | |
_inWidth = bitmap.width | |
forEach_rotate_270_clockwise(rotated, rotated) |
This file contains 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.liewjuntung.cameraxfacetracking | |
import android.content.pm.PackageManager | |
import android.graphics.Bitmap | |
import android.os.Bundle | |
import android.os.Handler | |
import android.os.HandlerThread | |
import android.renderscript.RenderScript | |
import android.util.Rational | |
import android.util.Size |
This file contains 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 RsYuvToRgb(private val rs: RenderScript) { | |
private var mOutputAllocation: Allocation? = null | |
private var mInputAllocation: Allocation? = null | |
private val rsYuvToRgb = ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs)) | |
private var yArray: ByteArray? = null | |
private var uArray: ByteArray? = null | |
private var vArray: ByteArray? = null |
This file contains 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 RsYuvToRgb(val rs: RenderScript) { | |
private var rotateAllocation: Allocation? = null | |
private var mOutputAllocation: Allocation? = null | |
private var mInputAllocation: Allocation? = null | |
private val rsYuvToRgb = ScriptIntrinsicYuvToRGB.create(rs, Element.U8_4(rs)) | |
private var yArray: ByteArray? = null | |
private var uArray: ByteArray? = null |