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

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

Introduction

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

Prototype

public int getPointCount(int colorChannel) 

Source Link

Document

Get the number of points stored in this tonemap curve for the specified color channel.

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  ww.  j  a v a 2s. c  o m
        curveObj.put(names[ch], curveArr);
    }
    return curveObj;
}