Jim,

Is there another SampleModel class that is more directly designed to do what
I am trying to do?

Basically I have a large 1D data array that represents a 3D space. I want to
be able to pull out and render various planes from the 3D space and I need
it to be very fast.

I had originally tried ComponentSampleModel and BandedSampleModel. In these
cases getDataElements( ) was called for each pixel and it took about 30
seconds to render a 512 x 512 image on a 650 MHz Pentium III, JDK 1.3.

Thank you, I appreciate your help,

Ted Hill


----- Original Message -----
From: "Jim Graham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 17, 2000 5:40 PM
Subject: Re: [JAVA2D] BufferedImage Internals Puzzler


> Hi Ted,
>
> I think others have shown how you can easily achieve the effect you want
> by using different SampleModels and DataBuffers with offsets defined and
> that is the best way to do this, but I wanted to address a philosophical
> issue that you raised in the way that you used subclassing here.
>
> > To display other 2D slices of the 3D data, I was planning to override
> > methods of PixelInterleavedSampleModel. So in my class,
> > MyPixelInterleavedSampleModel, I have overridden several methods of
> > PixelInterleavedSampleModel, ComponentSampleModel, and SampleModel
itself.
>
> In general I think that this statement boils down to "I was planning
> on overriding some of the methods on PixelInterleavedSampleModel (PISM)
> to do something other than what the class is documented and intended
> to do".  In other words, "I was overriding some of PISM's methods to
> break the contract it has defined with the agents who use it".
>
> We recognize this particular class and we take it as a contract that
> you want a particular type of formula used to convert from an X,Y
> coordinate pair to an index into the data array.  As a subclass, you
> should be focussed on implementing a special case of the more general
> operation that PISM implements, but instead you have implemented a
> more general formula than your superclass (a formula that has a concept
> of "slices" that its parent cannot describe or account for).  The proper
> place in the hierarchy for your new class so that you don't violate
> the contract of PISM would be a superclass of PISM...
>
> ...jim
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to