2012-12-28 20:21:05 +00:00
|
|
|
/*
|
|
|
|
|
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup freestyle
|
|
|
|
|
* \brief Functions related to context queries
|
|
|
|
|
* \brief Interface to access the context related information.
|
2012-12-28 20:21:05 +00:00
|
|
|
*/
|
2008-04-30 15:41:54 +00:00
|
|
|
|
|
|
|
|
#include "ContextFunctions.h"
|
2012-12-28 20:21:05 +00:00
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
#include "../view_map/SteerableViewMap.h"
|
2012-12-28 20:21:05 +00:00
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
#include "../system/TimeStamp.h"
|
2012-12-28 20:21:05 +00:00
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
namespace ContextFunctions {
|
2012-12-28 20:21:05 +00:00
|
|
|
|
|
|
|
|
unsigned GetTimeStampCF()
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return TimeStamp::instance()->getTimeStamp();
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned GetCanvasWidthCF()
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return Canvas::getInstance()->width();
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned GetCanvasHeightCF()
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return Canvas::getInstance()->height();
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
2013-07-07 15:29:00 +00:00
|
|
|
BBox<Vec2i> GetBorderCF()
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return Canvas::getInstance()->border();
|
2013-07-07 15:29:00 +00:00
|
|
|
}
|
|
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
void LoadMapCF(const char *iFileName, const char *iMapName, unsigned iNbLevels, float iSigma)
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return Canvas::getInstance()->loadMap(iFileName, iMapName, iNbLevels, iSigma);
|
2008-04-30 15:41:54 +00:00
|
|
|
}
|
2012-12-28 20:21:05 +00:00
|
|
|
|
|
|
|
|
float ReadMapPixelCF(const char *iMapName, int level, unsigned x, unsigned y)
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
Canvas *canvas = Canvas::getInstance();
|
|
|
|
|
return canvas->readMapPixel(iMapName, level, x, y);
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float ReadCompleteViewMapPixelCF(int level, unsigned x, unsigned y)
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
|
|
|
|
|
return svm->readCompleteViewMapPixel(level, x, y);
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float ReadDirectionalViewMapPixelCF(int iOrientation, int level, unsigned x, unsigned y)
|
|
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
|
|
|
|
|
return svm->readSteerableViewMapPixel(iOrientation, level, x, y);
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
2013-03-11 06:56:51 +00:00
|
|
|
FEdge *GetSelectedFEdgeCF()
|
2012-12-28 20:21:05 +00:00
|
|
|
{
|
2019-04-17 06:17:24 +02:00
|
|
|
return Canvas::getInstance()->selectedFEdge();
|
2012-12-28 20:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
} // namespace ContextFunctions
|
2013-04-09 00:46:49 +00:00
|
|
|
|
|
|
|
|
} /* namespace Freestyle */
|