|
Blender V4.3
|
#include <Canvas.h>
Inherited by Freestyle::AppCanvas.
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, uint 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 (uint index, StyleModule *iStyleModule) |
| void | RemoveStyleModule (uint index) |
| void | SwapStyleModules (uint i1, uint i2) |
| void | ReplaceStyleModule (uint index, StyleModule *iStyleModule) |
| void | setVisible (uint index, bool iVisible) |
| void | AddLayer (StrokeLayer *iLayer) |
| void | resetModified (bool iMod=false) |
| void | causalStyleModules (std::vector< uint > &vec, uint index=0) |
| void | setModified (uint 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 45 of file Canvas.cpp.
References _basic, _current_sm, _pInstance, _Renderer, _SelectedFEdge, _steerableViewMap, Freestyle::PseudoNoise::init(), and NB_STEERABLE_VIEWMAP.
| Freestyle::Canvas::Canvas | ( | const Canvas & | iBrother | ) |
Definition at line 56 of file Canvas.cpp.
References _basic, _current_sm, _pInstance, _Renderer, _SelectedFEdge, _steerableViewMap, and Freestyle::PseudoNoise::init().
|
virtual |
Definition at line 67 of file Canvas.cpp.
References _maps, _pInstance, _Renderer, _steerableViewMap, and Clear().
|
inline |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetBorderCF().
Definition at line 274 of file Canvas.cpp.
References _StyleModules, and size().
Referenced by Freestyle::Controller::updateCausalStyleModules().
| void Freestyle::Canvas::Clear | ( | ) |
Definition at line 120 of file Canvas.cpp.
References _Layers, _steerableViewMap, _StyleModules, Freestyle::SteerableViewMap::Reset(), and stroke_count.
Referenced by Freestyle::Controller::Clear(), Freestyle::Controller::CloseFile(), and ~Canvas().
|
virtual |
Definition at line 88 of file Canvas.cpp.
References _current_sm, _Layers, _StyleModules, Freestyle::StyleModule::execute(), Freestyle::TimeStamp::increment(), Freestyle::TimeStamp::instance(), postDraw(), preDraw(), stroke_count, and Freestyle::StrokeLayer::strokes_size().
Referenced by Freestyle::Controller::DrawStrokes().
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 151 of file Canvas.cpp.
References _Layers, _steerableViewMap, Freestyle::SteerableViewMap::Reset(), stroke_count, and update().
Referenced by Freestyle::AppCanvas::Erase().
|
inline |
Definition at line 191 of file Canvas.h.
References _current_sm.
|
inlinestatic |
Returns a pointer on the Canvas instance
Definition at line 57 of file Canvas.h.
References _pInstance.
Referenced by Freestyle::ContextFunctions::GetBorderCF(), Freestyle::ContextFunctions::GetCanvasHeightCF(), Freestyle::ContextFunctions::GetCanvasWidthCF(), Freestyle::ContextFunctions::GetSelectedFEdgeCF(), Freestyle::ContextFunctions::LoadMapCF(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::ReadMapPixelF0D::operator()(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::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 165 of file Canvas.h.
References _steerableViewMap.
Referenced by Freestyle::Controller::ComputeSteerableViewMap(), Freestyle::Controller::displayDensityCurves(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::operator()(), Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()(), Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF(), Freestyle::ContextFunctions::ReadDirectionalViewMapPixelCF(), and Freestyle::Controller::saveSteerableViewMapImages().
|
inline |
Definition at line 201 of file Canvas.h.
References stroke_count.
Referenced by Freestyle::Controller::DrawStrokes().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetCanvasHeightCF(), loadMap(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::PSStrokeRenderer::PSStrokeRenderer(), readMapPixel(), and Freestyle::TextStrokeRenderer::TextStrokeRenderer().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
| void Freestyle::Canvas::InsertStyleModule | ( | uint | index, |
| StyleModule * | iStyleModule ) |
Definition at line 177 of file Canvas.cpp.
References _Layers, and _StyleModules.
Referenced by Freestyle::Controller::InsertStyleModule(), Freestyle::Controller::InsertStyleModule(), and Freestyle::Controller::InsertStyleModule().
|
inline |
| void Freestyle::Canvas::loadMap | ( | const char * | iFileName, |
| const char * | iMapName, | ||
| uint | 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 305 of file Canvas.cpp.
References _maps, _MapsPath, Box, ImBuf::byte_buffer, Freestyle::c, ImBufByteBuffer::data, ImBuf::ftype, Freestyle::ImagePyramid::getNumberOfLevels(), Freestyle::GaussianFilter::getSmoothedPixel(), height(), Freestyle::ImagePyramid::height(), IB_rect, IMB_allocImBuf(), IMB_dupImBuf(), IMB_FTYPE_BMP, IMB_loadiffname(), IMB_saveiff(), IMB_scale(), int, Freestyle::ImagePyramid::pixel(), Freestyle::GrayImage::setPixel(), w(), width(), Freestyle::ImagePyramid::width(), Freestyle::x, and y.
Referenced by Freestyle::ContextFunctions::LoadMapCF().
|
inline |
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 115 of file Canvas.cpp.
References update().
Referenced by Draw(), and Freestyle::AppCanvas::postDraw().
|
virtual |
Reimplemented in Freestyle::AppCanvas.
Definition at line 86 of file Canvas.cpp.
Referenced by Draw(), and Freestyle::AppCanvas::preDraw().
| void Freestyle::Canvas::PushBackStyleModule | ( | StyleModule * | iStyleModule | ) |
inserts a shader at pos index+1
Definition at line 170 of file Canvas.cpp.
References _Layers, and _StyleModules.
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::Functions0D::DensityF0D::operator()().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::Functions0D::LocalAverageDepthF0D::operator()().
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 452 of file Canvas.cpp.
References _maps, G, G_DEBUG_FREESTYLE, height(), Freestyle::ImagePyramid::height(), Freestyle::ImagePyramid::pixel(), and Freestyle::ImagePyramid::width().
Referenced by Freestyle::Functions0D::ReadMapPixelF0D::operator()(), and Freestyle::ContextFunctions::ReadMapPixelCF().
| void Freestyle::Canvas::RemoveStyleModule | ( | uint | index | ) |
Definition at line 190 of file Canvas.cpp.
References _Layers, and _StyleModules.
Referenced by Freestyle::Controller::RemoveStyleModule().
|
virtual |
Definition at line 285 of file Canvas.cpp.
References _Layers, and _StyleModules.
Referenced by Freestyle::Controller::RenderStrokes().
|
virtual |
Definition at line 295 of file Canvas.cpp.
References _Layers, and _StyleModules.
|
inline |
|
pure virtual |
Implemented in Freestyle::AppCanvas.
| void Freestyle::Canvas::ReplaceStyleModule | ( | uint | index, |
| StyleModule * | iStyleModule ) |
Definition at line 239 of file Canvas.cpp.
References _StyleModules.
Referenced by Freestyle::Controller::ReloadStyleModule().
| void Freestyle::Canvas::resetModified | ( | bool | iMod = false | ) |
Definition at line 266 of file Canvas.cpp.
References _StyleModules, setModified(), and size().
Referenced by Freestyle::Controller::resetModified().
Implemented in Freestyle::AppCanvas.
|
inline |
Definition at line 176 of file Canvas.h.
References _SelectedFEdge.
|
inline |
accessors
Definition at line 171 of file Canvas.h.
References _SelectedFEdge.
Referenced by Freestyle::ContextFunctions::GetSelectedFEdgeCF().
| void Freestyle::Canvas::setModified | ( | uint | index, |
| bool | iMod ) |
Definition at line 261 of file Canvas.cpp.
References _StyleModules.
Referenced by resetModified(), Freestyle::Controller::setModified(), and Freestyle::Controller::updateCausalStyleModules().
|
inline |
| void Freestyle::Canvas::setVisible | ( | uint | index, |
| bool | iVisible ) |
Definition at line 256 of file Canvas.cpp.
References _StyleModules, and Freestyle::StyleModule::setDisplayed().
Referenced by Freestyle::Controller::toggleLayer().
Definition at line 226 of file Canvas.cpp.
References _Layers, and _StyleModules.
Referenced by Freestyle::Controller::SwapStyleModules().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Erase(), and postDraw().
|
pure virtual |
Implemented in Freestyle::AppCanvas.
Referenced by Freestyle::ContextFunctions::GetCanvasWidthCF(), loadMap(), Freestyle::Functions0D::DensityF0D::operator()(), Freestyle::Functions0D::LocalAverageDepthF0D::operator()(), Freestyle::PSStrokeRenderer::PSStrokeRenderer(), and Freestyle::TextStrokeRenderer::TextStrokeRenderer().
|
protected |
Definition at line 76 of file Canvas.h.
Referenced by Canvas(), Canvas(), and Freestyle::AppCanvas::RenderStroke().
|
protected |
|
protected |
Definition at line 67 of file Canvas.h.
Referenced by AddLayer(), Clear(), Draw(), Erase(), InsertStyleModule(), isEmpty(), Freestyle::AppCanvas::postDraw(), PushBackStyleModule(), RemoveStyleModule(), Render(), RenderBasic(), and SwapStyleModules().
|
protected |
Definition at line 73 of file Canvas.h.
Referenced by loadMap(), readMapPixel(), and ~Canvas().
|
staticprotected |
Definition at line 74 of file Canvas.h.
Referenced by Freestyle::AppCanvas::AppCanvas(), and loadMap().
|
staticprotected |
|
protected |
Definition at line 71 of file Canvas.h.
Referenced by Canvas(), Canvas(), Freestyle::AppCanvas::init(), renderer(), Freestyle::AppCanvas::RenderStroke(), and ~Canvas().
|
protected |
Definition at line 69 of file Canvas.h.
Referenced by Canvas(), Canvas(), selectedFEdge(), selectedFEdge(), and setSelectedFEdge().
|
protected |
Definition at line 75 of file Canvas.h.
Referenced by Canvas(), Canvas(), Clear(), Erase(), getSteerableViewMap(), loadSteerableViewMap(), and ~Canvas().
|
protected |
Definition at line 68 of file Canvas.h.
Referenced by causalStyleModules(), Clear(), Draw(), InsertStyleModule(), Freestyle::AppCanvas::postDraw(), PushBackStyleModule(), RemoveStyleModule(), Render(), RenderBasic(), ReplaceStyleModule(), resetModified(), setModified(), setVisible(), and SwapStyleModules().
|
static |
Definition at line 63 of file Canvas.h.
Referenced by Canvas(), and Freestyle::Controller::ComputeSteerableViewMap().
|
protected |