本文整理汇总了Java中com.drew.lang.Rational.getNumerator方法的典型用法代码示例。如果您正苦于以下问题:Java Rational.getNumerator方法的具体用法?Java Rational.getNumerator怎么用?Java Rational.getNumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.drew.lang.Rational
的用法示例。
在下文中一共展示了Rational.getNumerator方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFocusDistanceDescription
import com.drew.lang.Rational; //导入方法依赖的package包/类
@Nullable
public String getFocusDistanceDescription()
{
Rational value = _directory.getRational(TagFocusDistance);
if (value == null)
return "inf";
if (value.getNumerator() == 0xFFFFFFFFL || value.getNumerator() == 0x00000000L)
return "inf";
return value.getNumerator() / 1000.0 + " m";
}
示例2: Frame
import com.drew.lang.Rational; //导入方法依赖的package包/类
/**
* @param frameFile
*/
public Frame(final File frameFile) {
try {
path = frameFile.getCanonicalPath();
final Metadata metadata = ImageMetadataReader.readMetadata(frameFile);
final ExifSubIFDDirectory directory = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class);
if (directory != null) {
// Original TS
Date date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
if (date == null) {
date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME);
}
if (date != null) {
ts = date.getTime();
} else {
throw new RuntimeException("Unable to load timestamp from image.");
}
// exposure time
final Rational exTimeR = directory.getRational(ExifSubIFDDirectory.TAG_EXPOSURE_TIME);
exposure = (1.0 * exTimeR.getNumerator()) / exTimeR.getDenominator();
} else {
throw new RuntimeException("Unable to load timestamp from image.");
}
} catch (final ImageProcessingException | IOException ex) {
throw new RuntimeException(ex);
}
}
示例3: getDigitalZoomRatioDescription
import com.drew.lang.Rational; //导入方法依赖的package包/类
@Nullable
public String getDigitalZoomRatioDescription()
{
Rational value = _directory.getRational(TAG_DIGITAL_ZOOM_RATIO);
return value == null
? null
: value.getNumerator() == 0
? "Digital zoom not used"
: new DecimalFormat("0.#").format(value.doubleValue());
}
示例4: getDigitalZoomDescription
import com.drew.lang.Rational; //导入方法依赖的package包/类
@Nullable
public String getDigitalZoomDescription()
{
Rational value = _directory.getRational(TAG_DIGITAL_ZOOM);
return value == null
? null
: value.getNumerator() == 0
? "No digital zoom"
: value.toSimpleString(true) + "x digital zoom";
}
示例5: getFocusDescription
import com.drew.lang.Rational; //导入方法依赖的package包/类
@Nullable
public String getFocusDescription()
{
Rational value = _directory.getRational(TAG_FOCUS);
return value == null
? null
: value.getNumerator() == 1 && value.getDenominator() == 0
? "Infinite"
: value.toSimpleString(true);
}
示例6: getDigitalZoomRatioDescription
import com.drew.lang.Rational; //导入方法依赖的package包/类
@Nullable
public String getDigitalZoomRatioDescription()
{
Rational value = _directory.getRational(TAG_DIGITAL_ZOOM_RATIO);
return value == null
? null
: value.getNumerator() == 0
? "Digital zoom not used."
: SimpleDecimalFormatter.format(value.doubleValue());
}