Git Product home page Git Product logo

jbig-android's Introduction

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.

jbig-android's People

Contributors

suzp1984 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.