Beispiel #1
0
        /// <summary>
        /// Creates a <code>DataBuffer</code> that corresponds to this
        /// <code>MultiPixelPackedSampleModel</code>.  The
        /// <code>DataBuffer</code> object's data type and size
        /// is consistent with this <code>MultiPixelPackedSampleModel</code>.
        /// The <code>DataBuffer</code> has a single bank. </summary>
        /// <returns> a <code>DataBuffer</code> with the same data type and
        /// size as this <code>MultiPixelPackedSampleModel</code>. </returns>
        public override DataBuffer CreateDataBuffer()
        {
            DataBuffer dataBuffer = null;

            int size = (int)ScanlineStride_Renamed * Height_Renamed;

            switch (DataType_Renamed)
            {
            case DataBuffer.TYPE_BYTE:
                dataBuffer = new DataBufferByte(size + (DataBitOffset_Renamed + 7) / 8);
                break;

            case DataBuffer.TYPE_USHORT:
                dataBuffer = new DataBufferUShort(size + (DataBitOffset_Renamed + 15) / 16);
                break;

            case DataBuffer.TYPE_INT:
                dataBuffer = new DataBufferInt(size + (DataBitOffset_Renamed + 31) / 32);
                break;
            }
            return(dataBuffer);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a DataBuffer that corresponds to this
        /// SinglePixelPackedSampleModel.  The DataBuffer's data type and size
        /// will be consistent with this SinglePixelPackedSampleModel.  The
        /// DataBuffer will have a single bank.
        /// </summary>
        public override DataBuffer CreateDataBuffer()
        {
            DataBuffer dataBuffer = null;

            int size = (int)BufferSize;

            switch (DataType_Renamed)
            {
            case DataBuffer.TYPE_BYTE:
                dataBuffer = new DataBufferByte(size);
                break;

            case DataBuffer.TYPE_USHORT:
                dataBuffer = new DataBufferUShort(size);
                break;

            case DataBuffer.TYPE_INT:
                dataBuffer = new DataBufferInt(size);
                break;
            }
            return(dataBuffer);
        }
        /// <summary>
        /// Creates a DataBuffer that corresponds to this BandedSampleModel,
        /// The DataBuffer's data type, number of banks, and size
        /// will be consistent with this BandedSampleModel. </summary>
        /// <exception cref="IllegalArgumentException"> if <code>dataType</code> is not
        ///         one of the supported types. </exception>
        public override DataBuffer CreateDataBuffer()
        {
            DataBuffer dataBuffer = null;

            int size = ScanlineStride_Renamed * Height_Renamed;

            switch (DataType_Renamed)
            {
            case DataBuffer.TYPE_BYTE:
                dataBuffer = new DataBufferByte(size, NumBanks);
                break;

            case DataBuffer.TYPE_USHORT:
                dataBuffer = new DataBufferUShort(size, NumBanks);
                break;

            case DataBuffer.TYPE_SHORT:
                dataBuffer = new DataBufferShort(size, NumBanks);
                break;

            case DataBuffer.TYPE_INT:
                dataBuffer = new DataBufferInt(size, NumBanks);
                break;

            case DataBuffer.TYPE_FLOAT:
                dataBuffer = new DataBufferFloat(size, NumBanks);
                break;

            case DataBuffer.TYPE_DOUBLE:
                dataBuffer = new DataBufferDouble(size, NumBanks);
                break;

            default:
                throw new IllegalArgumentException("dataType is not one " + "of the supported types.");
            }

            return(dataBuffer);
        }
Beispiel #4
0
 public virtual short[] GetData(DataBufferUShort dbus, int bank)
 {
     return(dbus.Bankdata[bank]);
 }