Tabnine Logo
FixedPoint.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.oculusinfo.tile.rendering.color.FixedPoint
constructor

Best Java code snippets using com.oculusinfo.tile.rendering.color.FixedPoint.<init> (Showing top 13 results out of 315)

origin: unchartedsoftware/aperture-tiles

  public BRColorRamp (boolean inverted, double opacity) {
    super(inverted,
       Arrays.asList(new FixedPoint(0.25, 0.0), new FixedPoint(0.50, 0.5), new FixedPoint(1.00, 1.0)),
       Arrays.asList(new FixedPoint(0.25, 0.0), new FixedPoint(0.375, 0.25), new FixedPoint(0.625, 0.25), new FixedPoint(0.75, 0.0)),
       Arrays.asList(new FixedPoint(0.00, 0.5), new FixedPoint(0.25, 1.0), new FixedPoint(0.75, 0.0)),
       null,
       opacity);
  }
}
origin: unchartedsoftware/aperture-tiles

  public WareColorRamp (boolean inverted, double opacity) {
    super(inverted,
       Arrays.asList(new FixedPoint(0, 0.25), new FixedPoint(0.25, 0.9), new FixedPoint(0.5, 0.1), new FixedPoint(0.75, 1)),
       new ArrayList<FixedPoint>(),
       Arrays.asList(new FixedPoint(0, 0.25), new FixedPoint(0.25, 0), new FixedPoint(0.85, 0), new FixedPoint(1, 1)),
       null,
       opacity);
  }
}
origin: unchartedsoftware/aperture-tiles

  public GreyColorRamp (boolean inverted, double opacity) {
    super(inverted,
       Arrays.asList(new FixedPoint(0.0, 0.0), new FixedPoint(1.0, 1.0)),
       Arrays.asList(new FixedPoint(0.0, 0.0), new FixedPoint(1.0, 1.0)),
       Arrays.asList(new FixedPoint(0.0, 0.0), new FixedPoint(1.0, 1.0)),
       null,
       opacity);
  }
}
origin: unchartedsoftware/aperture-tiles

  public SingleGradientColorRamp (Color from, Color to) {
    super(false,
       Arrays.asList(new FixedPoint(0.0, from.getRed()/255.0),   new FixedPoint(1.0, to.getRed()/255.0)),
       Arrays.asList(new FixedPoint(0.0, from.getGreen()/255.0), new FixedPoint(1.0, to.getGreen()/255.0)),
       Arrays.asList(new FixedPoint(0.0, from.getBlue()/255.0),  new FixedPoint(1.0, to.getBlue()/255.0)),
       Arrays.asList(new FixedPoint(0.0, from.getAlpha()/255.0), new FixedPoint(1.0, to.getAlpha()/255.0)),
       255);
  }
}
origin: unchartedsoftware/aperture-tiles

public AbstractColorRamp (boolean inverted, List<FixedPoint> reds, List<FixedPoint> greens, List<FixedPoint> blues, List<FixedPoint> alphas, double opacity){
  this.isInverted = inverted;
  this.reds = reds;
  this.greens = greens;
  this.blues = blues;
  if (null == alphas) {
    //there's no alphas, so initialize them with the single opacity field
    this.alphas = new ArrayList<>();
    this.alphas.add(new FixedPoint(0, opacity));
    this.alphas.add(new FixedPoint(1, opacity));
  } else {
    this.alphas = alphas;
  }
}
origin: unchartedsoftware/aperture-tiles

@Override
public FixedPoint unencode (String string) throws ConfigurationException {
  String[] parts = string.split("by");
  return new FixedPoint(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]));
}
origin: unchartedsoftware/aperture-tiles

@Override
public FixedPoint unencodeJSON (JSONNode propertyNode) throws JSONException, ConfigurationException {
  JSONObject node = propertyNode.getAsJSONObject();
  return new FixedPoint(node.getDouble("scale"), node.getDouble("value"));
}
origin: unchartedsoftware/aperture-tiles

/**
 * Creates a stepped gradient from a list of colors.
 *
 * @param colors
 *         The list of colors to step through at even intervals.
 * @return
 *         The new ramp.
 */
public static SteppedGradientColorRamp from(List<Color> colors) {
  List<FixedPoint> red = new ArrayList<>();
  List<FixedPoint> grn = new ArrayList<>();
  List<FixedPoint> blu = new ArrayList<>();
  List<FixedPoint> alp = new ArrayList<>();
  int n = colors.size()-1;
  int i = 0;
  double point = 0.0;
  double interval = 1.0/n;
  for (Color c: colors) {
    red.add(new FixedPoint(point, c.getRed()/255.0));
    grn.add(new FixedPoint(point, c.getGreen()/255.0));
    blu.add(new FixedPoint(point, c.getBlue()/255.0));
    alp.add(new FixedPoint(point, c.getAlpha()/255.0));
    i++;
    point = i < n? i*interval : 1.0;
  }
  return new SteppedGradientColorRamp(red, grn, blu, alp);
}
origin: unchartedsoftware/aperture-tiles

protected static List<FixedPoint> getFixedPointList(List<?> list) {
  int numPoints = list.size();
  List<FixedPoint> pointList = new ArrayList<FixedPoint>(numPoints);
  for (int i = 0; i < numPoints; ++i) {
    Object obj = list.get(i);
    if (obj != null) {
      FixedPoint point = null;
      if (obj instanceof List) {
        //the element is a list, so it should be 2 numbers that form a FixedPoint
        point = getFixedPointFromList((List<?>)obj);
      }
      else if (obj instanceof Map) {
        point = getFixedPointFromMap((Map<?, ?>)obj);
      }
      else {
        point = new FixedPoint(0, 0);
      }
      pointList.add(point);
    }
  }
  return pointList;
}
origin: unchartedsoftware/aperture-tiles

/**
 * Converts a list of items into a {@link FixedPoint}.
 * Uses the first element in the list as the scale, and the second element
 * as the value.
 * If the list doesn't have enough items, or the elements are not numbers,
 * then it treats them as 0.
 *
 * @param list
 *     A list of numbers.
 * @return
 *     Returns a {@link FixedPoint} based on the values in the list.
 */
protected static FixedPoint getFixedPointFromList(List<?> list) {
  double scale = 0;
  double value = 0;
  int numItems = list.size();
  if (numItems >= 1) {
    //the scale should be the first item
    scale = JsonUtilities.getNumber(list.get(0)).doubleValue();
  }
  if (numItems >= 2) {
    //the value should be the second item
    value = JsonUtilities.getNumber(list.get(1)).doubleValue();
  }
  return new FixedPoint(scale, value);
}
origin: unchartedsoftware/aperture-tiles

/**
 * Converts a map into a {@link FixedPoint}.
 * The map should contain a key labelled 'scale' or '0' for scale,
 * and 'value' or '1' for value.
 * If anything is missing, then it's considered 0.
 *
 * @param map
 *     A string->object map to pull objects from.
 * @return
 *     Returns a {@link FixedPoint} constructed from the elements of the map.
 */
protected static FixedPoint getFixedPointFromMap(Map<?, ?> map) {
  double scale = 0;
  double value = 0;
  if (map.containsKey("scale")) {
    scale = JsonUtilities.getNumber(map.get("scale")).doubleValue();
  }
  else if (map.containsKey("value")) {
    value = JsonUtilities.getNumber(map.get("value")).doubleValue();
  }
  else if (map.containsKey("0")) {
    scale = JsonUtilities.getNumber(map.get("0")).doubleValue();
  }
  else if (map.containsKey("1")) {
    value = JsonUtilities.getNumber(map.get("1")).doubleValue();
  }
  return new FixedPoint(scale, value);
}
origin: unchartedsoftware/aperture-tiles

  @Test
  public void testJSONSerialization () throws JSONException, ConfigurationException {
    FixedPointProperty prop = new FixedPointProperty("", "");
    FixedPoint pt = new FixedPoint(3.0, 4.0);
    JSONObject root = new JSONObject();
    JSONNode node = new JSONNode(root, "fixedpoint");
    prop.encodeJSON(node, pt);
    FixedPoint redux = prop.unencodeJSON(node);
    Assert.assertEquals(pt, redux);
  }
}
origin: unchartedsoftware/aperture-tiles

@Test
public void testPropertyFileSerialization () throws ConfigurationException {
  FixedPointProperty prop = new FixedPointProperty("", "");
  FixedPoint pt = new FixedPoint(3.0, 4.0);
  String encoded = prop.encode(pt);
  FixedPoint redux = prop.unencode(encoded);
  Assert.assertEquals(pt, redux);
}
com.oculusinfo.tile.rendering.colorFixedPoint<init>

Popular methods of FixedPoint

  • getScale
  • getValue

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for Android Studio
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