예제 #1
0
        public override DataBuffer createDataBuffer()
        {
            DataBuffer data = null;
            int size = scanlineStride * height;

            switch (dataType)
            {
                case DataBuffer.TYPE_BYTE:
                    data = new DataBufferByte(size, numBanks);
                    break;
                case DataBuffer.TYPE_SHORT:
                case DataBuffer.TYPE_USHORT:
                    data = new DataBufferShort(size, numBanks);
                    break;
                case DataBuffer.TYPE_INT:
                    data = new DataBufferInt(size, numBanks);
                    break;
                case DataBuffer.TYPE_FLOAT:
                    data = new DataBufferFloat(size, numBanks);
                    break;
                case DataBuffer.TYPE_DOUBLE:
                    data = new DataBufferDouble(size, numBanks);
                    break;
            }

            return data;
        }
예제 #2
0
        public override DataBuffer createDataBuffer()
        {
            DataBuffer data = null;
            int        size = scanlineStride * height;

            switch (dataType)
            {
            case DataBuffer.TYPE_BYTE:
                data = new DataBufferByte(size, numBanks);
                break;

            case DataBuffer.TYPE_SHORT:
            case DataBuffer.TYPE_USHORT:
                data = new DataBufferShort(size, numBanks);
                break;

            case DataBuffer.TYPE_INT:
                data = new DataBufferInt(size, numBanks);
                break;

            case DataBuffer.TYPE_FLOAT:
                data = new DataBufferFloat(size, numBanks);
                break;

            case DataBuffer.TYPE_DOUBLE:
                data = new DataBufferDouble(size, numBanks);
                break;
            }

            return(data);
        }
예제 #3
0
        public override DataBuffer createDataBuffer()
        {
            DataBuffer data = null;

            int maxOffset = bandOffsets[0];

            for (int i = 1; i < bandOffsets.Length; i++)
            {
                if (bandOffsets[i] > maxOffset)
                {
                    maxOffset = bandOffsets[i];
                }
            }
            int size = (height - 1) * scanlineStride +
                       (width - 1) * pixelStride + maxOffset + 1;

            switch (dataType)
            {
            case DataBuffer.TYPE_BYTE:
                data = new DataBufferByte(size, numBanks);
                break;

            case DataBuffer.TYPE_SHORT:
                data = new DataBufferShort(size, numBanks);
                break;

            case DataBuffer.TYPE_USHORT:
                data = new DataBufferUShort(size, numBanks);
                break;

            case DataBuffer.TYPE_INT:
                data = new DataBufferInt(size, numBanks);
                break;

            case DataBuffer.TYPE_FLOAT:
                data = new DataBufferFloat(size, numBanks);
                break;

            case DataBuffer.TYPE_DOUBLE:
                data = new DataBufferDouble(size, numBanks);
                break;
            }

            return(data);
        }
예제 #4
0
        public override DataBuffer createDataBuffer()
        {
            DataBuffer data = null;

            int maxOffset = bandOffsets[0];
            for (int i = 1; i < bandOffsets.Length; i++)
            {
                if (bandOffsets[i] > maxOffset)
                {
                    maxOffset = bandOffsets[i];
                }
            }
            int size = (height - 1) * scanlineStride +
            (width - 1) * pixelStride + maxOffset + 1;

            switch (dataType)
            {
                case DataBuffer.TYPE_BYTE:
                    data = new DataBufferByte(size, numBanks);
                    break;
                case DataBuffer.TYPE_SHORT:
                    data = new DataBufferShort(size, numBanks);
                    break;
                case DataBuffer.TYPE_USHORT:
                    data = new DataBufferUShort(size, numBanks);
                    break;
                case DataBuffer.TYPE_INT:
                    data = new DataBufferInt(size, numBanks);
                    break;
                case DataBuffer.TYPE_FLOAT:
                    data = new DataBufferFloat(size, numBanks);
                    break;
                case DataBuffer.TYPE_DOUBLE:
                    data = new DataBufferDouble(size, numBanks);
                    break;
            }

            return data;
        }