Skip to content

Commit

Permalink
Hide internal interfaces or classes
Browse files Browse the repository at this point in the history
  • Loading branch information
HokoFly committed Oct 18, 2023
1 parent 79c12eb commit 7d913d5
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion library/src/main/cpp/BlurUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jint clamp(jint i, jint minValue, jint maxValue) {


JNIEXPORT void JNICALL
Java_com_hoko_ktblur_ext_BitmapExtensionKt_replaceWithPixels(JNIEnv *env, jclass clazz, jobject jbitmap,
Java_com_hoko_ktblur_ext_BitmapExtensionKt_nativeReplaceWithPixels(JNIEnv *env, jclass clazz, jobject jbitmap,
jintArray j_inArray, jint j_x, jint j_y,
jint j_deltaW, jint j_deltaH) {

Expand Down
2 changes: 1 addition & 1 deletion library/src/main/cpp/include/BlurUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enum Direction{
jint clamp(jint i, jint minValue, jint maxValue);

JNIEXPORT void JNICALL
Java_com_hoko_ktblur_ext_BitmapExtensionKt_replaceWithPixels(JNIEnv *, jclass , jobject,
Java_com_hoko_ktblur_ext_BitmapExtensionKt_nativeReplaceWithPixels(JNIEnv *, jclass , jobject,
jintArray j_inArray, jint, jint, jint, jint);

#ifdef __cplusplus
Expand Down
1 change: 0 additions & 1 deletion library/src/main/java/com/hoko/ktblur/api/BlurBuild.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.hoko.ktblur.api
import android.content.Context
import android.graphics.Bitmap
import android.view.View
import com.hoko.ktblur.task.BlurCallback
import kotlinx.coroutines.Job

interface BlurBuild {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.hoko.ktblur.task
package com.hoko.ktblur.api

import android.graphics.Bitmap

Expand Down
1 change: 0 additions & 1 deletion library/src/main/java/com/hoko/ktblur/api/BlurProcessor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.hoko.ktblur.api

import android.graphics.Bitmap
import android.view.View
import com.hoko.ktblur.task.BlurCallback
import kotlinx.coroutines.Job

interface BlurProcessor {
Expand Down
6 changes: 5 additions & 1 deletion library/src/main/java/com/hoko/ktblur/ext/BitmapExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ internal fun Bitmap.translate(translateX: Int, translateY: Int): Bitmap {
return Bitmap.createBitmap(this, translateX, translateY, this.width - translateX, this.height - translateY)
}

external fun Bitmap.replaceWithPixels(pixels: IntArray, x: Int, y: Int, deltaX: Int, deltaY: Int)
internal fun Bitmap.replaceWithPixels(pixels: IntArray, x: Int, y: Int, deltaX: Int, deltaY: Int) {
this.nativeReplaceWithPixels(pixels, x, y, deltaX, deltaY)
}

private external fun Bitmap.nativeReplaceWithPixels(pixels: IntArray, x: Int, y: Int, deltaX: Int, deltaY: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.util.Log
import com.hoko.ktblur.api.Direction
import com.hoko.ktblur.api.Mode

object NativeBlurFilter {
internal object NativeBlurFilter {
private const val TAG = "OriginBlurFilter"
private var nativeLoaded = false
fun doBlur(mode: Mode, bitmap: Bitmap, radius: Int, cores: Int, index: Int, direction: Direction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.hoko.ktblur.ext.translate
import com.hoko.ktblur.api.Mode
import com.hoko.ktblur.api.Scheme
import com.hoko.ktblur.task.BitmapAsyncBlurTask
import com.hoko.ktblur.task.BlurCallback
import com.hoko.ktblur.api.BlurCallback
import com.hoko.ktblur.task.ViewAsyncBlurTask
import kotlinx.coroutines.Job

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import com.hoko.ktblur.api.BlurResultDispatcher
import com.hoko.ktblur.api.Mode
import com.hoko.ktblur.api.Scheme
import com.hoko.ktblur.task.AndroidBlurResultDispatcher
import com.hoko.ktblur.task.BlurCallback
import com.hoko.ktblur.api.BlurCallback
import kotlinx.coroutines.Job

class HokoBlurBuild(var context: Context) : BlurBuild {
internal class HokoBlurBuild(var context: Context) : BlurBuild {
internal var radius: Int = 10
internal var mode: Mode = Mode.STACK
internal var scheme: Scheme = Scheme.NATIVE
Expand Down
3 changes: 2 additions & 1 deletion library/src/main/java/com/hoko/ktblur/task/AsyncBlurTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package com.hoko.ktblur.task

import android.graphics.Bitmap
import android.view.View
import com.hoko.ktblur.api.BlurCallback
import com.hoko.ktblur.api.BlurProcessor
import com.hoko.ktblur.api.BlurResultDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch

abstract class AsyncBlurTask<in T>(
internal abstract class AsyncBlurTask<in T>(
private val block: BlurCallback.() -> Unit,
private val target: T,
private val dispatcher: BlurResultDispatcher
Expand Down

0 comments on commit 7d913d5

Please sign in to comment.