1.02
com.rootsoft.imageprocessing.RSImageProcessing
RSImageProcessing
process
extractBitmap
Returns an immutable bitmap from the specified subset of the source bitmap.
The new bitmap may be the same object as source, or a copy may have been made.
It is initialized with the same density as the original bitmap.
source:
x:
y:
width:
height:
Return type: @return:
android.graphics.Bitmap
source
android.graphics.Bitmap
x
int
y
int
width
int
height
int
Initialize
Initializes the RSSImageProcessing Library.
EventName - Events subs prefix.
void
eraseColor
Fills the bitmap's pixels with the specified Color.
bitmap: the source bitmap. (must be mutable!)
c: colours
void
bitmap
android.graphics.Bitmap
c
int
createScaledBitmap
Creates a new bitmap, scaled from an existing bitmap.
src The source bitmap.
dstWidth The new bitmap's desired width.
dstHeight The new bitmap's desired height.
filter true if the source should be filtered.
Return type: @return:the bitmap
android.graphics.Bitmap
src
android.graphics.Bitmap
dstWidth
int
dstHeight
int
filter
boolean
rotate
android.graphics.Bitmap
src
android.graphics.Bitmap
degree
float
isMutable
Returns true if the bitmap is marked as mutable (i.e. can be drawn into)
bitmap:
Return type: @return:
boolean
bitmap
android.graphics.Bitmap
translateBitmap
Translate the bitmap.
bitmap:
degrees:
Return type: @return:
android.graphics.Bitmap
bitmap
android.graphics.Bitmap
dx
float
dy
float
getPixel
Returns the Color at the specified location.
Throws an exception if x or y are out of bounds (negative or >= to the width or height respectively).
bitmap:
x: The x coordinate (0...width-1) of the pixel to return
y: The y coordinate (0...height-1) of the pixel to return
Return type: @return:The argb Color at the specified coordinate
int
bitmap
android.graphics.Bitmap
x
int
y
int
extractBitmap2
Returns an immutable bitmap from the specified subset of the source bitmap.
The new bitmap may be the same object as source, or a copy may have been made.
It is initialized with the same density as the original bitmap.
source:
x:
y:
width:
height:
Return type: @return:
android.graphics.Bitmap
source
android.graphics.Bitmap
x
int
y
int
width
int
height
int
isRecycled
Returns true if this bitmap has been recycled. If so, then it is an error to try to access its pixels, and the bitmap will not draw.
bitmap:
Return type: @return:true if the bitmap has been recycled
boolean
bitmap
android.graphics.Bitmap
compress
Write a compressed version of the bitmap to the specified outputstream.
format The format of the compressed image
quality Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the quality setting
stream The outputstream to write the compressed data.
void
bitmap
android.graphics.Bitmap
format
java.lang.String
quality
int
stream
java.io.OutputStream
writeBitmapToFile
Writes a bitmap to a file
void
src
android.graphics.Bitmap
dir
java.lang.String
fileName
java.lang.String
quality
int
recycle
Free the native object associated with this bitmap, and clear the reference to the pixel data.
This will not free the pixel data synchronously; it simply allows it to be garbage collected if
there are no other references. The bitmap is marked as "dead", meaning it will throw an exception if
getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed,
so it should only be called if you are sure there are no further uses for the bitmap.
This is an advanced call, and normally need not be called, since the normal GC process will free
up this memory when there are no more references to this bitmap.
bitmap:
void
bitmap
android.graphics.Bitmap
rotateBitmap
Rotates the bitmap.
bitmap:
degrees:
Return type: @return:
android.graphics.Bitmap
bitmap
android.graphics.Bitmap
degrees
float
extractAlpha
Returns a new bitmap that captures the alpha values of the original.
bitmap:
android.graphics.Bitmap
bitmap
android.graphics.Bitmap
getDestination
Gets the new destination width or height keeping the aspect ratio of the image.
src: - bitmap
destination: -Source width or height
Return type: @return:
int
src
android.graphics.Bitmap
destination
double
setHorizontalScrollBarEnabled
void
hsv
android.widget.HorizontalScrollView
enabled
boolean
hasAlpha
Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values.
For some configs, this is always false (e.g. RGB_565), since they do not support per-pixel alpha.
However, for configs that do, the bitmap may be flagged to be known that all of its pixels are opaque.
In this case hasAlpha() will also return false. If a config such as ARGB_8888 is not so flagged, it will return true by default.
bitmap:
Return type: @return:
boolean
bitmap
android.graphics.Bitmap
skewBitmap
Skews the bitmap.
bitmap:
kx:
ky:
Return type: @return:
android.graphics.Bitmap
bitmap
android.graphics.Bitmap
kx
float
ky
float
scaleBitmap
Scales the bitmap.
bitmap:
degrees:
Return type: @return:
android.graphics.Bitmap
bitmap
android.graphics.Bitmap
sx
float
sy
float
PNG
java.lang.String
JPEG
java.lang.String
com.rootsoft.imageprocessing.RSImageFilters
RSImageFilters
process
FindEdge3
Find Edge
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
FindEdge2
Find Edge
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
SaturationFilter
Filters the saturation of a bitmap.
By converting RGB to HSV, we can adjust pixel color in different way.
Filter
android.graphics.Bitmap
source
android.graphics.Bitmap
level
int
Wedding
Wedding
src:
Factor: 16
Offset: 0
Return type: @return:Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
GaussianFilter2
Gaussian filter.
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
MeanRemoval
Mean Removal Effect makes uses of Convolution Matrix.
The applied matrix is:
[ -1 | -1 | -1 ]
[ -1 | 9 | -1 ]
[ -1 | -1 | -1 ]
Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
HueFilter
Filters the Hue of a bitmap.
By converting RGB to HSV, we can adjust pixel color in different way.
Filter
android.graphics.Bitmap
source
android.graphics.Bitmap
level
int
BlackFilter
Base on randomizing image pixels, another filter is created, named “Black Filter“, or enhance the noise of darkness.
The algorithm is to generate a threshold number (0-255), if all R,G,B values of a pixel are less than the threshold,
then set the pixel to black.
Filter
android.graphics.Bitmap
source
android.graphics.Bitmap
ColorFilter
Filter the color on the bitmap, in which to display image by only one channel or
combine the increase on every channel.
Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
red
double
green
double
blue
double
EdgeEnhancement3
Edge Enhancement
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
EdgeEnhancement2
Edge Enhancement
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
ShadingFilter
Shading Filter is a technique that use AND operator for the current pixel color and a desired-shading color.
Filter
android.graphics.Bitmap
source
android.graphics.Bitmap
shadingColor
int
GaussianFilter
Gaussian filter.
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
FindEdge
Find Edge
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
EdgeEnhancement
Edge Enhancement
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
com.rootsoft.imageprocessing.RSImageEffects
RSImageEffects
process
ColorBoost
Color boost technique is basically based on color filtering, which is to increase the
intensity of a single color channel.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
type
int
percent
float
GreyScale
Greyscales a bitmap
The intensity is calculated by common formula: 30% of Red + 59% of Green + 11 % of Blue
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
Paintify
Makes a paint like effect on a picture.
128 (or 64/32)
8
1
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
bitOffset
int
Factor
int
Offset
int
Sharpen2
Sharpening effect make uses of Convolution Matrix
The applied matrix is:
[ 0 | -2 | 0 ]
[ -2 | 11 | -2 ]
[ 0 | -2 | 0 ]
Filter
Weight : 3
android.graphics.Bitmap
src
android.graphics.Bitmap
weight
double
RoundCorner
Create a bitmap with round corners.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
round
float
Paintify2
Makes a paint like effect on a picture.
128 (or 64/32)
8
1
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
bitOffset
int
Factor
int
Offset
int
Rotate
Rotates a bitmaps
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
degree
float
Contrast
Contrast is the difference in luminance and/or colour that makes an object (or its representation in an image or display) distinguishable.
In visual perception of the real world, contrast is determined by the difference in the colour and
brightness of the object and other objects within the same field of view.
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
value
double
Highlight
Highlights a bitmap.
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
Invert
Inverts a bitmap.
Every image pixel holds information of four channels: Alpha, Red, Green, Blue.
However, Alpha doesn’t reflect the image color as display. So the value is kept, and take inversion for other three
channels by formula: 0xFF – CurrentValue.
android.graphics.Bitmap
src
android.graphics.Bitmap
Flip
Flips a bitmap vertically.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
Blur
Does a Gaussian Blur to the image. - Filter
It uses the concepts of Convolution Filtering to apply in image processing.
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
Brightness
The concept of brightness is rather simple, increasing/decreasing value of each R, G, B channel together.
+ By increasing: image results brighter.
+ By decreasing: image results darker.
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
value
int
Snow
Adds a snow-like effect to the bitmap.
Opposite of Black Filter
Sets all pixels having R,G,B values to the max (0xFF) when they’re greater than threshold,
then we have the Snow Effect.
Effect
android.graphics.Bitmap
source
android.graphics.Bitmap
Smooth
Smoothens a bitmap.
The factor is 13 and offset 1.
Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
value
double
Emboss
Embosses your bitmap to make it look sketchy like.
Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
Mirror
Flips a bitmap horizontally.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
ReplaceColor
Replaces pixels from one color to the other.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
fromColor
int
targetColor
int
Watermark
Gives your image a watermark, choose the location of the text, etc, etc
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
watermark
java.lang.String
x
float
y
float
color
int
alpha
int
size
int
underline
boolean
SepiaToning
Sepia-toning effect is used very commonly in photography.
It is the process of changing the intensity on every pixel color of a gray-scale image, or so-called black-and-white.
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
depth
int
red
double
green
double
blue
double
Sharpen
Sharpening effect make uses of Convolution Matrix
The applied matrix is:
[ 0 | -2 | 0 ]
[ -2 | 11 | -2 ]
[ 0 | -2 | 0 ]
Filter
Weight : 3
android.graphics.Bitmap
src
android.graphics.Bitmap
weight
double
Posterize
Decreasing color depth involves converting to standard values.
For example: if I want to offset 32, then each image color channel will apply the range: 0, 31, 63 …
Effects
android.graphics.Bitmap
src
android.graphics.Bitmap
bitOffset
int
TintColor
Gives a nice tint color to a bitmap.
degree: Use the constants for the degree.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
degree
int
Noise
Gives a noise or flea effect to the bitmap
Effect
android.graphics.Bitmap
source
android.graphics.Bitmap
Sketchify
Sketchify a photo.
src:
Factor: 16
Offset: 0
Return type: @return:Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
Factor
int
Offset
int
Reflection
Makes a mirror/reflection like
ReflectionGap: gap space between original and reflected
Effect
android.graphics.Bitmap
originalImage
android.graphics.Bitmap
ReflectionGap
int
GammaCorrection
Gamma correction or gamma encoding is one among the common image processing method
Gamma correction, gamma nonlinearity, gamma encoding, or often simply gamma,
is the name of a nonlinear operation used to code and decode luminance or tristimulus values in video or
still image systems.
Effect
android.graphics.Bitmap
src
android.graphics.Bitmap
red
double
green
double
blue
double
Engrave
Engraves your bitmap.
Filter
android.graphics.Bitmap
src
android.graphics.Bitmap
HALF_CIRCLE_DEGREE
double
RANGE
double
PI
double
FULL_CIRCLE_DEGREE
double
com.rootsoft.imageprocessing.RSImageBlend
RSImageBlend
process
LinearDodgeBlend
Blends 2 bitmaps to one and adds addition blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
LinearLightBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
VividLightBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
AddBlend
Blends 2 bitmaps to one and adds addition blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
LightenBlend
Blends 2 bitmaps to one and adds lighten blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
Blend
Blends 2 bitmaps together with help of a canvas. - Blending
Draws them both to a canvas and saves them as a bitmap.
android.graphics.Bitmap
bottomImage
android.graphics.Bitmap
topImage
android.graphics.Bitmap
left
float
top
float
SubstractBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
OverlayBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
PhoenixBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
LinearBurnBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
PinLightBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
ExclusionBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
DifferenceBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
SoftlightBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
ScreenBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
DarkenBlend
Blends 2 bitmaps to one and adds darken blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
NegationBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
MultiplyBlend
Blends 2 bitmaps to one and adds darken blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
ReflectBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
HardlightBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
HardMixBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
AverageBlend
Blends 2 bitmaps to one and adds average blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
ColorBurnBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
ColorDodgeBlend
Blends 2 bitmaps to one and adds the color dodge blend mode to it.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
GlowBlend
Blends 2 bitmaps to one and adds substraction blend.
android.graphics.Bitmap
source
android.graphics.Bitmap
layer
android.graphics.Bitmap
com.rootsoft.imageprocessing.ConvolutionMatrix
process
computeConvolution3x3
android.graphics.Bitmap
src
android.graphics.Bitmap
matrix
com.rootsoft.imageprocessing.ConvolutionMatrix
applyConfig
void
config
double[][]
All
value
double
Factor
double
Offset
double
Matrix
double[][]
SIZE
int
1.0
XverhelstX