samer@0: /* samer@0: * Copyright (c) 2000, Samer Abdallah, King's College London. samer@0: * All rights reserved. samer@0: * samer@0: * This software is provided AS iS and WITHOUT ANY WARRANTY; samer@0: * without even the implied warranty of MERCHANTABILITY or samer@0: * FITNESS FOR A PARTICULAR PURPOSE. samer@0: */ samer@0: samer@0: package samer.tools; samer@0: import java.awt.image.*; samer@0: samer@0: public class ArrayVImageSource extends ImageSourceBase samer@0: { samer@0: double array[]; samer@0: byte buf[]; samer@0: samer@0: public ArrayVImageSource( double A[]) samer@0: { samer@0: array = A; samer@0: width = 1; samer@0: height = A.length; samer@0: buf = new byte[A.length]; samer@0: } samer@0: samer@0: protected int getHints() { samer@0: return ImageConsumer.TOPDOWNLEFTRIGHT samer@0: | ImageConsumer.COMPLETESCANLINES samer@0: | ImageConsumer.SINGLEPASS; samer@0: } samer@0: samer@0: protected void sendPixels(ImageConsumer ic) samer@0: { samer@0: int i, j; samer@0: for (i=0,j=array.length-1; i