java.awt.image.DataBuffer#TYPE_UNDEFINED源码实例Demo

下面列出了java.awt.image.DataBuffer#TYPE_UNDEFINED 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码2 项目: TencentKona-8   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码3 项目: jdk8u60   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码4 项目: openjdk-jdk8u   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码6 项目: openjdk-jdk9   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码7 项目: jdk8u-jdk   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码8 项目: hottub   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码9 项目: openjdk-8-source   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码10 项目: openjdk-8   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码11 项目: jdk8u_jdk   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码12 项目: jdk8u-jdk   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码13 项目: jdk8u-dev-jdk   文件: ColConvTest.java
static String getDTName(int dType) {
    switch(dType) {
        case DataBuffer.TYPE_BYTE:
            return "TYPE_BYTE";
        case DataBuffer.TYPE_DOUBLE:
            return "TYPE_DOUBLE";
        case DataBuffer.TYPE_FLOAT:
            return "TYPE_FLOAT";
        case DataBuffer.TYPE_INT:
            return "TYPE_INT";
        case DataBuffer.TYPE_SHORT:
            return "TYPE_SHORT";
        case DataBuffer.TYPE_USHORT:
            return "TYPE_USHORT";
        case DataBuffer.TYPE_UNDEFINED:
            return "TYPE_UNDEFINED";
    }
    return "UNKNOWN";
}
 
源代码14 项目: sis   文件: ImageRenderer.java
/**
 * Sets the data as vectors. The number of vectors must be equal to the {@linkplain #getNumBands() expected number of bands}.
 * All vectors must be backed by arrays (indirectly, through {@linkplain Vector#buffer() buffers} backed by arrays) and have
 * the same {@linkplain Vector#size() size}.
 * This method wraps the underlying arrays of a primitive type into a Java2D buffer; data are not copied.
 *
 * <p><b>Implementation note:</b> the NIO buffers are set by a call to {@link #setData(int, Buffer...)},
 * which can be overridden by subclasses if desired.</p>
 *
 * @param  data  the vectors wrapping arrays of primitive type.
 * @throws NullArgumentException if {@code data} is null or one of {@code data} element is null.
 * @throws MismatchedCoverageRangeException if the number of specified vectors is not equal to the number of bands.
 * @throws UnsupportedOperationException if a vector is not backed by an accessible array or is read-only.
 * @throws RasterFormatException if vectors do not have the same size.
 * @throws ArithmeticException if a buffer position overflows the 32 bits integer capacity.
 */
public void setData(final Vector... data) {
    ArgumentChecks.ensureNonNull("data", data);
    ensureExpectedBandCount(data.length, true);
    final Buffer[] buffers = new Buffer[data.length];
    int dataType = DataBuffer.TYPE_UNDEFINED;
    for (int i=0; i<data.length; i++) {
        final Vector v = data[i];
        ArgumentChecks.ensureNonNullElement("data", i, v);
        final int t = RasterFactory.getType(v.getElementType(), v.isUnsigned());
        if (dataType != t) {
            if (i != 0) {
                throw new RasterFormatException(Resources.format(Resources.Keys.MismatchedDataType));
            }
            dataType = t;
        }
        buffers[i] = v.buffer().orElseThrow(UnsupportedOperationException::new);
    }
    setData(dataType, buffers);
}
 
源代码15 项目: pdfxtk   文件: Util.java
/** Turns a DataBuffer.TYPE_* integer into a string

      @param datatype the DataBuffer.TYPE_* integer
      @return human readable form */

  public static String getDataType(int datatype) {
    switch (datatype) {
    case DataBuffer.TYPE_BYTE:
      return "TYPE_BYTE";
    case DataBuffer.TYPE_DOUBLE:
      return "TYPE_DOUBLE";
    case DataBuffer.TYPE_FLOAT:
      return "TYPE_FLOAT";
    case DataBuffer.TYPE_INT:
      return "TYPE_INT";
    case DataBuffer.TYPE_SHORT:
      return "TYPE_SHORT";
    case DataBuffer.TYPE_UNDEFINED:
      return "TYPE_UNDEFINED";
    case DataBuffer.TYPE_USHORT:
      return "TYPE_USHORT";
    default:
      return "unknown";
    }
  }
 
源代码16 项目: sis   文件: RasterFactory.java
/**
 * Returns the {@link DataBuffer} constant for the given type. The given {@code sample} class
 * should be a primitive type such as {@link Float#TYPE}. Wrappers class are also accepted.
 *
 * @param  sample    the primitive type or its wrapper class. May be {@code null}.
 * @param  unsigned  whether the type should be considered unsigned.
 * @return the {@link DataBuffer} type, or {@link DataBuffer#TYPE_UNDEFINED}.
 */
public static int getType(final Class<?> sample, final boolean unsigned) {
    switch (Numbers.getEnumConstant(sample)) {
        case Numbers.BYTE:    if (unsigned) return DataBuffer.TYPE_BYTE; else break;
        case Numbers.SHORT:   return unsigned ? DataBuffer.TYPE_USHORT : DataBuffer.TYPE_SHORT;
        case Numbers.INTEGER: if (!unsigned) return DataBuffer.TYPE_INT; else break;
        case Numbers.FLOAT:   return DataBuffer.TYPE_FLOAT;
        case Numbers.DOUBLE:  return DataBuffer.TYPE_DOUBLE;
    }
    return DataBuffer.TYPE_UNDEFINED;
}
 
源代码17 项目: sis   文件: Convention.java
/**
 * Returns whether the given variable is used as a coordinate system axis, a coverage or something else.
 * In particular this method shall return {@link VariableRole#AXIS} if the given variable seems to be a
 * coordinate system axis instead than the actual data. By netCDF convention, coordinate system axes
 * have the name of one of the dimensions defined in the netCDF header.
 *
 * <p>The default implementation returns {@link VariableRole#COVERAGE} if the given variable can be used
 * for generating an image, by checking the following conditions:</p>
 *
 * <ul>
 *   <li>Images require at least {@value Grid#MIN_DIMENSION} dimensions of size equals or greater than {@value Grid#MIN_SPAN}.
 *       They may have more dimensions, in which case a slice will be taken later.</li>
 *   <li>Exclude axes. Axes are often already excluded by the above condition because axis are usually 1-dimensional,
 *       but some axes are 2-dimensional (e.g. a localization grid).</li>
 *   <li>Excludes characters, strings and structures, which can not be easily mapped to an image type.
 *       In addition, 2-dimensional character arrays are often used for annotations and we do not want
 *       to confuse them with images.</li>
 * </ul>
 *
 * @param  variable  the variable for which to get the role.
 * @return role of the given variable.
 */
public VariableRole roleOf(final Variable variable) {
    if (variable.isCoordinateSystemAxis()) {
        return VariableRole.AXIS;
    }
    int numVectors = 0;                                     // Number of dimension having more than 1 value.
    for (final Dimension dimension : variable.getGridDimensions()) {
        if (dimension.length() >= Grid.MIN_SPAN) {
            numVectors++;
        }
    }
    if (numVectors >= Grid.MIN_DIMENSION) {
        final DataType dataType = variable.getDataType();
        if (dataType.rasterDataType != DataBuffer.TYPE_UNDEFINED) {
            return VariableRole.COVERAGE;
        }
    }
    return VariableRole.OTHER;
}