Bilibili/BurstLinker

Name: BurstLinker

Owner: bilibili

Description: A simple C++ GIF encode library.

Created: 2018-02-03 14:45:07.0

Updated: 2018-05-21 03:05:04.0

Pushed: 2018-04-27 05:58:06.0

Homepage:

Size: 2314

Language: C++

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

BurstLinker

Download

Idea from: square/gifencoder

BurstLinker is a simple C++ GIF encode library.

Android platform
Download

Gradle:

ementation 'com.bilibili:burst-linker:latest-version'
Build Environment

Android Studio 3.0.1

NDK r16

Basic usage
delayMs = 1000;
ng filePath = getCacheDir() + File.separator + "out.gif";
tLinker burstLinker = new BurstLinker();

{
burstLinker.init(width, height, filePath);
Bitmap colorBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(colorBitmap);
Paint p = new Paint();
int[] colors = new int[]{0xFFF00000, 0xFFFFFF00, 0xFFFFFFFF};
for (int color : colors) {
    p.setColor(color);
    canvas.drawRect(0, 0, width, height, p);
    burstLinker.connect(colorBitmap, BurstLinker.OCTREE_QUANTIZER, 
            BurstLinker.NO_DITHER, 0, 0, delayMs);
}
tch (GifEncodeException e) {
e.printStackTrace();
nally {
burstLinker.release();

Enable RenderScript Support

This is an untested experimental feature

  1. Git branch /feature/render-script
  2. Gradle sync, It will generate the required ScriptC_*.cpp
  3. Uncomment the line 64 of the /lib/CMakeLists.txt
  4. Run
Unix-like platform
  1. Install CMake

  2. Mac brew install cmake

  3. ArchLinux sudo pacman -S cmake

  4. Build

  5. cd /BurstLinker

  6. mkdir cmake-build-debug; cd cmake-build-debug

  7. cmake ..

  8. make BurstLinker

  9. Run

  10. ./BurstLinker 1000 1.jpg 2.jpg 3.jpg

  11. See out.gif

Windows platform
  1. Install Microsoft Visual Studio & CMake

  2. Build

  3. cd /BurstLinker

  4. mkdir cmake-build-debug; cd cmake-build-debug

  5. cmake ..

  6. Open BurstLinker.sln

  7. Solution Explorer -> BurstLinker -> Build

  8. Run

  9. cd Debug

  10. BurstLinker.exe 1000 1.jpg 2.jpg 3.jpg

  11. See out.gif

Thanks

square/gifencoder

waynejo/android-ndk-gif

lucent1090/MCCQ

luxiaoxun/KMeans-GMM-HMM

SimonBoorer/Quantize

dali-neuquant

FFmpeg/FFmpeg

progschj/ThreadPool

License

right 2018 Bilibili

nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at

ttp://www.apache.org/licenses/LICENSE-2.0

ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.