Sulabh Tiwari
Sulabh Tiwari

Reputation: 307

Saving HSV values into RGB image in Android

I have a HSV array which looks like,

double HSV[][][] = new double[100][100][3];

HSV[:][:][0] = H
HSV[:][:][1] = S
HSV[:][:][2] = V

I wish to convert my HSV array to a RGB bitmap image in Android. I know it can be done using Color.HSVToColor()

method, but i am really new to Android programming small explanation with example will be useful.

Upvotes: 0

Views: 822

Answers (1)

VVB
VVB

Reputation: 7641

Use this first:

http://developer.android.com/reference/android/graphics/Color.html#HSVToColor(float[])

public static int HSVToColor (float[] hsv)

Added in API level 1

Convert HSV components to an ARGB color. Alpha set to 0xFF. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Value [0...1] If hsv values are out of range, they are pinned.

Parameters

hsv 3 element array which holds the input HSV components.

Returns the resulting argh color

Then second is use below link,

How to create image from RGB values in android

Upvotes: 1

Related Questions