/* Copyright (C) 2000 Free Software Foundation This file is part of libgcj. This software is copyrighted work licensed under the terms of the Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details. */ package java.awt.image; import gnu.gcj.awt.Buffers; /* FIXME: This class does not yet support data type TYPE_SHORT */ /** * @author Rolf W. Rasmussen */ public class ComponentSampleModel extends SampleModel { protected int[] bandOffsets; protected int[] bankIndices; // FIXME: Should we really shadow the numBands in the superclass? //protected int numBands; /** Used when creating data buffers. */ protected int numBanks; protected int scanlineStride; protected int pixelStride; private boolean tightPixelPacking = false; public ComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bandOffsets) { this(dataType, w, h, pixelStride, scanlineStride, new int[bandOffsets.length], bandOffsets); } public ComponentSampleModel(int dataType, int w, int h, int pixelStride, int scanlineStride, int[] bankIndices, int[] bandOffsets) { super(dataType, w, h, bandOffsets.length); if ((pixelStride<0) || (scanlineStride<0) || (bandOffsets.length<1) || (bandOffsets.length != bankIndices.length)) throw new IllegalArgumentException(); this.bandOffsets = bandOffsets; this.bankIndices = bankIndices; for (int b=0; b