Blender  V3.3
AppCanvas.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
9 #include "../stroke/Canvas.h"
10 #include "AppView.h"
11 
12 namespace Freestyle {
13 
14 class AppCanvas : public Canvas {
15  public:
16  AppCanvas();
17  AppCanvas(AppView *iViewer);
18  AppCanvas(const AppCanvas &iBrother);
19  virtual ~AppCanvas();
20 
22  virtual void preDraw();
23 
25  virtual void postDraw();
26 
28  virtual void Erase();
29 
30  /* init the canvas */
31  virtual void init();
32 
34  virtual void readColorPixels(int x, int y, int w, int h, RGBImage &oImage) const;
36  virtual void readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) const;
37 
38  virtual BBox<Vec3r> scene3DBBox() const;
39 
40  /* abstract */
41  virtual void RenderStroke(Stroke *);
42  virtual void update();
43 
45  virtual int width() const;
46  virtual int height() const;
47  virtual BBox<Vec2i> border() const;
48  virtual float thickness() const;
49 
51  inline const AppView *viewer() const
52  {
53  return _pViewer;
54  }
55 
57  void setViewer(AppView *iViewer);
58 
59  /* soc */
60  void setPassDiffuse(float *buf, int width, int height)
61  {
62  _pass_diffuse.buf = buf;
63  _pass_diffuse.width = width;
64  _pass_diffuse.height = height;
65  }
66  void setPassZ(float *buf, int width, int height)
67  {
68  _pass_z.buf = buf;
69  _pass_z.width = width;
70  _pass_z.height = height;
71  }
72 
73  private:
74  struct {
75  float *buf;
76  int width, height;
77  } _pass_diffuse, _pass_z;
78 };
79 
80 } /* 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:157
virtual BBox< Vec2i > border() const
Definition: AppCanvas.cpp:56
void setViewer(AppView *iViewer)
Definition: AppCanvas.cpp:41
virtual void Erase()
Definition: AppCanvas.cpp:101
virtual void RenderStroke(Stroke *)
Definition: AppCanvas.cpp:206
virtual void preDraw()
Definition: AppCanvas.cpp:71
void setPassZ(float *buf, int width, int height)
Definition: AppCanvas.h:66
virtual BBox< Vec3r > scene3DBBox() const
Definition: AppCanvas.cpp:66
virtual void postDraw()
Definition: AppCanvas.cpp:90
virtual int height() const
void setPassDiffuse(float *buf, int width, int height)
Definition: AppCanvas.h:60
virtual void readColorPixels(int x, int y, int w, int h, RGBImage &oImage) const
Definition: AppCanvas.cpp:108
virtual float thickness() const
Definition: AppCanvas.cpp:61
virtual int width() const
virtual void init()
Definition: AppCanvas.cpp:76
const AppView * viewer() const
Definition: AppCanvas.h:51
virtual void update()
Definition: AppCanvas.cpp:216
AppView * _pViewer
Definition: AppCanvas.h:50
virtual ~AppCanvas()
Definition: AppCanvas.cpp:36
inherits from class Rep
Definition: AppCanvas.cpp:18
static unsigned x[3]
Definition: RandGen.cpp:73