Java 8 DataBufferUShort - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DataBufferUShort class.

This code example shows how to use the following methods:
            dataBuffer =
                new DataBufferShort((short[][])dataArray, size, offsets);
            break; 
        case DataBuffer.TYPE_USHORT:
            dataBuffer =
                new DataBufferUShort((short[][])dataArray, size, offsets);
            break; 
        case DataBuffer.TYPE_INT:
            dataBuffer =
                new DataBufferInt((int[][])dataArray, size, offsets);
            break; 
        case DataBuffer.TYPE_FLOAT:
            dataBuffer =
                DataBufferUtils.createDataBufferFloat((float[][])dataArray, size, offsets);
            break; 
        case DataBuffer.TYPE_DOUBLE:
            dataBuffer =
                DataBufferUtils.createDataBufferDouble((double[][])dataArray, size, offsets);
            break; 
        default: 
4
CodeRank
This code example shows how to use the following methods:
                    { 
                        short[][] bankData = (short[][])array;
                        /*for(int i = 0; i < numBanks; i++) { 
                            Arrays.fill(bankData[i], (short)0); 
                        }*/ 
                        db = new DataBufferUShort(bankData, (int)size);
                    } 
                    break; 
                case DataBuffer.TYPE_SHORT:
                    { 
                        short[][] bankData = (short[][])array;
                        /*for(int i = 0; i < numBanks; i++) { 
                            Arrays.fill(bankData[i], (short)0); 
                        }*/ 
                        db = new DataBufferShort(bankData, (int)size);
                    } 
                    break; 
                case DataBuffer.TYPE_INT:
                    { 
                        int[][] bankData = (int[][])array;
4
CodeRank
This code example shows how to use the following methods:
            byte[] buf = new byte[w * h];
            return new DataBufferByte(buf, buf.length);
        } 
        case DataBuffer.TYPE_USHORT: {
            short[] buf = new short[w * h];
            return new DataBufferUShort(buf, buf.length);
        } 
        case DataBuffer.TYPE_INT: {
            int[] buf = new int[w * h];
            return new DataBufferInt(buf, buf.length);
        } 
        default : 
            throw new RuntimeException("Unsupported data type.");
        } 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
                    { 
                        short[][] bankData = (short[][])array;
                        /* for(int i = 0; i < numBanks; i++) { 
                            Arrays.fill(bankData[i], (short)0); 
                        } */ 
                        db = new DataBufferUShort(bankData, (int)size);
                    } 
                    break; 
                case DataBuffer.TYPE_SHORT:
                    { 
                        short[][] bankData = (short[][])array;
                        /* for(int i = 0; i < numBanks; i++) { 
                            Arrays.fill(bankData[i], (short)0); 
                        } */ 
                        db = new DataBufferShort(bankData, (int)size);
                    } 
                    break; 
                case DataBuffer.TYPE_INT:
                    { 
                        int[][] bankData = (int[][])array;
4
CodeRank
This code example shows how to use the following methods:
      case DataBuffer.TYPE_BYTE:
	return new DataBufferByte((byte[]) data, size);
      case DataBuffer.TYPE_SHORT:
	return new DataBufferShort((short[]) data, size);
      case DataBuffer.TYPE_USHORT:
	return new DataBufferUShort((short[]) data, size);
      case DataBuffer.TYPE_INT:
	return new DataBufferInt((int[]) data, size);
      case DataBuffer.TYPE_FLOAT:
	return new DataBufferFloat((float[]) data, size);
      case DataBuffer.TYPE_DOUBLE:
	return new DataBufferDouble((double[]) data, size);
      default: 
	throw new UnsupportedOperationException();
      } 
  } 
 
  /**  
   * Return the data array of a data buffer, regardless of the data 
   * type. 
3
CodeRank
This code example shows how to use the following methods:getData
This code example shows how to use the following methods:
 
	@Override 
	protected DataBufferUShort createDataBuffer( final ShortArray data ) 
	{ 
		final short[] sourceArray = data.getCurrentStorageArray(); 
		return new DataBufferUShort( sourceArray, sourceArray.length ); 
	} 
 
} 
3
CodeRank
This code example shows how to use the following methods:
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
                                                 origin);
        } else { 
            dataBuffer = new DataBufferUShort(height*scanlineStride);
            ras = Raster.createInterleavedRaster(dataBuffer,
                                                 width, height,
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
                                                 origin);
        } 
 
        return ras;
    } 
 
    // Data filtering methods 
 
    private static void decodeSubFilter(byte[] curr, int count, int bpp) {
2
CodeRank
This code example shows how to use the following methods:
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
                                                 origin);
        } else { 
            dataBuffer = new DataBufferUShort(height*scanlineStride);
            ras = Raster.createInterleavedRaster(dataBuffer,
                                                 width, height,
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
                                                 origin);
        } 
 
        return ras;
    } 
 
    // Data filtering methods 
 
    private static void decodeSubFilter(byte[] curr, int count, int bpp) {
2
CodeRank
See Code Examples for Java 8 DataBufferUShort Methods: