All Projects → silvaren → Easyrs

silvaren / Easyrs

Licence: mit
Convenience RenderScript tools for processing common Android formats such as Bitmap and NV21.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easyrs

bitsnpicas
Bits'N'Picas - Bitmap & Emoji Font Creation & Conversion Tools
Stars: ✭ 171 (+18.75%)
Mutual labels:  bitmap, conversion
Exchanger
🏢 Currency exchange rates framework for PHP
Stars: ✭ 133 (-7.64%)
Mutual labels:  conversion
Drawablecolorchange
Android Library to dynamically change color of drawable.
Stars: ✭ 101 (-29.86%)
Mutual labels:  bitmap
Lora Serialization
LoraWAN serialization/deserialization library for The Things Network
Stars: ✭ 120 (-16.67%)
Mutual labels:  bitmap
Ec2 Spot Converter
A tool to convert AWS EC2 instances back and forth between On-Demand and Spot billing models.
Stars: ✭ 108 (-25%)
Mutual labels:  conversion
Asm2c
Tool to convert DOS Assembly code to C code
Stars: ✭ 121 (-15.97%)
Mutual labels:  conversion
Timezone Support
Lightweight time zone support for your applications or other date libraries.
Stars: ✭ 90 (-37.5%)
Mutual labels:  conversion
Swiftrewriter
A Swift Package Manager console app and library to convert Objective-C code into Swift.
Stars: ✭ 140 (-2.78%)
Mutual labels:  conversion
Calibre Kobo Driver
An extension of the existing KoboTouch driver provided with Calibre. This plugin allows modifying ePub files to enable extra Kobo features. I am providing code in the repository to you under an open source license. Because this is my personal repository, the license you receive to my code is from me and not my employer.
Stars: ✭ 129 (-10.42%)
Mutual labels:  conversion
Dataclass factory
Modern way to convert python dataclasses or other objects to and from more common types like dicts or json-like structures
Stars: ✭ 116 (-19.44%)
Mutual labels:  conversion
Fastbitset.js
Speed-optimized BitSet implementation for modern browsers and JavaScript engines
Stars: ✭ 118 (-18.06%)
Mutual labels:  bitmap
Nb pdf template
A more accurate representation of jupyter notebooks when converting to pdfs.
Stars: ✭ 109 (-24.31%)
Mutual labels:  conversion
Bitmap
C++ Bitmap Library
Stars: ✭ 125 (-13.19%)
Mutual labels:  bitmap
Snakecase
🐍🐍🐍 A systematic approach to parse strings and automate the conversion to snake_case, UpperCamelCase or any other case.
Stars: ✭ 104 (-27.78%)
Mutual labels:  conversion
Hrconvert2
A self-hosted, drag-and-drop, & nosql file conversion server that supports 62x file formats.
Stars: ✭ 132 (-8.33%)
Mutual labels:  conversion
Circularimageview
This project allowing you to create circular and rounded corner Imageview in android through simplest way.
Stars: ✭ 90 (-37.5%)
Mutual labels:  bitmap
Graver
Graver 是一款高效的 UI 渲染框架,它以更低的资源消耗来构建十分流畅的 UI 界面。Graver 独创性的采用了基于绘制的视觉元素分解方式来构建界面,得益于此,该框架能让 UI 渲染过程变得更加简单、灵活。https://cocoapods.org/pods/Graver
Stars: ✭ 1,482 (+929.17%)
Mutual labels:  bitmap
Alltomp3
Node module to download and convert in MP3 with tags an online video
Stars: ✭ 120 (-16.67%)
Mutual labels:  conversion
Kluban
Lifecycle + Kotlin 协程 + flow + LiveData + Glide 识别和内存优化 + Luban采样算法 = KLuban图片压缩
Stars: ✭ 144 (+0%)
Mutual labels:  bitmap
Typestat
Converts JavaScript to TypeScript and TypeScript to better TypeScript.
Stars: ✭ 136 (-5.56%)
Mutual labels:  conversion

easyRS

easyRS is a set of convenience RenderScript tools for processing common Android formats such as Bitmap and NV21. Currently it supports most RenderScript Intrinsics operations plus Bitmap/NV21 format conversions.

First you need to create a RenderScript context (from the support library class android.support.v8.renderscript.RenderScript):

RenderScript rs = RenderScript.create(context); // where context can be your activity, application, etc.

NV21 to Bitmap

Bitmap outputBitmap = Nv21Image.nv21ToBitmap(rs, nv21ByteArray, width, height); // where nv21ByteArray contains
                                                                                // the NV21 image data

Bitmap to NV21

Converts an Android Bitmap image to a NV21 image. Please notice that because of the NV21 format the resulting image will be resized to the nearest even sized dimensions (eg. 501x499 -> 500x498).

Nv21Image nv21Image = Nv21Image.bitmapToNV21(rs, inputBitmap);

Blend

Blends two images, with operations such as add, clear, dst, dstAtop, dstIn, dstOut, dstOver, multiply, src, srcAtop, srcIn, srcOut, srcOver, subtract, xor (see reference).

Blend.add(rs, inputBitmap, inputBitmap2); // result is written to inputBitmap2

Blur

float radius = 25.f; // where radius can be any float from 0.0f to 25.0f
Bitmap outputBitmap = Blur.blur(rs, inputBitmap, radius);

ColorMatrix

Bitmap outputBitmap = ColorMatrix.applyMatrix(rs, inputBitmap, matrix3f); // where matrix3f is a 3x3 Matrix3f
                                                                          // from the RenderScript package

Convolve

Bitmap outputBitmap = Convolve.convolve3x3(rs, inputBitmap, coefficients); // where coefficients is a 3x3 float
                                                                           // array convolve kernel

Histogram

int[] histograms = Histogram.rgbaHistograms(rs, inputBitmap); // where histograms will contain the histograms
                                                              // of each RGBA channels

LUT

Bitmap outputBitmap = Lut.applyLut(rs, inputBitmap, rgbaLut); // where rgbaLut is the Lookup Table to be applied

LUT3D

Bitmap outputBitmap = Lut3D.apply3dLut(rs, inputBitmap, cube); // where cube is the 3D Lookup Table to be applied

Resize

Bitmap outputBitmap = Resize.resize(rs, inputBitmap, targetWidth, targetHeight);

When applying operations to NV21 images, beware that conversions to/from Bitmap format are part of the processing pipeline so they have an overhead to consider and that the image will be rounded down to the nearest even integer in each dimension.

Download

You can add it to your Android project by following the example below in your app's build.gradle:

android {
    ...
    defaultConfig {
        ...
        renderscriptTargetApi 16
        renderscriptSupportModeEnabled true
    }
    ...
}

dependencies {
    ...
    compile 'io.github.silvaren:easyrs:0.5.3'
}

Make sure jcenter repository is available in your top-level or app-level build.gradle:

allprojects {
    repositories {
        ...
        jcenter()
    }
}

License

The MIT License (MIT)
Copyright (c) 2016 Renato Oliveira da Silva

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), 
to deal in the Software without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the 
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included 
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
IN THE SOFTWARE.
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].