Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4296691

ComponentSampleModel constructor is too restrict on the "stride" variables.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.3.0
    • client-libs
    • None
    • 2d
    • generic
    • generic

      ComponentSampleModel constructor should not restrict the "stride" variables to be non-negative only. This provents certain form of storage where the first pixel is stored at the end of the buffer and proceeding backwards.

      Other methods in this class, such as createDataBuffer or createCompatibleSampleModel already handles negative strides. I've discuessed this issue with Jeannette Hung and the email exchange is copied below.

      Date: Thu, 2 Dec 1999 17:27:56 -0800 (PST)
      From: Jeannette Hung <###@###.###>
      Subject: Re: ComponentSampleModel
      To: ###@###.###
      MIME-Version: 1.0
      Content-MD5: GUA3t5Sp53OaMhXSbhKuzw==

      Why don't you file an RFE saying that ComponentSampleModel is too
      restrictive? I don't think we can fix it for Kestrel but we can fix
      it for Merlin. Would that be a problem? Do you really foresee people
      running into this one?

      jeannette

      > Date: Thu, 2 Dec 1999 15:08:27 -0800 (PST)
      > From: Julia Lee <###@###.###>
      > Subject: Re: ComponentSampleModel
      > To: ###@###.###
      > MIME-Version: 1.0
      > Content-MD5: zoxAriWFYSqUWXlJQshIHA==
      >
      > Yes. In ComponentVolumeSampleModel we do not place the same restriction.
      > We allow strides to be positive or negative. There is a set of methods
      > that create a 2D SampleModel from a 3D SampleModel which represents a
      > specific orthogonal plane. The idea is one can access 3D DataBuffer
      > using this SampleModel in a 2D RenderedImage without copy. For
      > ComponentVolumeSampleModel, the cooresponding 2D SampleModel would be
      > ComponentSampleModel. Therefore, if you have this restriction, we must
      > place the same restrictioon on 3D as well.
      >
      > Julia
      >
      >
      > > Date: Thu, 2 Dec 1999 14:47:38 -0800 (PST)
      > > From: Jeannette Hung <###@###.###>
      > > Subject: Re: ComponentSampleModel
      > > To: ###@###.###
      > > MIME-Version: 1.0
      > > Content-MD5: w4l0VVhH6fg7eZsyzUsZvQ==
      > >
      > > Looks like this was changed in version 1.18 in May 1998. You are
      > > correct that this is an unnecessary restriction. I think that we
      > > just forgot that it was something that we might want to allow. Is
      > > there some reason that you would like to do it?
      > >
      > > jeannette
      > >
      > > > Date: Thu, 2 Dec 1999 14:00:19 -0800 (PST)
      > > > From: Julia Lee <###@###.###>
      > > > Subject: ComponentSampleModel
      > > > To: ###@###.###
      > > > MIME-Version: 1.0
      > > > Content-MD5: w1IIiWrdkhHLCP1WouAXfw==
      > > >
      > > > Jeannette,
      > > >
      > > > Looking at version 1.25, the construct restricts that the pixelStride
      > > > and scanlineStride to be non-negative, yet all the other methods, such
      > > > as createDataBuffer, createCompatibleSampleModel, etc. deal with
      > > > negative stride values.
      > > >
      > > > It seems to me that this is an unnecessary restriction on the part of
      > > > the constructor since one could have a storage which start at the end
      > > > of the array and move backwards, especially since all the other code
      > > > already took care of this case.
      > > >
      > > > Has this been changed in a later version? or is there any reason for
      > > > this inconsistency?
      > > >
      > > > Julia
      > > >
      > >
      >

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: