Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup freestyle
|
|
* \brief Functions related to context queries
|
|
* \brief Interface to access the context related information.
|
|
*/
|
|
|
|
#include "ContextFunctions.h"
|
|
|
|
#include "../view_map/SteerableViewMap.h"
|
|
|
|
#include "../system/TimeStamp.h"
|
|
|
|
namespace Freestyle::ContextFunctions {
|
|
|
|
unsigned GetTimeStampCF()
|
|
{
|
|
return TimeStamp::instance()->getTimeStamp();
|
|
}
|
|
|
|
unsigned GetCanvasWidthCF()
|
|
{
|
|
return Canvas::getInstance()->width();
|
|
}
|
|
|
|
unsigned GetCanvasHeightCF()
|
|
{
|
|
return Canvas::getInstance()->height();
|
|
}
|
|
|
|
BBox<Vec2i> GetBorderCF()
|
|
{
|
|
return Canvas::getInstance()->border();
|
|
}
|
|
|
|
void LoadMapCF(const char *iFileName, const char *iMapName, unsigned iNbLevels, float iSigma)
|
|
{
|
|
return Canvas::getInstance()->loadMap(iFileName, iMapName, iNbLevels, iSigma);
|
|
}
|
|
|
|
float ReadMapPixelCF(const char *iMapName, int level, unsigned x, unsigned y)
|
|
{
|
|
Canvas *canvas = Canvas::getInstance();
|
|
return canvas->readMapPixel(iMapName, level, x, y);
|
|
}
|
|
|
|
float ReadCompleteViewMapPixelCF(int level, unsigned x, unsigned y)
|
|
{
|
|
SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
|
|
return svm->readCompleteViewMapPixel(level, x, y);
|
|
}
|
|
|
|
float ReadDirectionalViewMapPixelCF(int iOrientation, int level, unsigned x, unsigned y)
|
|
{
|
|
SteerableViewMap *svm = Canvas::getInstance()->getSteerableViewMap();
|
|
return svm->readSteerableViewMapPixel(iOrientation, level, x, y);
|
|
}
|
|
|
|
FEdge *GetSelectedFEdgeCF()
|
|
{
|
|
return Canvas::getInstance()->selectedFEdge();
|
|
}
|
|
|
|
} // namespace Freestyle::ContextFunctions
|