mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 03:55:28 -04:00
Accept and handle null param in copyIntoRasterWithParams().
Co-authored-by: Harald Kuhr <harald.kuhr@gmail.com>
This commit is contained in:
parent
a377712bdb
commit
993e07ee34
@ -148,16 +148,12 @@ public final class VP8LDecoder {
|
|||||||
*/
|
*/
|
||||||
public static void copyIntoRasterWithParams(final Raster srcRaster, final WritableRaster dstRaster,
|
public static void copyIntoRasterWithParams(final Raster srcRaster, final WritableRaster dstRaster,
|
||||||
final ImageReadParam param) {
|
final ImageReadParam param) {
|
||||||
Rectangle sourceRegion = param.getSourceRegion();
|
Rectangle sourceRegion = param != null && param.getSourceRegion() != null ? param.getSourceRegion() : dstRaster.getBounds();
|
||||||
int sourceXSubsampling = param.getSourceXSubsampling();
|
int sourceXSubsampling = param != null ? param.getSourceXSubsampling() : 1;
|
||||||
int sourceYSubsampling = param.getSourceYSubsampling();
|
int sourceYSubsampling = param != null ? param.getSourceYSubsampling() : 1;
|
||||||
int subsamplingXOffset = param.getSubsamplingXOffset();
|
int subsamplingXOffset = param != null ? param.getSubsamplingXOffset() : 0;
|
||||||
int subsamplingYOffset = param.getSubsamplingYOffset();
|
int subsamplingYOffset = param != null ? param.getSubsamplingYOffset() : 0;
|
||||||
Point destinationOffset = param.getDestinationOffset();
|
Point destinationOffset = param != null ? param.getDestinationOffset() : new Point(0, 0) ;
|
||||||
|
|
||||||
if (sourceRegion == null) {
|
|
||||||
sourceRegion = dstRaster.getBounds();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sourceXSubsampling == 1 && sourceYSubsampling == 1) {
|
if (sourceXSubsampling == 1 && sourceYSubsampling == 1) {
|
||||||
// Only apply offset (and limit to requested region)
|
// Only apply offset (and limit to requested region)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user