Android NDK GIF Library


Source link: https://github.com/waynejo/android-ndk-gif

Android NDK GIF Library

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

0.3.3 Change Log

  • Added Gif Image Iterator for Image decoding.
  • Fixed a problem of residual image on transparent background.

Encoding Option

  • ENCODING_TYPE_SIMPLE_FAST
    • use low memory and encode fast. But low quality.
  • ENCODING_TYPE_FAST (Thanks to commitor "JBurkeKF")
    • encode fast. And better 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.

How to use

Remote repository

...  repositories {

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

  ... 
}
  dependencies {

  compile('com.waynejo:androidndkgif:0.3.3') 
}

Decoding using Iterator. (Less memory used)

GifDecoder gifDecoder = new GifDecoder();
 final GifImageIterator iterator = gifDecoder.loadUsingIterator(destFile);
 while (iterator.hasNext()) {

  GifImage next = iterator.next();

  if (null != next) {

imageView.setImageBitmap(next.bitmap);

  
}
 
}
 iterator.close();

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


Resources

Toastest is a library for customizing toasts.
RxJava and RxAndroid complete beginner examples
Android SQLite example with CRUD Operations. Simple Notes app is created in this project.
AndroidPhotoFilters aims to provide fast, powerful and flexible image processing instrument for creating awesome effects on any image media.
Android choosing image from camera or gallery with Crop functionality
???? A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes