Package org.stathissideris.ascii2image.text

Examples of org.stathissideris.ascii2image.text.TextGrid.loadFrom()


        printRunInfo(cmdLine);
        System.out.println("Reading "+ (stdIn ? "standard input" : "file: " + fromFilename));
      }

      try {
        if(!grid.loadFrom(fromFilename, options.processingOptions)){
          System.err.println("Cannot open file "+fromFilename+" for reading");
        }
      } catch (UnsupportedEncodingException e1){
        System.err.println("Error: "+e1.getMessage());
        System.exit(1);
View Full Code Here


     
      for(int i = 0; i < iterations; i++) {
        System.out.println("iteration "+i);
       
        TextGrid grid = new TextGrid();
        grid.loadFrom(inputFilename);
        new Diagram(grid, options);
      }
     
      long b = java.lang.System.currentTimeMillis();
     
View Full Code Here

      System.out.println("Skipping " + textFile + " -- reference image does not exist");
      throw new FileNotFoundException("Reference image "+expectedFile+" does not exist");
    }
   
    TextGrid grid = new TextGrid();
    grid.loadFrom(textFile.toString());
    Diagram diagram = new Diagram(grid, options);

    RenderedImage image = new BitmapRenderer().renderToImage(diagram, options.renderingOptions);   
 
    File file = new File(actualFile.getAbsolutePath());
View Full Code Here

      long a = java.lang.System.nanoTime();
      long b;
      try {
        System.out.println("Rendering "+textFile+" to "+toFile);
       
        grid.loadFrom(textFile.toString());
        Diagram diagram = new Diagram(grid, options);

        RenderedImage image = new BitmapRenderer().renderToImage(diagram, options.renderingOptions);
       
        b = java.lang.System.nanoTime();
View Full Code Here

      long a = java.lang.System.nanoTime();
      long b;
      try {
        System.out.println("Rendering "+textFile+" to "+toFile);
       
        grid.loadFrom(textFile.toString());
        Diagram diagram = new Diagram(grid, options);

        RenderedImage image = new BitmapRenderer().renderToImage(diagram, options.renderingOptions);
       
        b = java.lang.System.nanoTime();
View Full Code Here

  }
 
  @Test public void testFillContinuousAreaSquareOutside() throws FileNotFoundException, IOException {
    TextGrid squareGrid;
    squareGrid = new TextGrid();
    squareGrid.loadFrom("tests/text/simple_square01.txt");

    CellSet filledArea = squareGrid.fillContinuousArea(0, 0, '*');
    int size = filledArea.size();
    assertEquals(64, size);
   
View Full Code Here

  }

  @Test public void testFillContinuousAreaSquareInside() throws FileNotFoundException, IOException {
    TextGrid squareGrid;
    squareGrid = new TextGrid();
    squareGrid.loadFrom("tests/text/simple_square01.txt");
   
    CellSet filledArea = squareGrid.fillContinuousArea(3, 3, '*');
    int size = filledArea.size();
    assertEquals(15, size);
   
View Full Code Here

  }

  @Test public void testFillContinuousAreaUInside() throws FileNotFoundException, IOException {
    TextGrid uGrid;
    uGrid = new TextGrid();
    uGrid.loadFrom("tests/text/simple_U01.txt");
   
    CellSet filledArea = uGrid.fillContinuousArea(3, 3, '*');
    int size = filledArea.size();
   
    assertEquals(62, size);
View Full Code Here

  }

  @Test public void testFillContinuousAreaUOutside() throws FileNotFoundException, IOException {
    TextGrid uGrid;
    uGrid = new TextGrid();
    uGrid.loadFrom("tests/text/simple_U01.txt");
   
    CellSet filledArea = uGrid.fillContinuousArea(0, 0, '*');
    int size = filledArea.size();
   
    assertEquals(128, size);
View Full Code Here

  }

  @Test public void testFillContinuousAreaSOutside() throws FileNotFoundException, IOException {
    TextGrid uGrid;
    uGrid = new TextGrid();
    uGrid.loadFrom("tests/text/simple_S01.txt");
   
    CellSet filledArea = uGrid.fillContinuousArea(0, 0, '*');
    int size = filledArea.size();
   
    assertEquals(246, size);
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.