Example usage for android.util Rational getNumerator

List of usage examples for android.util Rational getNumerator

Introduction

In this page you can find the example usage for android.util Rational getNumerator.

Prototype

public int getNumerator() 

Source Link

Document

Gets the numerator of the rational.

Usage

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

@SuppressWarnings("unchecked")
private static Object serializeRational(Rational rat) throws org.json.JSONException {
    JSONObject ratObj = new JSONObject();
    ratObj.put("numerator", rat.getNumerator());
    ratObj.put("denominator", rat.getDenominator());
    return ratObj;
}

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

private static float r2f(Rational r) {
    return (float) r.getNumerator() / (float) r.getDenominator();
}