Examples of Pixel


Examples of com.eclipsesource.tabris.passepartout.internal.unit.Pixel

    assertTrue( complies );
  }

  @Test
  public void testCompliesWithWidthSameThanMinWidth() {
    MinWidthCondition condition = new MinWidthCondition( new Pixel( 100 ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( createEnvironment( bounds ) );

    assertTrue( complies );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.unit.Pixel

    assertTrue( complies );
  }

  @Test
  public void testCompliesNotWithWidthSmallerThanMinWidth() {
    MinWidthCondition condition = new MinWidthCondition( new Pixel( 100 ) );
    Bounds bounds = new Bounds( 10, 10, 90, 0 );

    boolean complies = condition.compliesWith( createEnvironment( bounds ) );

    assertFalse( complies );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.unit.Pixel

    assertEquals( 100, bounds.getHeight() );
  }

  @Test
  public void testUsesPixelToComputeMargins() {
    MarginInstruction instruction = new MarginInstruction( new Pixel( 5 ),
                                                                     new Pixel( 5 ),
                                                                     new Pixel( 5 ),
                                                                     new Pixel( 5 ) );

    Bounds bounds = instruction.computeBounds( new Bounds( 0, 0, 100, 100 ), 16 );

    assertEquals( 5, bounds.getX() );
    assertEquals( 5, bounds.getY() );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.unit.Pixel

  @Test
  public void testUsesMixedUnitsToComputeMargins() {
    MarginInstruction instruction = new MarginInstruction( new Percentage( BigDecimal.valueOf( 10 ) ),
                                                                     new Em( BigDecimal.ONE ),
                                                                     new Percentage( BigDecimal.valueOf( 10 ) ),
                                                                     new Pixel( 10 ) );

    Bounds bounds = instruction.computeBounds( new Bounds( 0, 0, 100, 100 ), 10 );

    assertEquals( 10, bounds.getX() );
    assertEquals( 10, bounds.getY() );
View Full Code Here

Examples of fmg.fmg8.umgebung2D.Pixel

        double yFakt = bF / bf;
        int xNeuErst;
        int yNeuErst;
        int xNeuLetzt;
        int yNeuLetzt;
        Pixel normPix = null;
        Iterator<Pixel> it = this.neueNormPixel.iterator();

        while (it.hasNext()) {
            try {
                normPix = (Pixel) it.next();
                xNeuErst = (int) Math.round(normPix.x * xFakt);
                yNeuErst = (int) Math.round(normPix.y * yFakt);
                xNeuLetzt = (int) Math.round((normPix.x + 1) * xFakt);
                yNeuLetzt = (int) Math.round((normPix.y + 1) * yFakt);
                for (int x = xNeuErst; x < xNeuLetzt; x++) {
                    for (int y = yNeuErst; y < yNeuLetzt; y++) {
                        if (this.darFeld[x][y] != normPix.farbe()) {
                            this.wartPixel.add(new Pixel(x,
                                                         y,
                                                         normPix.farbe()));
                            this.darFeld[x][y] = normPix.farbe();
                        }
                    }
                }
            } catch (final Exception e) {
                SonstMeth.log(SonstMeth.LOG_WARNING,
View Full Code Here

Examples of org.gwtopenmaps.openlayers.client.Pixel

        }

        public LonLat getLonLat()
        {
            Map map = Map.narrowToMap(this.getSourceJSObject());
            Pixel pixel = Pixel.narrowToPixel(getJSObject().getProperty("xy"));

            return (pixel != null) ? map.getLonLatFromPixel(pixel) : null;
        }
View Full Code Here

Examples of org.jwildfire.image.Pixel

  }

  private void parsePalette(RGBPalette pPalette, String pUgr) {
    Map<Integer, RGBColor> colors = new HashMap<Integer, RGBColor>();
    StringTokenizer tokenizer = new StringTokenizer(pUgr, " \n\r");
    Pixel pixel = new Pixel();
    while (tokenizer.hasMoreElements()) {
      String token = tokenizer.nextToken();
      String nextToken;
      if (token.startsWith("title=")) {
        StringTokenizer lineTokenizer = new StringTokenizer(token, "\"");
        if (lineTokenizer.hasMoreElements()) {
          lineTokenizer.nextElement();
          if (lineTokenizer.hasMoreElements()) {
            pPalette.setFlam3Name((String) lineTokenizer.nextElement());
          }
        }
      }
      else if (token.startsWith("index=") && tokenizer.hasMoreElements() && (nextToken = tokenizer.nextToken()).startsWith("color=")) {
        int index = Integer.parseInt(token.substring(6, token.length()));
        int colorValue = Integer.parseInt(nextToken.substring(6, nextToken.length()));
        pixel.setARGBValue(colorValue);
        RGBColor color = new RGBColor(pixel.b, pixel.g, pixel.r);
        colors.put(index, color);
      }
    }
    boolean doInterpolate = pUgr.contains("numnodes=");
View Full Code Here

Examples of org.jwildfire.image.Pixel

        int maxValues = Mode.values().length;
        int idx = (int) ((double) Math.abs(modSwapRGB) / (double) 255.0 * (double) (maxValues - 1));
        sT.setMode(Mode.values()[idx]);
        sT.transformImage(img);
      }
      Pixel pixel = new Pixel();
      for (int i = startIdx; i <= endIdx; i++) {
        RGBColor color = transformedColors[i];
        pixel.setARGBValue(img.getARGBValue(i, 0));
        color.setRed(pixel.r);
        color.setGreen(pixel.g);
        color.setBlue(pixel.b);
      }
      modified = false;
View Full Code Here

Examples of org.jwildfire.image.Pixel

    modified = true;
  }

  public void monochrome(int pStartIdx, int pEndIdx) {
    if (pStartIdx < pEndIdx + 1) {
      Pixel rgbPixel = new Pixel();
      HSLTransformer.HSLPixel hslPixel = new HSLTransformer.HSLPixel();
      double avgHue = 0.0;
      int cnt = 0;
      for (int i = pStartIdx; i <= pEndIdx; i++) {
        RGBColor color = getRawColor(i);
        rgbPixel.setRGB(color.getRed(), color.getGreen(), color.getBlue());
        HSLTransformer.rgb2hsl(rgbPixel, hslPixel);
        avgHue += hslPixel.hue;
        cnt++;
      }
      avgHue /= (double) cnt;
      for (int i = pStartIdx; i <= pEndIdx; i++) {
        RGBColor color = getRawColor(i);
        rgbPixel.setRGB(color.getRed(), color.getGreen(), color.getBlue());
        HSLTransformer.rgb2hsl(rgbPixel, hslPixel);
        hslPixel.hue = avgHue;
        HSLTransformer.hsl2rgb(hslPixel, rgbPixel);
        color.setRed(rgbPixel.r);
        color.setGreen(rgbPixel.g);
View Full Code Here

Examples of org.jwildfire.image.Pixel

    res.add(gradient);
    gradient.setFlam3Name(new File(pFilename).getName());
    SimpleImage img = new ImageReader().loadImage(pFilename);
    if (img.getImageWidth() > 0 && img.getImageHeight() > 0) {
      Map<Integer, RGBColor> colors = new HashMap<Integer, RGBColor>();
      Pixel rgbPixel = new Pixel();
      for (int i = 0; i < img.getImageWidth(); i++) {
        rgbPixel.setARGBValue(img.getARGBValue(i, 0));
        RGBColor color = new RGBColor(rgbPixel.r, rgbPixel.g, rgbPixel.b);
        colors.put(i, color);
      }
      gradient.setColors(colors, false, false);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.