Package Makelangelo

Examples of Makelangelo.MachineConfiguration


      return newImage;
  }


  public BufferedImage Process(BufferedImage img) {
    MachineConfiguration mc = MachineConfiguration.getSingleton();
    int w = img.getWidth();
    int h = img.getHeight();
   
    // cap the max_w and max_h so that enormous drawbot images don't break the software.
    double paper_w= mc.GetPaperWidth();
    double paper_h= mc.GetPaperHeight();
    // TODO make this number a variable that can be tweaked
    int max_w=maxWidth;
    int max_h=maxHeight;
    if(paper_w>paper_h) {
      max_h *= paper_h/paper_w;
View Full Code Here


    //System.out.println("output file = "+outputFile);

    try {
      OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(dest),"UTF-8");

      MachineConfiguration mc = MachineConfiguration.getSingleton();
      tool = mc.GetCurrentTool();
      SetupTransform();
      output.write(mc.GetConfigLine()+";\n");
      output.write(mc.GetBobbinLine()+";\n");
      tool.WriteChangeTo(output);
     
      TextSetAlign(Align.CENTER);
      TextSetVAlign(VAlign.MIDDLE);
      TextCreateMessageNow(lastMessage,output);
View Full Code Here

    }
  }
 
 
  protected void ConnectTheDots(BufferedImage img) {
    MachineConfiguration mc = MachineConfiguration.getSingleton();
    tool = mc.GetCurrentTool();
    ImageSetupTransform(img);

    int x,y,i;
    // count the points
    numPoints=0;
View Full Code Here

 

  private void CreateCurveNow(String dest) {
    try {
      OutputStreamWriter output = new OutputStreamWriter(new FileOutputStream(dest),"UTF-8");
      MachineConfiguration mc = MachineConfiguration.getSingleton();
      tool = mc.GetCurrentTool();
      SetupTransform((int)Math.ceil(xmax-xmin),(int)Math.ceil(ymax-ymin));
      output.write(mc.GetConfigLine()+";\n");
      output.write(mc.GetBobbinLine()+";\n");
      tool.WriteChangeTo(output);
           
      turtle_x=0;
      turtle_y=0;
      turtle_dx=0;
View Full Code Here

    lastup=false;
  }

 
  protected void ImageStart(BufferedImage img,OutputStreamWriter out) throws IOException {
    MachineConfiguration mc = MachineConfiguration.getSingleton();
    tool = mc.GetCurrentTool();

    ImageSetupTransform(img);
   
    out.write(mc.GetConfigLine()+";\n");
    out.write(mc.GetBobbinLine()+";\n");

    previous_x=0;
    previous_y=0;
   
    SetAbsoluteMode(out);
View Full Code Here

 
  /**
   * setup transform when there is no image to convert from.  Essentially a 1:1 transform.
   */
  protected void SetupTransform() {
    MachineConfiguration mc = MachineConfiguration.getSingleton();
    // TODO I don't remember why these * 20 are needed here.  Find out and comment the code.
    SetupTransform( (int)mc.GetPaperWidth()*20, (int)mc.GetPaperHeight()*20 );
  }
View Full Code Here

    image_height = height;
    image_width = width;
    h2=image_height/2;
    w2=image_width/2;
   
    MachineConfiguration mc = MachineConfiguration.getSingleton();
   
    scale=10f;

    int new_width = image_width;
    int new_height = image_height;
   
    if(image_width>mc.GetPaperWidth()) {
      float resize = (float)mc.GetPaperWidth()/(float)image_width;
      scale *= resize;
      new_height *= resize;
    }
    if(new_height>mc.GetPaperHeight()) {
      float resize = (float)mc.GetPaperHeight()/(float)new_height;
      scale *= resize;
      new_width *= resize;
    }
    scale *= mc.paper_margin;
    new_width *= mc.paper_margin;
View Full Code Here

 
  protected void TextCreateMessageNow(String text,OutputStreamWriter output) throws IOException {
    if(chars_per_line<=0) return;

    MachineConfiguration mc = MachineConfiguration.getSingleton();
    tool = mc.GetCurrentTool();
   
    // find size of text block
    // TODO count newlines
    Rectangle2D r = TextCalculateBounds(text);
View Full Code Here

TOP

Related Classes of Makelangelo.MachineConfiguration

Copyright © 2018 www.massapicom. 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.