Changeset 7283 for trunk


Ignore:
Timestamp:
12/01/10 06:05:35 (9 years ago)
Author:
callan
Message:

Solution for minima and maxima calculation when using block based openBytes() access. (See  omero:#3599)

Location:
trunk/components/bio-formats
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/MinMaxCalculator.java

    r6881 r7283  
    286286    int numRGB = getRGBChannelCount(); 
    287287    int series = getSeries(); 
     288    int pixelType = getPixelType(); 
     289    int planeSize = getSizeX() * getSizeY(); 
     290    planeSize *= FormatTools.getBytesPerPixel(pixelType); 
    288291    // check whether min/max values have already been computed for this plane 
    289     if (!Double.isNaN(planeMin[series][ndx * numRGB])) return; 
     292    // and that the buffer requested is actually the entire plane 
     293    if (b.length >= planeSize 
     294        && !Double.isNaN(planeMin[series][ndx * numRGB])) return; 
    290295 
    291296    boolean little = isLittleEndian(); 
     
    301306      planeMax[series][pBase + c] = Double.NEGATIVE_INFINITY; 
    302307    } 
    303  
    304     int pixelType = getPixelType(); 
    305308 
    306309    boolean signed = FormatTools.isSigned(pixelType); 
Note: See TracChangeset for help on using the changeset viewer.