< prev index next >
src/java.desktop/share/classes/java/awt/image/AreaAveragingScaleFilter.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 61,71 ****
private static final ColorModel rgbmodel = ColorModel.getRGBdefault();
private static final int neededHints = (TOPDOWNLEFTRIGHT
| COMPLETESCANLINES);
private boolean passthrough;
! private float reds[], greens[], blues[], alphas[];
private int savedy;
private int savedyrem;
/**
* Constructs an AreaAveragingScaleFilter that scales the pixels from
--- 61,71 ----
private static final ColorModel rgbmodel = ColorModel.getRGBdefault();
private static final int neededHints = (TOPDOWNLEFTRIGHT
| COMPLETESCANLINES);
private boolean passthrough;
! private float[] reds, greens, blues, alphas;
private int savedy;
private int savedyrem;
/**
* Constructs an AreaAveragingScaleFilter that scales the pixels from
*** 206,216 ****
dx++;
dxrem = srcWidth;
}
}
if ((dyrem -= amty) == 0) {
! int outpix[] = calcRow();
do {
consumer.setPixels(0, dy, destWidth, 1,
rgbmodel, outpix, 0, destWidth);
dy++;
} while ((syrem -= amty) >= amty && amty == srcHeight);
--- 206,216 ----
dx++;
dxrem = srcWidth;
}
}
if ((dyrem -= amty) == 0) {
! int[] outpix = calcRow();
do {
consumer.setPixels(0, dy, destWidth, 1,
rgbmodel, outpix, 0, destWidth);
dy++;
} while ((syrem -= amty) >= amty && amty == srcHeight);
*** 242,252 ****
* this method directly since that operation could interfere
* with the filtering operation.
* @see ReplicateScaleFilter
*/
public void setPixels(int x, int y, int w, int h,
! ColorModel model, byte pixels[], int off,
int scansize) {
if (passthrough) {
super.setPixels(x, y, w, h, model, pixels, off, scansize);
} else {
accumPixels(x, y, w, h, model, pixels, off, scansize);
--- 242,252 ----
* this method directly since that operation could interfere
* with the filtering operation.
* @see ReplicateScaleFilter
*/
public void setPixels(int x, int y, int w, int h,
! ColorModel model, byte[] pixels, int off,
int scansize) {
if (passthrough) {
super.setPixels(x, y, w, h, model, pixels, off, scansize);
} else {
accumPixels(x, y, w, h, model, pixels, off, scansize);
*** 268,278 ****
* this method directly since that operation could interfere
* with the filtering operation.
* @see ReplicateScaleFilter
*/
public void setPixels(int x, int y, int w, int h,
! ColorModel model, int pixels[], int off,
int scansize) {
if (passthrough) {
super.setPixels(x, y, w, h, model, pixels, off, scansize);
} else {
accumPixels(x, y, w, h, model, pixels, off, scansize);
--- 268,278 ----
* this method directly since that operation could interfere
* with the filtering operation.
* @see ReplicateScaleFilter
*/
public void setPixels(int x, int y, int w, int h,
! ColorModel model, int[] pixels, int off,
int scansize) {
if (passthrough) {
super.setPixels(x, y, w, h, model, pixels, off, scansize);
} else {
accumPixels(x, y, w, h, model, pixels, off, scansize);
< prev index next >