Blender  V2.93
AppCanvas.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
23 #include "../stroke/Canvas.h"
24 #include "AppView.h"
25 
26 namespace Freestyle {
27 
28 class AppCanvas : public Canvas {
29  public:
30  AppCanvas();
31  AppCanvas(AppView *iViewer);
32  AppCanvas(const AppCanvas &iBrother);
33  virtual ~AppCanvas();
34 
36  virtual void preDraw();
37 
39  virtual void postDraw();
40 
42  virtual void Erase();
43 
44  /* init the canvas */
45  virtual void init();
46 
48  virtual void readColorPixels(int x, int y, int w, int h, RGBImage &oImage) const;
50  virtual void readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) const;
51 
52  virtual BBox<Vec3r> scene3DBBox() const;
53 
54  /* abstract */
55  virtual void RenderStroke(Stroke *);
56  virtual void update();
57 
59  virtual int width() const;
60  virtual int height() const;
61  virtual BBox<Vec2i> border() const;
62  virtual float thickness() const;
63 
65  inline const AppView *viewer() const
66  {
67  return _pViewer;
68  }
69 
71  void setViewer(AppView *iViewer);
72 
73  /* soc */
74  void setPassDiffuse(float *buf, int width, int height)
75  {
76  _pass_diffuse.buf = buf;
77  _pass_diffuse.width = width;
78  _pass_diffuse.height = height;
79  }
80  void setPassZ(float *buf, int width, int height)
81  {
82  _pass_z.buf = buf;
83  _pass_z.width = width;
84  _pass_z.height = height;
85  }
86 
87  private:
88  struct {
89  float *buf;
90  int width, height;
91  } _pass_diffuse, _pass_z;
92 };
93 
94 } /* namespace Freestyle */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
virtual void readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) const
Definition: AppCanvas.cpp:171
virtual BBox< Vec2i > border() const
Definition: AppCanvas.cpp:70
void setViewer(AppView *iViewer)
Definition: AppCanvas.cpp:55
virtual void Erase()
Definition: AppCanvas.cpp:115
virtual void RenderStroke(Stroke *)
Definition: AppCanvas.cpp:220
virtual void preDraw()
Definition: AppCanvas.cpp:85
void setPassZ(float *buf, int width, int height)
Definition: AppCanvas.h:80
virtual BBox< Vec3r > scene3DBBox() const
Definition: AppCanvas.cpp:80
virtual void postDraw()
Definition: AppCanvas.cpp:104
virtual int height() const
void setPassDiffuse(float *buf, int width, int height)
Definition: AppCanvas.h:74
virtual void readColorPixels(int x, int y, int w, int h, RGBImage &oImage) const
Definition: AppCanvas.cpp:122
virtual float thickness() const
Definition: AppCanvas.cpp:75
virtual int width() const
virtual void init()
Definition: AppCanvas.cpp:90
const AppView * viewer() const
Definition: AppCanvas.h:65
virtual void update()
Definition: AppCanvas.cpp:230
AppView * _pViewer
Definition: AppCanvas.h:64
virtual ~AppCanvas()
Definition: AppCanvas.cpp:50
inherits from class Rep
Definition: AppCanvas.cpp:32
static unsigned x[3]
Definition: RandGen.cpp:87