Added another image decoder. It should be faster than Rapid and more reliable than Skia.

This commit is contained in:
len 2016-10-28 19:26:47 +02:00
parent 5b1f4f189b
commit 52e1e93f9d
6 changed files with 17 additions and 12 deletions

View File

@ -93,7 +93,7 @@ android {
dependencies {
// Modified dependencies
compile 'com.github.inorichi:subsampling-scale-image-view:a2a14ef'
compile 'com.github.inorichi:subsampling-scale-image-view:96d2c7f'
compile 'com.github.inorichi:ReactiveNetwork:69092ed'
// Android support library
@ -108,7 +108,7 @@ dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.8.0'
// ReactiveX
compile 'io.reactivex:rxandroid:1.2.1'

View File

@ -24,6 +24,11 @@ abstract class BaseReader : BaseFragment() {
* Skia decoder.
*/
const val SKIA_DECODER = 1
/**
* Image decoder.
*/
const val IMAGE_DECODER = 2
}
/**
@ -201,12 +206,16 @@ abstract class BaseReader : BaseFragment() {
fun setDecoderClass(value: Int) {
when (value) {
RAPID_DECODER -> {
regionDecoderClass = RapidImageRegionDecoder::class.java
bitmapDecoderClass = RapidImageDecoder::class.java
regionDecoderClass = RapidImageRegionDecoder::class.java
}
SKIA_DECODER -> {
regionDecoderClass = SkiaImageRegionDecoder::class.java
bitmapDecoderClass = SkiaImageDecoder::class.java
regionDecoderClass = SkiaImageRegionDecoder::class.java
}
IMAGE_DECODER -> {
bitmapDecoderClass = IImageDecoder::class.java
regionDecoderClass = IImageRegionDecoder::class.java
}
}
}

View File

@ -114,8 +114,6 @@
<string name="vertical_viewer">Vertical</string>
<string name="webtoon_viewer">Webtoon</string>
<string name="pref_image_decoder">Decodificador de imagen</string>
<string name="rapid_decoder">Rapid</string>
<string name="skia_decoder">Skia</string>
<string name="pref_image_scale_type">Tipo de escalado</string>
<string name="scale_type_fit_screen">Ajustar a la pantalla</string>
<string name="scale_type_stretch">Estirado</string>

View File

@ -119,8 +119,6 @@
<string name="vertical_viewer">Vertical</string>
<string name="webtoon_viewer">Webtoon</string>
<string name="pref_image_decoder">Descodificador de imagem</string>
<string name="rapid_decoder">Rapid</string>
<string name="skia_decoder">Skia</string>
<string name="pref_image_scale_type">Tipo de escala</string>
<string name="scale_type_fit_screen">Ajustar ao ecrã</string>
<string name="scale_type_stretch">Esticar</string>

View File

@ -67,13 +67,15 @@
</string-array>
<string-array name="image_decoders">
<item>@string/rapid_decoder</item>
<item>@string/skia_decoder</item>
<item>Rapid</item>
<item>Skia</item>
<item>Image</item>
</string-array>
<string-array name="image_decoders_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="image_scale_type">

View File

@ -123,8 +123,6 @@
<string name="vertical_viewer">Vertical</string>
<string name="webtoon_viewer">Webtoon</string>
<string name="pref_image_decoder">Image decoder</string>
<string name="rapid_decoder">Rapid</string>
<string name="skia_decoder">Skia</string>
<string name="pref_image_scale_type">Scale type</string>
<string name="scale_type_fit_screen">Fit screen</string>
<string name="scale_type_stretch">Stretch</string>