2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
#pragma once
|
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
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
#include "Canvas.h"
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
#include "../image/GaussianFilter.h"
|
|
|
|
|
#include "../image/Image.h"
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
namespace Freestyle {
|
|
|
|
|
|
2008-04-30 15:41:54 +00:00
|
|
|
//
|
|
|
|
|
// Context Functions definitions
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////
|
2021-06-24 15:57:33 +10:00
|
|
|
/** namespace containing all the Context related functions */
|
2008-04-30 15:41:54 +00:00
|
|
|
namespace ContextFunctions {
|
|
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// GetTimeStamp
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Returns the system time stamp */
|
2023-07-25 12:51:50 +10:00
|
|
|
uint GetTimeStampCF();
|
2012-12-28 20:21:05 +00:00
|
|
|
|
|
|
|
|
// GetCanvasWidth
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Returns the canvas width */
|
2023-07-25 12:51:50 +10:00
|
|
|
uint GetCanvasWidthCF();
|
2012-12-28 20:21:05 +00:00
|
|
|
|
|
|
|
|
// GetCanvasHeight
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Returns the canvas height */
|
2023-07-25 12:51:50 +10:00
|
|
|
uint GetCanvasHeightCF();
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2013-07-07 15:29:00 +00:00
|
|
|
// GetBorder
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Returns the border */
|
2013-07-07 15:29:00 +00:00
|
|
|
BBox<Vec2i> GetBorderCF();
|
|
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// Load map
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Loads an image map for further reading */
|
2012-12-28 20:21:05 +00:00
|
|
|
void LoadMapCF(const char *iFileName,
|
|
|
|
|
const char *iMapName,
|
2023-07-25 12:51:50 +10:00
|
|
|
uint iNbLevels = 4,
|
2012-12-28 20:21:05 +00:00
|
|
|
float iSigma = 1.0f);
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// ReadMapPixel
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Reads a pixel in a user-defined map
|
2019-02-18 08:08:12 +11:00
|
|
|
* \return the floating value stored for that pixel
|
|
|
|
|
* \param iMapName:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The name of the map
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param level:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The level of the pyramid in which we wish to read the pixel
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param x:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The x-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param y:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The y-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
|
|
|
|
*/
|
2023-07-25 12:51:50 +10:00
|
|
|
float ReadMapPixelCF(const char *iMapName, int level, uint x, uint y);
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// ReadCompleteViewMapPixel
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Reads a pixel in the complete view map
|
2019-02-18 08:08:12 +11:00
|
|
|
* \return the floating value stored for that pixel
|
|
|
|
|
* \param level:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The level of the pyramid in which we wish to read the pixel
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param x:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The x-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param y:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The y-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
|
|
|
|
*/
|
2023-07-25 12:51:50 +10:00
|
|
|
float ReadCompleteViewMapPixelCF(int level, uint x, uint y);
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// ReadOrientedViewMapPixel
|
2021-06-24 15:57:33 +10:00
|
|
|
/** Reads a pixel in one of the oriented view map images
|
2019-02-18 08:08:12 +11:00
|
|
|
* \return the floating value stored for that pixel
|
|
|
|
|
* \param iOrientation:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The number telling which orientation we want to check
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param level:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The level of the pyramid in which we wish to read the pixel
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param x:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The x-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
2019-02-18 08:08:12 +11:00
|
|
|
* \param y:
|
2012-12-28 20:21:05 +00:00
|
|
|
* The y-coordinate of the pixel we wish to read. The origin is in the lower-left corner.
|
|
|
|
|
*/
|
2023-07-25 12:51:50 +10:00
|
|
|
float ReadDirectionalViewMapPixelCF(int iOrientation, int level, uint x, uint y);
|
2008-04-30 15:41:54 +00:00
|
|
|
|
2012-12-28 20:21:05 +00:00
|
|
|
// DEBUG
|
|
|
|
|
FEdge *GetSelectedFEdgeCF();
|
2008-04-30 15:41:54 +00:00
|
|
|
|
|
|
|
|
} // end of namespace ContextFunctions
|
|
|
|
|
|
2013-04-09 00:46:49 +00:00
|
|
|
} /* namespace Freestyle */
|