Package Makelangelo

Examples of Makelangelo.C3.mul()


      quant_error.set( oldPixel.sub( newPixel ) );
      // pixel[x+1][y  ] += 7/16 * quant_error
      // pixel[x-1][y+1] += 3/16 * quant_error
      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
View Full Code Here


      // pixel[x-1][y+1] += 3/16 * quant_error
      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
View Full Code Here

      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
    }
View Full Code Here

      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
    }
  }

 
View Full Code Here

      }
    }

    if(sum==0) return new C3(255,255,255);
   
    return value.mul(1.0f/sum);
  }
 
 
  protected void Scan(int tool_index,BufferedImage img) throws IOException {
    palette_mask=tool_index;
View Full Code Here

      quant_error.set( oldPixel.sub( newPixel ) );
      // pixel[x+1][y  ] += 7/16 * quant_error
      // pixel[x-1][y+1] += 3/16 * quant_error
      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
View Full Code Here

      // pixel[x-1][y+1] += 3/16 * quant_error
      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
View Full Code Here

      // pixel[x  ][y+1] += 5/16 * quant_error
      // pixel[x+1][y+1] += 1/16 * quant_error
        nexterror[x          ].add(quant_error.mul(5.0/16.0));
      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
    }
View Full Code Here

      if(x+direction>=0 && x+direction < w) {
            error[x+direction].add(quant_error.mul(7.0/16.0));
        nexterror[x+direction].add(quant_error.mul(1.0/16.0));
      }
      if(x-direction>=0 && x-direction < w) {
        nexterror[x-direction].add(quant_error.mul(3.0/16.0));
      }
    }
  }
 
 
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.