GitXplorerGitXplorer
s

jbig-android

public
13 stars
11 forks
2 issues

Commits

List of commits on branch master.
Unverified
0ae0fb061fb0e27099448801b3fe92ca74fb4183

upgrade realm io -> 6.0.2

ssuzp1984 committed 5 years ago
Unverified
8374396c115c8ad1b85e17a4771f4a3fbd8c2dd7

upgrade androidx

ssuzp1984 committed 5 years ago
Unverified
b7c59f40a6027eb010fb43df97ebf4f7c531aa8d

upgrade to jetpack

ssuzp1984 committed 6 years ago
Unverified
867000cb87217174fdff06bcf7723f5c75208294

ignore reports dir

ssuzp1984 committed 7 years ago
Unverified
863e57fe795f5505901b50487927ce65f52420d0

upgrade sdk compiler version

ssuzp1984 committed 7 years ago
Unverified
10359e9d4c6a4b4d28218dc5b214a99b6140d67d

update android build version

ssuzp1984 committed 7 years ago

README

The README file for this repository.

jbig-android

This is a JBIG codec toolkit in Android platform.

implementation detail

jbig-android is a android level wrapper above the JBIG-KIT. So it include JBIG-KIT's source code inside of it in Android's JNI level.

API document

 # encode code
    Bitmap[] bitmaps = ...;

    JbigCodec jbigCodec = JbigCodecFactory.getJbigCodec(JbigCodecFactory.CODEC.JNI_CODEC);
    byte[] jbigData = jbigCodec.encode(bitmaps);

Above code is what I said jbig encoding from multiple layers of Bitmaps.

    # jbigData is the above byte[] jbigData.

    JbigCodec jbigCodec = JbigCodecFactory.getJbigCodec(JbigCodecFactory.CODEC.JNI_CODEC);
    Bitmap[] bms = jbigCodec.decode(jbigData);

And this is the decoder part, the reverting process of above encoding part, here it decode the jbigData byte array into multiple layers of Bitmaps.

Sample app ScreenShot

sample app

Include into your project

for Android Studio or Gradle user

allprojects {
    repositories {
        jcenter()

        maven {
            url  "http://dl.bintray.com/suzp1984/maven"
        }
    }
}

Add my bintray repo into your root build.gradle.

dependencies {
  compile(group: 'org.jacob.lib.jbig', name: 'jbig-android', version: '1.0', ext: 'aar')
}

Then, add above line into your modules's dependencies scope.

for maven user

<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<profiles>
    <profile>
        <repositories>
            <repository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>bintray-suzp1984-maven</id>
                <name>bintray</name>
                <url>http://dl.bintray.com/suzp1984/maven</url>
            </repository>
        </repositories>

        <pluginRepositories>
            <pluginRepository>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <id>bintray-suzp1984-maven</id>
                <name>bintray-plugins</name>
                <url>http://dl.bintray.com/suzp1984/maven</url>
            </pluginRepository>
        </pluginRepositories>

        <id>bintray</id>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>bintray</activeProfile>
</activeProfiles>

</settings>

Frist, setup the maven's xml file to use this repository.

<dependency>
    <groupId>org.jacob.lib.jbig</groupId>
    <artifactId>jbig-android</artifactId>
    <version>1.0</version>
    <type>aar</type>
</dependency>

Then, setup the dependency.

Opensource code included

JBIG-KIT: GPL licence

Licence

                     GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.