Tabnine Logo
LookupTableFactory.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
it.geosolutions.jaiext.lookup.LookupTableFactory

Best Java code snippets using it.geosolutions.jaiext.lookup.LookupTableFactory.create (Showing top 14 results out of 315)

origin: geotools/geotools

/** Simple utility method generating a Byte Based lookup table */
private static LookupTable generateLookupTableByte(byte[] lut) {
  return LookupTableFactory.create(lut, DataBuffer.TYPE_BYTE);
}
origin: geotools/geotools

/**
 * Builds a lookup table that is the identity on all bands but the alpha one, where the opacity
 * is applied
 *
 * @param opacity
 * @param bands
 * @param alphaBand
 * @return
 */
LookupTable buildOpacityLookupTable(
    float opacity, final int bands, int alphaBand, int dataType) {
  byte[][] matrix = new byte[bands][256];
  for (int band = 0; band < matrix.length; band++) {
    if (band == alphaBand) {
      for (int i = 0; i < 256; i++) {
        matrix[band][i] = (byte) Math.round(i * opacity);
      }
    } else {
      for (int i = 0; i < 256; i++) {
        matrix[band][i] = (byte) i;
      }
    }
  }
  LookupTable table = LookupTableFactory.create(matrix, dataType);
  return table;
}
origin: geotools/geotools

private LookupTable createLookupTableByte(List<Range<Integer>> exclusionValues, int dataType) {
  final byte[] b = new byte[256];
  Arrays.fill(b, (byte) 0);
  for (Range<Integer> exclusionValue : exclusionValues) {
    final int minValue = exclusionValue.getMinValue();
    final int maxValue = exclusionValue.getMaxValue();
    for (int i = minValue; i <= maxValue; i++) {
      b[i] = (byte) INVALID_PIXEL_I;
    }
  }
  return LookupTableFactory.create(b, dataType);
}
origin: geotools/geotools

  private LookupTable createLookupTableUShort(
      List<Range<Integer>> exclusionValues, int dataType) {
    final byte[] bUShort = new byte[65536];
    Arrays.fill(bUShort, (byte) 0);
    for (Range<Integer> exclusionValue : exclusionValues) {
      final int minValue = exclusionValue.getMinValue();
      final int maxValue = exclusionValue.getMaxValue();
      for (int i = minValue; i <= maxValue; i++) {
        bUShort[i] = (byte) INVALID_PIXEL_I;
      }
    }
    return LookupTableFactory.create(bUShort, dataType);
  }
}
origin: geotools/geotools

if (max < 256) {
  table =
      LookupTableFactory.create(
          new byte[] {(byte) value0, (byte) value1}, DataBuffer.TYPE_BYTE);
} else if (max < 65536) {
  table =
      LookupTableFactory.create(
          new short[] {(short) value0, (short) value1}, true);
} else {
  table = LookupTableFactory.create(new int[] {value0, value1});
table = LookupTableFactory.create(new int[] {value0, value1}, DataBuffer.TYPE_BYTE);
origin: geotools/geotools

  LookupTable table = LookupTableFactory.create(lut, dataType);
  worker.lookup(table);
} else {
origin: geotools/geotools

switch (dataType) {
  case DataBuffer.TYPE_BYTE:
    lut = LookupTableFactory.create(IDENTITY_BYTE);
    break;
    lut = LookupTableFactory.create(IDENTITY_SHORT, unsigned);
    break;
origin: geotools/geotools

lut = LookupTableFactory.create(data, datatype);
lut = LookupTableFactory.create(data, datatype == DataBuffer.TYPE_USHORT);
origin: geotools/geotools

LookupTableFactory.create(tableData, image.getSampleModel().getDataType());
origin: geotools/geotools

      LookupTableFactory.create(table, image.getSampleModel().getDataType());
} else {
  final short[] table = new short[mapSize];
    table[i] = (short) ((oldCM.getAlpha(i) == 0) ? suggestedTransparent : i);
  lookupTable = LookupTableFactory.create(table, true);
origin: geosolutions-it/jai-ext

private LookupTable buildNoDataLookupTable(int dataType, Range noDataRange) {
  byte[] table;
  switch (dataType) {
  case DataBuffer.TYPE_BYTE:
    table = new byte[256];
    for (int i = 0; i < table.length; i++) {
      if (noDataRange.contains(i)) {
        table[i] = 0;
      } else {
        table[i] = 1;
      }
    }
    break;
  case DataBuffer.TYPE_USHORT:
    table = new byte[65536];
    for (int i = 0; i < table.length; i++) {
      if (noDataRange.contains(i)) {
        table[i] = 0;
      } else {
        table[i] = 1;
      }
    }
    break;
  default:
    throw new IllegalArgumentException(
        "Unable to handle a index color model based on data type " + dataType);
  }
  return LookupTableFactory.create(table);
}
origin: geotools/geotools

LookupTableFactory.create(lutData, mask.getSampleModel().getDataType());
origin: geotools/geotools

.rangeLookup(lookupTable)
.bandCombine(matrix)
.lookup(LookupTableFactory.create(ALPHA_LUT))
.getRenderedImage();
origin: org.geoserver/gs-wms

/**
 * This takes an image with an indexed color model that uses less than 256 colors and has a 8bit
 * sample model, and transforms it to one that has the optimal sample model (for example, 1bit
 * if the palette only has 2 colors)
 *
 * @param source
 */
private static RenderedImage optimizeSampleModel(RenderedImage source) {
  int w = source.getWidth();
  int h = source.getHeight();
  ImageLayout layout = new ImageLayout();
  layout.setColorModel(source.getColorModel());
  layout.setSampleModel(source.getColorModel().createCompatibleSampleModel(w, h));
  // if I don't force tiling off with this setting an exception is thrown
  // when writing the image out...
  layout.setTileWidth(w);
  layout.setTileHeight(h);
  RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);
  LookupTable table = LookupTableFactory.create(IDENTITY_TABLE);
  // TODO SIMONE why not format?
  ImageWorker worker = new ImageWorker(source);
  worker.setRenderingHints(hints);
  worker.lookup(table);
  return worker.getRenderedImage();
}
it.geosolutions.jaiext.lookupLookupTableFactorycreate

Javadoc

Constructs a multi-banded lookup table from another one.

Popular methods of LookupTableFactory

    Popular in Java

    • Making http post requests using okhttp
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getSystemService (Context)
    • putExtra (Intent)
    • PrintStream (java.io)
      Fake signature of an existing Java class.
    • System (java.lang)
      Provides access to system-related information and resources including standard input and output. Ena
    • LinkedList (java.util)
      Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
    • ImageIO (javax.imageio)
    • BoxLayout (javax.swing)
    • Scheduler (org.quartz)
      This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now