Example usage for android.hardware.camera2.params TonemapCurve getPoint

List of usage examples for android.hardware.camera2.params TonemapCurve getPoint

Introduction

In this page you can find the example usage for android.hardware.camera2.params TonemapCurve getPoint.

Prototype

public PointF getPoint(int colorChannel, int index) 

Source Link

Document

Get the point for a color channel at a specified index.

Usage

From source file:com.android.camera2.its.ItsSerializer.java

@SuppressWarnings("unchecked")
private static Object serializeTonemapCurve(TonemapCurve curve) throws org.json.JSONException {
    JSONObject curveObj = new JSONObject();
    String names[] = { "red", "green", "blue" };
    for (int ch = 0; ch < 3; ch++) {
        JSONArray curveArr = new JSONArray();
        int len = curve.getPointCount(ch);
        for (int i = 0; i < len; i++) {
            curveArr.put(curve.getPoint(ch, i).x);
            curveArr.put(curve.getPoint(ch, i).y);
        }/*from   w  w  w. ja  v  a 2  s . co m*/
        curveObj.put(names[ch], curveArr);
    }
    return curveObj;
}