/**
 * 
         -------- Copyright (C) [2012]  [Kristofer SCHWEIGER & Niklas FLORIAN1]---------

    This program is free software; you can redistribute it and/or modify it under the terms of the
 *  GNU General Public License as published by the Free Software Foundation; either version 2 of the License,
 *  or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 * 
    You should have received a copy of the GNU General Public License along with this program; if not, 
 *  write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA

 * 
 * For any licensing issues please contact us under following adress: Mosaik.Projekt.2012@gmail.com
 */


package dataBase.search.distance;

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


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));
		
		return  dist;
	}

}
