Coder Social home page Coder Social logo

tommyteavee / android-ndk-gif Goto Github PK

View Code? Open in Web Editor NEW

This project forked from waynejo/android-ndk-gif

0.0 1.0 0.0 2.82 MB

GIF library built with ndk and gradle in aar format for usage with android gradle build system.

License: Other

Makefile 0.55% C++ 95.24% C 0.16% Java 4.05%

android-ndk-gif's Introduction

Android NDK GIF Library

GIF library built with ndk and gradle in aar format for usage with android gradle build system.

0.3.2 Change Log

  • fix some memory issues.

Encoding Option

  • Add some encoding options.
  • ENCODING_TYPE_SIMPLE_FAST
    • use low memory and encode fast. But low quality.
  • ENCODING_TYPE_NORMAL_LOW_MEMORY
    • use lower memory than ENCODING_TYPE_STABLE_HIGH_MEMORY. and image changing dynamic.
  • ENCODING_TYPE_STABLE_HIGH_MEMORY
    • slowest and use high memory. But high quality and stable image sequence.

Feature

  • GIF Encoding.
  • GIF Decoding.

How to use

Remote repository

...

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

dependencies {
    compile('com.waynejo:androidndkgif:0.3.2')
}

Decoding

GifDecoder gifDecoder = new GifDecoder();
boolean isSucceeded = gifDecoder.load(destFile);
if (isSucceeded) {
    for (int i = 0; i < gifDecoder.frameNum(); ++i) {
        Bitmap bitmap = gifDecoder.frame(i);
    }
}

Encoding

GifEncoder gifEncoder = new GifEncoder();
gifEncoder.init(width, height, filePath, GifEncoder.EncodingType.ENCODING_TYPE_NORMAL_LOW_MEMORY);

// Bitmap is MUST ARGB_8888.
gifEncoder.encodeFrame(bitmap1, delayMs);
gifEncoder.encodeFrame(bitmap2, delayMs);

gifEncoder.close();

Reference


Android Arsenal

android-ndk-gif's People

Contributors

jburkekf avatar petalomaniac avatar waynejo avatar

Watchers

 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.