Hi Thanh,
I send you a simplified vesrion of my classes.
I can send you Sun Raster files if you want.
Just one question:
Where can I find examples about how create a BufferedImage decoder and the use of
the DataBuffer and SampleModel (No examples at Sun or JavaWorld).
In all the examples I have seen, the author use Toolkit.loadImage, create a
BufferedImage with a graphics, and draw the image in the graphics. With this method,
you lost original model of the image.
The JPEGImageDecoder.java use native code so it can't help programmers.
And I  use high level methods like ColorModel.createCompatibleWitableRaster(), I
can't precise informations like scanlinestride.May be the problem is here. In the
BufferedImageOp, you use high levels methods to make compatible the source and the
destination.

Denis

Thanh Nguyen wrote:

> Hi Denis,
> Could you send us a small test case so that we can investigate the
> problem here? I am interested to know how you create your Raster and
> ColorModel.  For some image formats, the Graphics2D.drawImage call to
> scale an image works internally just like you would call
> AffineTransformOp.filter and unscaled Graphics2D.drawImage
> consecutively in your application code.
>
> Thanks.
> thanh
>
> > Date: Wed, 17 Feb 1999 09:15:14 +0100
> > From: Denis Tellier <[EMAIL PROTECTED]>
> > X-Accept-Language: en
> > MIME-Version: 1.0
> > To: [EMAIL PROTECTED]
> > Subject: Re: [java2d] BufferedImage + scale
> > Content-Transfer-Encoding: 7bit
> >
> > Hi,
> > I have the similar problem with "custom-made" BufferedImage. Im'using a Raster
> > with a MultiPixelPackedSampleModel and an IndexedColorModel to load a sun
> raster
> > image file coded on 8 bits. When I want to scale it, I have these problems:
> > 1-with AffineTransfromOp.filter, a java.awt.image.ImagingOpException : Unable
> to
> > transform src image is throwed.
> > 2- with Graphics2D.drawImage, the scaled image is corrupted (it is duplicated
> by
> > 8 on the width).
> >
> > But it works fine with the 24 bits sun raster file .
> >
> > So I try to convert the indexed BufferedImage to a DirectColorModel but I have
> > the same exception with ColorConvertOp.
> >
> > Denis
> >
> > =====================================================================
> > To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> > Java 2D Home Page: http://java.sun.com/products/java-media/2D/

RasParam.java

RasImageDecoder.java

ImageLoader.java

Reply via email to