package tinj.jcdv.wpky

import aicg.wipf.vzuj.Kmqp.string
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.BitmapShader
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.RectF
import android.graphics.Shader
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation
import com.test.basd.smartjunkcleaner.R
import java.security.MessageDigest

class Gcsj(private val radiusInDp: Float) : BitmapTransformation() {

    private val radius: Float = Resources.getSystem().displayMetrics.density * radiusInDp

    private fun ބބޓބޥޚޡބ(): String {
        class ޢޠޠޒގވލވ<T>(ކވޑޜޣމށދ: T) {
            init {
                println("ޙއށޅވޤޕޠ: $ކވޑޜޣމށދ")
            }
        }
        println(ޢޠޠޒގވލވ("ޡމމޑޓޗޅއ"))
        return ޥޝޝޅޞވޖޓ()
    }

    private fun ތޡޑމރޖޙޠ(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap {
        return ޣސޥށޚޡސލ(pool, toTransform, outWidth, outHeight)
    }

    private fun ޕލޡޚގޠމޣ(): String {
        return ޗޖފއޗޠޘޔ()
    }

    private fun ޓޞޠރތޡޟޕ(): String {
        return ޕލޡޚގޠމޣ()
    }

    private fun ހދތޠޛޡޛޑ(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap {
        return ތޡޑމރޖޙޠ(pool, toTransform, outWidth, outHeight)
    }

    fun getId(): String {
        return ބބޓބޥޚޡބ()
    }

    private fun ޗޖފއޗޠޘޔ(): String {
        return R.string.ޏޤތޞޣ_D.string((radius).toString())
    }

    private fun ޥޝޝޅޞވޖޓ(): String {
        return ޓޞޠރތޡޟޕ()
    }

    private fun ޣސޥށޚޡސލ(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap {
        fun ޜޢބޔޢޛޏޢ(ޢނހޓޣޅޟޔ: String) {
            println("tag, $ޢނހޓޣޅޟޔ!")
        }
        ޜޢބޔޢޛޏޢ("ލޅޒތގވވޞ")
        val bitmap = pool.get(outWidth, outHeight, Bitmap.Config.ARGB_8888)
        fun ޘކލހޙޡޚޓ(ޝޘޒޙޥޒޥނ: String) {
            println("tag, $ޝޘޒޙޥޒޥނ!")
        }
        ޘކލހޙޡޚޓ("ގށޑބޞޘޔތ")
        val canvas = Canvas(bitmap)
        class ޥޙޛޔޤސމތ(val ޗޘޕޢޕމޔޖ: String, val ޓކވނނބރޓ: Int)
        println(ޥޙޛޔޤސމތ("ޘޠދޠތތސޘ", 657))
        val paint = Paint(Paint.ANTI_ALIAS_FLAG)
        val shader = BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP)
        paint.shader = shader
        val rect = RectF(0f, 0f, outWidth.toFloat(), outHeight.toFloat())
        canvas.drawRoundRect(rect, radius, radius, paint)
        return bitmap
    }

    override fun updateDiskCacheKey(messageDigest: MessageDigest) {

    }

    override fun transform(pool: BitmapPool, toTransform: Bitmap, outWidth: Int, outHeight: Int): Bitmap {
        class ލސރޖޒޅޏޓ(val ދޡޙޡޖމޑޒ: String, val ރދޝޜޣޟޞޖ: Int)
        println(ލސރޖޒޅޏޓ("ހރދމބޤޏސ", 8481))
        return ހދތޠޛޡޛޑ(pool, toTransform, outWidth, outHeight)
    }
}
