Class ArrayScaling


  • public class ArrayScaling
    extends Object
    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 Detail

      • ArrayScaling

        private ArrayScaling()
    • Method Detail

      • 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 first width times height values of data 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 the data array is at least 4 times width times height. This method scales up the image in data so that after the call to this method data can be treated as an image (a channel) that has a horizontal resolution of width * 2 and a vertical resolution of height * 2.
        Parameters:
        data - the array of pixels that form the image to be flipped
        width - the horizontal resolution of the image; must be larger than 0
        height - the vertical resolution of the image; must be larger than 0
        Throws:
        IllegalArgumentException - if the arguments are invalid