mirror of
https://github.com/T8RIN/ImageToolbox.git
synced 2025-08-06 15:49:35 +08:00
Added Reduce Noise, Simple Solarize filters
This commit is contained in:
@ -282,6 +282,8 @@ interface Filter<Value> : VisibilityOwner {
|
||||
interface Pinch : Filter<PinchParams>
|
||||
interface Pointillize : Filter<VoronoiCrystallizeParams>
|
||||
interface PolarCoordinates : Filter<PolarCoordinatesType>
|
||||
interface ReduceNoise : SimpleFilter
|
||||
interface SimpleSolarize : SimpleFilter
|
||||
}
|
||||
|
||||
interface SimpleFilter : Filter<Unit>
|
||||
|
@ -125,7 +125,9 @@ sealed class UiFilter<T>(
|
||||
UiSobelSimpleFilter(),
|
||||
UiLaplacianSimpleFilter(),
|
||||
UiDespeckleFilter(),
|
||||
UiEqualizeFilter()
|
||||
UiEqualizeFilter(),
|
||||
UiReduceNoiseFilter(),
|
||||
UiSimpleSolarizeFilter(),
|
||||
),
|
||||
listOf(
|
||||
UiHueFilter(),
|
||||
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* You should have received a copy of the Apache License
|
||||
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
|
||||
*/
|
||||
|
||||
package com.t8rin.imagetoolbox.core.filters.presentation.model
|
||||
|
||||
import com.t8rin.imagetoolbox.core.filters.domain.model.Filter
|
||||
import com.t8rin.imagetoolbox.core.resources.R
|
||||
|
||||
class UiReduceNoiseFilter(
|
||||
override val value: Unit = Unit
|
||||
) : UiFilter<Unit>(
|
||||
title = R.string.reduce_noise,
|
||||
value = value
|
||||
), Filter.ReduceNoise
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* You should have received a copy of the Apache License
|
||||
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
|
||||
*/
|
||||
|
||||
package com.t8rin.imagetoolbox.core.filters.presentation.model
|
||||
|
||||
import com.t8rin.imagetoolbox.core.filters.domain.model.Filter
|
||||
import com.t8rin.imagetoolbox.core.resources.R
|
||||
|
||||
class UiSimpleSolarizeFilter(
|
||||
override val value: Unit = Unit
|
||||
) : UiFilter<Unit>(
|
||||
title = R.string.simple_solarize,
|
||||
value = value
|
||||
), Filter.SimpleSolarize
|
@ -1692,4 +1692,6 @@
|
||||
<string name="rect_to_polar">Rect to polar</string>
|
||||
<string name="polar_to_rect">Polar to rect</string>
|
||||
<string name="invert_in_circle">Invert in circle</string>
|
||||
<string name="reduce_noise">Reduce Noise</string>
|
||||
<string name="simple_solarize">Simple Solarize</string>
|
||||
</resources>
|
||||
|
@ -224,6 +224,7 @@ import com.t8rin.imagetoolbox.feature.filters.data.model.RadialTiltShiftFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.RainbowWorldFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.RandomDitheringFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.RedSwirlFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.ReduceNoiseFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.RemoveColorFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.ReplaceColorFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.RetroYellowFilter
|
||||
@ -238,6 +239,7 @@ import com.t8rin.imagetoolbox.feature.filters.data.model.SierraDitheringFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SierraLiteDitheringFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SimpleOldTvFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SimpleSketchFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SimpleSolarizeFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SimpleThresholdDitheringFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SketchFilter
|
||||
import com.t8rin.imagetoolbox.feature.filters.data.model.SmoothToonFilter
|
||||
@ -549,6 +551,8 @@ internal class AndroidFilterProvider @Inject constructor(
|
||||
is Filter.Pinch -> PinchFilter(value)
|
||||
is Filter.Pointillize -> PointillizeFilter(value)
|
||||
is Filter.PolarCoordinates -> PolarCoordinatesFilter(value)
|
||||
is Filter.ReduceNoise -> ReduceNoiseFilter(value)
|
||||
is Filter.SimpleSolarize -> SimpleSolarizeFilter(value)
|
||||
|
||||
else -> throw IllegalArgumentException("No filter implementation for interface ${filter::class.simpleName}")
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* You should have received a copy of the Apache License
|
||||
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
|
||||
*/
|
||||
|
||||
package com.t8rin.imagetoolbox.feature.filters.data.model
|
||||
|
||||
import com.jhlabs.JhFilter
|
||||
import com.jhlabs.ReduceNoiseFilter
|
||||
import com.t8rin.imagetoolbox.core.filters.domain.model.Filter
|
||||
|
||||
internal class ReduceNoiseFilter(
|
||||
override val value: Unit = Unit
|
||||
) : JhFilterTransformation(), Filter.ReduceNoise {
|
||||
|
||||
override val cacheKey: String
|
||||
get() = value.hashCode().toString()
|
||||
|
||||
override fun createFilter(): JhFilter = ReduceNoiseFilter()
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* ImageToolbox is an image editor for android
|
||||
* Copyright (c) 2025 T8RIN (Malik Mukhametzyanov)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* You should have received a copy of the Apache License
|
||||
* along with this program. If not, see <http://www.apache.org/licenses/LICENSE-2.0>.
|
||||
*/
|
||||
|
||||
package com.t8rin.imagetoolbox.feature.filters.data.model
|
||||
|
||||
import com.jhlabs.JhFilter
|
||||
import com.jhlabs.SolarizeFilter
|
||||
import com.t8rin.imagetoolbox.core.filters.domain.model.Filter
|
||||
|
||||
internal class SimpleSolarizeFilter(
|
||||
override val value: Unit = Unit
|
||||
) : JhFilterTransformation(), Filter.SimpleSolarize {
|
||||
|
||||
override val cacheKey: String
|
||||
get() = value.hashCode().toString()
|
||||
|
||||
override fun createFilter(): JhFilter = SolarizeFilter()
|
||||
|
||||
}
|
Reference in New Issue
Block a user