/** * Return String representation of an array of Rational, each evaluated * as a double, with space separator. */ protected static String rationalArray (Rational [] rarray) { StringBuffer buffer = new StringBuffer (); for (int i=0; i<rarray.length; i++) { if (i > 0) { buffer.append (" "); } buffer.append (rarray[i].toDouble ()); } return buffer.toString (); }
private String addRationalValue (Rational r, boolean rawOutput) { String s = null; if (!rawOutput) { s = _format.format (r.toDouble ()); } else { s = r.toString (); } return s; } }
protected Property addRationalArrayProperty(String name, Rational [] r, boolean rawOutput) { Property prop = null; if (!rawOutput) { String [] s = new String[r.length]; for (int i=0; i<r.length; i++) { s[i] = _format.format(r[i].toDouble()); } prop = new Property(name, PropertyType.STRING, PropertyArity.ARRAY, s); } if (prop == null) { prop = new Property(name, PropertyType.RATIONAL, PropertyArity.ARRAY, r); } return prop; }
/** * Returns a property for a tag with a RATIONAL value. * If rawOutput is true, returns a property with type * RATIONAL. Otherwise, returns a property with type * STRING, and the text representation of the Rational * value as a floating-point ratio. */ protected Property addRationalProperty(String name, Rational r, boolean rawOutput) { Property prop = null; if (!rawOutput) { prop = new Property(name, PropertyType.STRING, _format.format(r.toDouble())); } if (prop == null) { prop = new Property(name, PropertyType.RATIONAL, r); } return prop; }
checkCount (tag, count, 1); _brightnessValue = readRational (count, value); _niso.setBrightness(_brightnessValue.toDouble()); checkCount (tag, count, 1); _exposureBiasValue = readRational (count, value); _niso.setExposureBias(_exposureBiasValue.toDouble()); checkCount (tag, count, 1); _exposureIndex = readRational (count, value); _niso.setExposureIndex(_exposureIndex.toDouble()); checkCount (tag, count, 1); _exposureTime = readRational (count, value); _niso.setExposureTime(_exposureTime.toDouble()); checkCount (tag, count, 1); _fNumber = readRational (count, value); _niso.setFNumber(_fNumber.toDouble()); checkCount (tag, count, 1); _focalLength = readRational (count, value); _niso.setFocalLength(_focalLength.toDouble());
if (type == RATIONAL) { Rational r = readRational (count, value); _batteryLevel = Double.toString (r.toDouble ()); if (count == 1) { _niso.setBrightness (readSignedRational (count, value).toDouble ()); _niso.setBrightness (average (r[0], r[1]).toDouble ()); if (count == 1) { _niso.setExposureBias (readSignedRational (count, value).toDouble ()); _niso.setExposureBias (average (r[0], r[1]).toDouble ()); if (count == 1) { _niso.setExposureTime (readRational (count, value).toDouble ()); _niso.setExposureTime (average (r[0], r[1]).toDouble ()); if (count == 1) { _niso.setFlashEnergy (readRational (count, value).toDouble ()); _niso.setFlashEnergy (average (r[0], r[1]).toDouble ()); checkType (tag, type, RATIONAL);