All Projects → CameraKit → Jpegkit Android

CameraKit / Jpegkit Android

Licence: mit
Efficient JPEG operations for Android without the risk of an OutOfMemoryException.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Jpegkit Android

Androidsecurity
Android安全实践
Stars: ✭ 150 (-2.6%)
Mutual labels:  ndk, jni, native
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (-43.51%)
Mutual labels:  ndk, jni, native
Xcrash
🔥 xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.
Stars: ✭ 148 (-3.9%)
Mutual labels:  jni, native
Fake Jni
An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.
Stars: ✭ 20 (-87.01%)
Mutual labels:  jni, native
Anyndk
🔥 Android native library, make your development faster and easier. Android各种native库,让你的开发更快更简单
Stars: ✭ 35 (-77.27%)
Mutual labels:  ndk, jni
Keepalive
Fighting against force-stop kill process on Android with binder ioctl / Android高级保活
Stars: ✭ 376 (+144.16%)
Mutual labels:  ndk, jni
Camerakit Android
Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
Stars: ✭ 5,131 (+3231.82%)
Mutual labels:  ndk, native
Dart native
Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.
Stars: ✭ 564 (+266.23%)
Mutual labels:  jni, native
Androiddevwithcpp
Android Develop With C++
Stars: ✭ 106 (-31.17%)
Mutual labels:  ndk, jni
Jpeg Autorotate
Node module to rotate JPEG images based on EXIF orientation.
Stars: ✭ 127 (-17.53%)
Mutual labels:  jpeg, jpg
Jni.hpp
A modern, type-safe, header-only, C++14 wrapper for JNI
Stars: ✭ 313 (+103.25%)
Mutual labels:  ndk, jni
Native Opencv Android Template
A tutorial for setting up OpenCV 4.5.0 (and other 4.x.y version) for Android in Android Studio with Native Development Kit (NDK) support.
Stars: ✭ 131 (-14.94%)
Mutual labels:  ndk, jni
Jpegsnoop
JPEGsnoop: JPEG decoder and detailed analysis
Stars: ✭ 282 (+83.12%)
Mutual labels:  jpeg, jpg
Stunning Signature
Native Signature Verification For Android (with example)
Stars: ✭ 139 (-9.74%)
Mutual labels:  ndk, native
Jnioor
基于C++模板函数与Fluent API设计的JNI反射库,极大的简化JNI反射调用,提高JNI开发效率与稳定性
Stars: ✭ 278 (+80.52%)
Mutual labels:  ndk, jni
Jni4android
JNI Generater for Android
Stars: ✭ 261 (+69.48%)
Mutual labels:  ndk, jni
TinyJPG
images jpg or jpeg compressed and watcher fsnotify
Stars: ✭ 73 (-52.6%)
Mutual labels:  jpg, jpeg
SecurityDemo
ndk进行简单的签名校验,密钥保护demo,android应用签名校验
Stars: ✭ 22 (-85.71%)
Mutual labels:  ndk, jni
Optimise Images
Batch image resizer, optimiser and profiler using ImageMagick convert, OptiPNG, JpegOptim and optional ZopfliPNG, Guetzli and MozJPEG.
Stars: ✭ 64 (-58.44%)
Mutual labels:  jpeg, jpg
Googleserialport
Android串口通信:抱歉,学会它真的可以为所欲为 ! ! !
Stars: ✭ 130 (-15.58%)
Mutual labels:  ndk, jni

JpegKitKit Header

JpegKit Header JpegKit Header

Build Status

JpegKit bridges the libjpeg-turbo C++ library into android and wraps it with an easy to use class. You can currently:

  • Retrieve metadata such as width and height
  • Rotate the JPEG 90, 180, or 270 degrees
  • Flip the JPEG horizontally
  • Flip the JPEG vertically
  • Crop the JPEG to any Rect

This is all done without decoding the JPEG to RGB. All operations on the JPEG are done in C++ space and does not touch the Java memory, allowing you to work with extremely large JPEGs without the risk of an OutOfMemoryException.

The State Of The Union

We've been working on a major update to the JpegKit project that we will dub v0.3.0. This release separates concerns away from the single Jpeg class to several classes, each handling different functions of JpegKit.

In a previous release we deprecated the Jpeg class with the intention of having the new functionality ready for the spotlight.

However we discovered some bugs and issues after the initial release. Until v0.3.0 is finalized, we've un-deprecated that Jpeg class and its other supporting classes. Below is the intended Setup and Usage for v0.2.2.

Setup

Add JpegKit to the dependencies block in your app level build.gradle:

compile 'com.camerakit:jpegkit:0.2.2'

Usage

The core of JpegKit is the Jpeg class. When creating an object of type Jpeg, the constructor expects a byte[]. In the future you'll be able to pass just a file.

Constructor

First, create a Jpeg:

import jpegkit.Jpeg;

//...

byte[] jpegBytes = ...;
Jpeg mJpeg = new Jpeg(jpegBytes);

One can then transform this Jpeg object with the transformations listed in the Transformations section below.

Jpeg result

After you perform your transformations, you can get a new JPEG byte[] back:

byte[] newJpegBytes = mJpeg.getJpeg();

The getJpeg() call can only be used once. At this point our C++ libjpeg-turbo wrapper encodes the new JPEG and also disposes of the original and clears any other memory it used.

Transformations are performed in C++ right when you make the method call, as opposed to doing all after you finish with getJpeg(). The transformations will be applied in the order you make the method calls.

JpegImageView

JpegImageView is a view to display JpegKit's Jpeg objects.

Create a JpegImageView in xml as follows.

<jpegkit.JpegImageView
    android:id="@+id/jpegView"
    android:layout_width="200dp"
    android:layout_height="200dp" />

Access and set the JPEG from your Activity as follows.

import jpegkit.JpegImageView;

//...

JpegImageView jpegView = findViewById(R.id.jpegView)
jpegView.setJpeg(mJpeg);

Transformations

Rotate

Acceptable parameters are 90, 180, or 270.

mJpeg.rotate(int rotation);

Flip Horizontal or Vertical

Flip horizontal:

mJpeg.flipHorizontal();

Flip horizontal:

mJpeg.flipVertical();

Crop

Crop extends an android.graphics.Rect.

Rect cropRect = new Rect(left, top, right, bottom);
mJpeg.crop(cropRect);

MetaData

You can retrieve a JPEGs width, height and size. This only decodes the JPEGs header information and is very fast.

int width = mJpeg.getWidth();
int height = mJpeg.getHeight();
long size = mJpeg.getJpegSize();

License

JpegKit is MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].