mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-05 07:58:40 +00:00
8376297
This commit is contained in:
parent
b936635cbf
commit
ebde5c8a78
@ -239,7 +239,7 @@ public class MultiPixelPackedSampleModel extends SampleModel
|
||||
* Since {@code MultiPixelPackedSampleModel} has only one band,
|
||||
* this method ignores the {@code band} parameter and returns
|
||||
* the sample size of the single band.
|
||||
* @param band the specified band (ignored).
|
||||
* @param band the specified band (ignored)
|
||||
* @return the number of bits per sample for the specified band.
|
||||
*/
|
||||
public int getSampleSize(int band) {
|
||||
|
||||
@ -43,8 +43,8 @@ public class GetSampleSizeTest {
|
||||
|
||||
{
|
||||
ComponentSampleModel csm =
|
||||
new ComponentSampleModel(DataBuffer.TYPE_BYTE,
|
||||
width, height, 1, width, bandOffsets);
|
||||
new ComponentSampleModel(DataBuffer.TYPE_BYTE,
|
||||
width, height, 1, width, bandOffsets);
|
||||
int numBands = csm.getNumBands();
|
||||
System.out.println("CSM numBands = " + numBands);
|
||||
if (numBands != 2) {
|
||||
@ -55,8 +55,7 @@ public class GetSampleSizeTest {
|
||||
|
||||
{
|
||||
MultiPixelPackedSampleModel mppsm =
|
||||
new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE,
|
||||
width, height, 4);
|
||||
new MultiPixelPackedSampleModel(DataBuffer.TYPE_BYTE, width, height, 4);
|
||||
int numBands = mppsm.getNumBands();
|
||||
System.out.println("MPPSM numBands = " + numBands);
|
||||
if (numBands != 1) {
|
||||
@ -67,13 +66,12 @@ public class GetSampleSizeTest {
|
||||
|
||||
{
|
||||
SinglePixelPackedSampleModel sppsm =
|
||||
new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE,
|
||||
width, height, bitMask);
|
||||
int numBands = sppsm.getNumBands();
|
||||
new SinglePixelPackedSampleModel(DataBuffer.TYPE_BYTE, width, height, bitMask);
|
||||
int numBands = sppsm.getNumBands();
|
||||
System.out.println("SPPSM numBands = " + numBands);
|
||||
if (numBands != 4) {
|
||||
throw new RuntimeException("Unexpected numBands");
|
||||
}
|
||||
}
|
||||
try {
|
||||
System.out.println("SPPSM sample size = " + sppsm.getSampleSize(numBands));
|
||||
throw new RuntimeException("No expected AIOBE");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user