2828
2929package com.github.awxkee.avifcoil.decoder
3030
31- import android.content.Context
3231import android.graphics.Bitmap
3332import android.graphics.drawable.BitmapDrawable
3433import android.os.Build
@@ -46,14 +45,13 @@ import kotlinx.coroutines.runInterruptible
4645import okio.ByteString.Companion.encodeUtf8
4746
4847class HeifDecoder (
49- private val context : Context ? ,
5048 private val source : SourceResult ,
5149 private val options : Options ,
5250 private val imageLoader : ImageLoader ,
5351 private val exceptionLogger : ((Exception ) -> Unit )? = null ,
5452) : Decoder {
5553
56- private val coder = HeifCoder (context )
54+ private val coder = HeifCoder ()
5755
5856 override suspend fun decode (): DecodeResult ? = runInterruptible {
5957 try {
@@ -115,18 +113,15 @@ class HeifDecoder(
115113 }
116114 }
117115
118- /* *
119- * @param context is preferred to be set when displaying an HDR content to apply Vulkan shaders
120- */
121- class Factory (private val context : Context ? = null ) : Decoder.Factory {
116+ class Factory : Decoder .Factory {
122117 override fun create (
123118 result : SourceResult ,
124119 options : Options ,
125120 imageLoader : ImageLoader
126121 ): Decoder ? {
127122 return if (AVAILABLE_BRANDS .any {
128123 result.source.source().rangeEquals(4 , it)
129- }) HeifDecoder (context, result, options, imageLoader) else null
124+ }) HeifDecoder (result, options, imageLoader) else null
130125 }
131126
132127 companion object {
0 commit comments