java命名空间javax.imageio类imagereader的类成员方法:
getdestination定义及介绍
本文导语:
getdestination
protected static bufferedimage getdestination(imagereadparam param,
iterator imagetypes,
int width,
int height)
...
getdestination
protected static bufferedimage getdestination(imagereadparam param,
iterator imagetypes,
int width,
int height)
throws iioexception
- 返回应该在其中写入解码的像素数据的
bufferedimage。通过检查所提供的 imagereadparam(如果非 null)来确定图像;如果其 getdestination 方法返回一个非 null 值,则返回该图像。否则,调用 param.getdestinationtype 方法来确定是否指定了某一特定图像类型。如果已指定,则在检查其是否等于 imagetypes 中包含的类型之一后使用所返回的 imagetypespecifier。
如果 param 为 null 或者上述步骤没有生成一幅图像或 imagetypespecifier,则使用从 imagetypes 参数获得的第一个值。通常,调用者会将 imagetypes 设置为 getimagetypes(imageindex) 的值。
接下来,通过调用 computeregions 确定图像的维数。将被解码的图像的实际宽度和高度以 width 和 height 参数的形式传入。
- 参数:
param - 将用来获得目标图像或图像类型的 imagereadparam,或者为 null。imagetypes - 指示合法图像类型的 imagetypespecifier 的 iterator(默认类型最先使用)。width - 开始解码的图像或 tile 的实际宽度。height - 开始解码的图像或 tile 的实际高度。
- 返回:
- 应该在其中写入解码的像素数据的
bufferedimage。
- 抛出:
iioexception - 如果由 param 指定的 imagetypespecifier 与来自 imagetypes 的任何合法类型不匹配。
illegalargumentexception - 如果 imagetypes 为 null 或空,或者从中获取到的对象类型不是 imagetypespecifier。
illegalargumentexception - 如果得到的图像宽度或高度小于 1。
illegalargumentexception - 如果 width 和 height 的值大于 integer.max_value。