[4630] in java-interest

home help back first fref pref prev next nref lref last post

Re: Image question...

daemon@ATHENA.MIT.EDU (Jim Graham)
Tue Jan 9 19:09:29 1996

Date: Tue, 9 Jan 1996 13:08:12 -0800
From: flar@bendenweyr.Eng.Sun.COM (Jim Graham)
To: java-interest@java.Eng.Sun.COM, andyt@MIT.EDU


> But the filtering methods
> in ImageFilter only take in the old pixels.  This means that the new image
> cannot have more pixels than the old image.  Is there a way to further
> generalize ImageFilter so that the filtering methods can be more flexible?

There is no restriction that the filter output the same number of pixels
as it was input.  It can output any number and type of pixels that it
wants.  Override the "setDimensions" method in your ImageFilter if you
want to have a different output size than input size.  The CropImageFilter
does this as an example.

> I'm also looking at just getting the actual pixels of the original image and
> modify the pixels by hand, then recreate the image with MemoryImageSource.
> But I can't figure out how to get the array of pixels from an image.  Can 
> someone give me a hint?

You would be better off using an Image Filter so that you did not have to
create an extra memory buffer for the MemoryImageSource.  But, if you still
want to try this, then use the java.awt.image.PixelGrabber utility class.

				...jim
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post