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

import dataBase.subPicture.PixelShort;

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

	@Override
	public float getDistance(PixelByte p1, PixelByte p2) {
		float dist = 0;
		dist += ((p1.r-p2.r1&0xff) * (p2.r-p1.r));
		dist += ((p1.g-p2.g1&0xff) * (p2.g-p1.g));
		dist += ((p1.b-p2.b1&0xff) * (p2.b-p1.b));
		
		return  Math.abs(dist);
	}

}
