Package net.sourceforge.jiu.util
Class ArrayScaling
java.lang.Object
net.sourceforge.jiu.util.ArrayScaling
This class currently only scales up an image given as a one-dimensional array
of values.
Note: This class should be adjusted if Java ever supports genericity. It could then work on all kinds of arrays.
- Author:
- Marco Schmidt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final void
scaleUp200Percent
(byte[] data, int width, int height) Scales up the argument image by factor 2 in both directions.
-
Constructor Details
-
ArrayScaling
private ArrayScaling()
-
-
Method Details
-
scaleUp200Percent
public static final void scaleUp200Percent(byte[] data, int width, int height) throws IllegalArgumentException Scales up the argument image by factor 2 in both directions. It is assumed that the firstwidth
timesheight
values ofdata
contain an image (or image channel). The pixels (or samples) are assumed to be laid out rows top-to-bottom, within each row left-to-right. It is further assumed that the length of thedata
array is at least 4 timeswidth
timesheight
. This method scales up the image indata
so that after the call to this methoddata
can be treated as an image (a channel) that has a horizontal resolution ofwidth * 2
and a vertical resolution ofheight * 2
.- Parameters:
data
- the array of pixels that form the image to be flippedwidth
- the horizontal resolution of the image; must be larger than 0height
- the vertical resolution of the image; must be larger than 0- Throws:
IllegalArgumentException
- if the arguments are invalid
-