/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dataBase.search.distance;

import util.simpleIO.Out;
import dataBase.subPicture.PixelByte;

/**
 *
 * @author Niklas
 */
public class Distance_L1 extends AbstractDistance {

	@Override
	public float getDistance(PixelByte p1, PixelByte p2) {
		float dist = 0;
		dist += Math.abs(p1.r1&0xff - p2.r1&0xff);
		dist += Math.abs(p1.g1&0xff - p2.g1&0xff);
		dist += Math.abs(p1.b1&0xff - p2.b1&0xff);
		
		Out.pl(" << Dist = "+ dist);
		
		return  dist;
	}

}
