/***************************************************************************
 * inches.cpp: implementation of Inches class
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-2007 the KTabEdit development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * 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.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

#include "inches.h"

#include "cm.h"
#include "pixel.h"

Inches::Inches(double in, uint dpi)
: Unit(dpi),
  mIn(in)
{
}

Inches::~Inches()
{

}

Cm Inches::toCm() const
{
	return Cm(mIn / inchesForACm(), dpi());
}

Pixel Inches::toPixel() const
{
	return Pixel(static_cast<uint>(dpi() * mIn), dpi());
}

double Inches::value() const
{
	return mIn;
}
