Blender
V3.3
|
#include <Canvas.h>
Public Types | |
typedef std::map< const char *, ImagePyramid *, ltstr > | mapsMap |
Public Member Functions | |
Canvas () | |
Canvas (const Canvas &iBrother) | |
virtual | ~Canvas () |
virtual void | preDraw () |
virtual void | Draw () |
virtual void | postDraw () |
virtual void | Render (const StrokeRenderer *iRenderer) |
virtual void | RenderBasic (const StrokeRenderer *iRenderer) |
virtual void | RenderStroke (Stroke *iStroke)=0 |
virtual void | init ()=0 |
void | Clear () |
virtual void | Erase () |
virtual void | readColorPixels (int x, int y, int w, int h, RGBImage &oImage) const =0 |
virtual void | readDepthPixels (int x, int y, int w, int h, GrayImage &oImage) const =0 |
virtual void | update ()=0 |
bool | isEmpty () const |
void | loadMap (const char *iFileName, const char *iMapName, unsigned iNbLevels=4, float iSigma=1.0f) |
float | readMapPixel (const char *iMapName, int level, int x, int y) |
void | loadSteerableViewMap (SteerableViewMap *iSVM) |
SteerableViewMap * | getSteerableViewMap () |
const FEdge * | selectedFEdge () const |
FEdge * | selectedFEdge () |
virtual int | width () const =0 |
virtual int | height () const =0 |
virtual BBox< Vec2i > | border () const =0 |
virtual BBox< Vec3r > | scene3DBBox () const =0 |
const StrokeRenderer * | renderer () const |
StyleModule * | getCurrentStyleModule () |
virtual bool | getRecordFlag () const |
int | getStrokeCount () const |
void | setSelectedFEdge (FEdge *iFEdge) |
void | PushBackStyleModule (StyleModule *iStyleModule) |
void | InsertStyleModule (unsigned index, StyleModule *iStyleModule) |
void | RemoveStyleModule (unsigned index) |
void | SwapStyleModules (unsigned i1, unsigned i2) |
void | ReplaceStyleModule (unsigned index, StyleModule *iStyleModule) |
void | setVisible (unsigned index, bool iVisible) |
void | AddLayer (StrokeLayer *iLayer) |
void | resetModified (bool iMod=false) |
void | causalStyleModules (std::vector< unsigned > &vec, unsigned index=0) |
void | setModified (unsigned index, bool iMod) |
Static Public Member Functions | |
static Canvas * | getInstance () |
Static Public Attributes | |
static const int | NB_STEERABLE_VIEWMAP = 5 |
Protected Attributes | |
std::deque< StrokeLayer * > | _Layers |
std::deque< StyleModule * > | _StyleModules |
FEdge * | _SelectedFEdge |
StrokeRenderer * | _Renderer |
StyleModule * | _current_sm |
mapsMap | _maps |
SteerableViewMap * | _steerableViewMap |
bool | _basic |
int | stroke_count |
Static Protected Attributes | |
static Canvas * | _pInstance = nullptr |
static const char * | _MapsPath = nullptr |
Class to define the canvas on which strokes are drawn. It's used to store state information about the drawing.
typedef std::map<const char *, ImagePyramid *, ltstr> Freestyle::Canvas::mapsMap |
Freestyle::Canvas::Canvas | ( | ) |
Definition at line 41 of file Canvas.cpp.
References init.
Freestyle::Canvas::Canvas | ( | const Canvas & | iBrother | ) |
Definition at line 52 of file Canvas.cpp.
References _basic, _current_sm, _Renderer, _SelectedFEdge, _steerableViewMap, and init.
|
virtual |
Definition at line 63 of file Canvas.cpp.
|
inline |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetBorderCF().
void Freestyle::Canvas::causalStyleModules | ( | std::vector< unsigned > & | vec, |
unsigned | index = 0 |
||
) |
Definition at line 266 of file Canvas.cpp.
References size().
Referenced by Freestyle::Controller::updateCausalStyleModules().
void Freestyle::Canvas::Clear | ( | ) |
Definition at line 118 of file Canvas.cpp.
Referenced by Freestyle::Controller::Clear(), and Freestyle::Controller::CloseFile().
|
virtual |
Definition at line 86 of file Canvas.cpp.
References Freestyle::TimeStamp::increment(), and instance.
Referenced by Freestyle::Controller::DrawStrokes().
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 147 of file Canvas.cpp.
References update().
Referenced by Freestyle::AppCanvas::Erase().
|
inline |
|
inlinestatic |
Returns a pointer on the Canvas instance
Definition at line 55 of file Canvas.h.
Referenced by Freestyle::ContextFunctions::GetBorderCF(), Freestyle::ContextFunctions::GetCanvasHeightCF(), Freestyle::ContextFunctions::GetCanvasWidthCF(), Freestyle::ContextFunctions::GetSelectedFEdgeCF(), Freestyle::ContextFunctions::LoadMapCF(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::Functions0D::ReadMapPixelF0D::operator()(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::operator()(), Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()(), Freestyle::PSStrokeRenderer::PSStrokeRenderer(), Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF(), Freestyle::ContextFunctions::ReadDirectionalViewMapPixelCF(), Freestyle::ContextFunctions::ReadMapPixelCF(), and Freestyle::TextStrokeRenderer::TextStrokeRenderer().
|
inlinevirtual |
|
inline |
Returns the steerable VM
Definition at line 163 of file Canvas.h.
Referenced by Freestyle::Controller::ComputeSteerableViewMap(), Freestyle::Controller::displayDensityCurves(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::operator()(), Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()(), Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF(), Freestyle::ContextFunctions::ReadDirectionalViewMapPixelCF(), and Freestyle::Controller::saveSteerableViewMapImages().
|
inline |
Definition at line 199 of file Canvas.h.
Referenced by Freestyle::Controller::DrawStrokes().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetCanvasHeightCF(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::PSStrokeRenderer::PSStrokeRenderer(), and Freestyle::TextStrokeRenderer::TextStrokeRenderer().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
void Freestyle::Canvas::InsertStyleModule | ( | unsigned | index, |
StyleModule * | iStyleModule | ||
) |
Definition at line 172 of file Canvas.cpp.
References size().
Referenced by Freestyle::Controller::InsertStyleModule().
void Freestyle::Canvas::loadMap | ( | const char * | iFileName, |
const char * | iMapName, | ||
unsigned | iNbLevels = 4 , |
||
float | iSigma = 1.0f |
||
) |
Loads an image map. The map will be scaled (without preserving the ratio in order to fit the actual canvas size.). The image must be a gray values image...
iFileName | The name of the image file |
iMapName | The name that will be used to access this image |
iNbLevels | The number of levels in the map pyramid. (default = 4). If iNbLevels == 0, the complete pyramid is built. |
Definition at line 297 of file Canvas.cpp.
References Freestyle::c, ImBuf::ftype, Freestyle::ImagePyramid::getNumberOfLevels(), Freestyle::GaussianFilter::getSmoothedPixel(), Freestyle::ImagePyramid::height(), height, IB_rect, IMB_allocImBuf(), IMB_dupImBuf(), IMB_FTYPE_BMP, IMB_loadiffname(), IMB_saveiff(), IMB_scaleImBuf(), Freestyle::ImagePyramid::pixel(), Freestyle::GrayImage::pixel(), ImBuf::rect, Freestyle::GrayImage::setPixel(), w(), Freestyle::ImagePyramid::width(), width, x, and y.
Referenced by Freestyle::ContextFunctions::LoadMapCF().
|
inline |
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 113 of file Canvas.cpp.
References update().
Referenced by Freestyle::AppCanvas::postDraw().
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 82 of file Canvas.cpp.
Referenced by Freestyle::AppCanvas::preDraw().
void Freestyle::Canvas::PushBackStyleModule | ( | StyleModule * | iStyleModule | ) |
inserts a shader at pos index+1
Definition at line 165 of file Canvas.cpp.
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::Functions0D::DensityF0D::operator()().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::Functions0D::LocalAverageDepthF0D::operator()().
float Freestyle::Canvas::readMapPixel | ( | const char * | iMapName, |
int | level, | ||
int | x, | ||
int | y | ||
) |
Reads a pixel value in a map. Returns a value between 0 and 1.
iMapName | The name of the map |
level | The level of the pyramid from which the pixel must be read. |
x | The abscissa of the desired pixel specified in level0 coordinate system. The origin is the lower left corner. |
y | The ordinate of the desired pixel specified in level0 coordinate system. The origin is the lower left corner. |
Definition at line 447 of file Canvas.cpp.
References G, G_DEBUG_FREESTYLE, Freestyle::ImagePyramid::height(), height, Freestyle::ImagePyramid::pixel(), Freestyle::ImagePyramid::width(), x, and y.
Referenced by Freestyle::Functions0D::ReadMapPixelF0D::operator()(), and Freestyle::ContextFunctions::ReadMapPixelCF().
void Freestyle::Canvas::RemoveStyleModule | ( | unsigned | index | ) |
Definition at line 185 of file Canvas.cpp.
Referenced by Freestyle::Controller::RemoveStyleModule().
|
virtual |
Definition at line 277 of file Canvas.cpp.
Referenced by Freestyle::Controller::RenderStrokes().
|
virtual |
Definition at line 287 of file Canvas.cpp.
|
inline |
Implemented in Freestyle::AppCanvas.
void Freestyle::Canvas::ReplaceStyleModule | ( | unsigned | index, |
StyleModule * | iStyleModule | ||
) |
Definition at line 232 of file Canvas.cpp.
Referenced by Freestyle::Controller::ReloadStyleModule().
Definition at line 258 of file Canvas.cpp.
References size().
Referenced by Freestyle::Controller::resetModified().
Implemented in Freestyle::AppCanvas.
|
inline |
accessors
Definition at line 169 of file Canvas.h.
Referenced by Freestyle::ContextFunctions::GetSelectedFEdgeCF().
Definition at line 253 of file Canvas.cpp.
Referenced by Freestyle::Controller::setModified(), and Freestyle::Controller::updateCausalStyleModules().
Definition at line 248 of file Canvas.cpp.
References Freestyle::StyleModule::setDisplayed().
Referenced by Freestyle::Controller::toggleLayer().
void Freestyle::Canvas::SwapStyleModules | ( | unsigned | i1, |
unsigned | i2 | ||
) |
Definition at line 219 of file Canvas.cpp.
References i1.
Referenced by Freestyle::Controller::SwapStyleModules().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetCanvasWidthCF(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::PSStrokeRenderer::PSStrokeRenderer(), and Freestyle::TextStrokeRenderer::TextStrokeRenderer().
|
protected |
Definition at line 74 of file Canvas.h.
Referenced by Canvas(), and Freestyle::AppCanvas::RenderStroke().
|
protected |
|
protected |
Definition at line 65 of file Canvas.h.
Referenced by Freestyle::AppCanvas::postDraw().
|
staticprotected |
Definition at line 72 of file Canvas.h.
Referenced by Freestyle::AppCanvas::AppCanvas().
|
staticprotected |
|
protected |
Definition at line 69 of file Canvas.h.
Referenced by Canvas(), Freestyle::AppCanvas::init(), and Freestyle::AppCanvas::RenderStroke().
|
protected |
|
protected |
|
protected |
Definition at line 66 of file Canvas.h.
Referenced by Freestyle::AppCanvas::postDraw().
|
static |
Definition at line 61 of file Canvas.h.
Referenced by Freestyle::Controller::ComputeSteerableViewMap().