Blender  V3.3
ImagePyramid.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include <vector>
11 
12 #include "../system/FreestyleConfig.h"
13 
14 #ifdef WITH_CXX_GUARDEDALLOC
15 # include "MEM_guardedalloc.h"
16 #endif
17 
18 namespace Freestyle {
19 
20 class GrayImage;
21 
22 class ImagePyramid {
23  protected:
24  std::vector<GrayImage *> _levels;
25 
26  public:
28  {
29  }
30  ImagePyramid(const ImagePyramid &iBrother);
31  // ImagePyramid(const GrayImage& level0, unsigned nbLevels);
32  virtual ~ImagePyramid();
33 
38  virtual void BuildPyramid(const GrayImage &level0, unsigned nbLevels) = 0;
39 
41  virtual void BuildPyramid(GrayImage *level0, unsigned nbLevels) = 0;
42 
43  virtual GrayImage *getLevel(int l);
52  virtual float pixel(int x, int y, int level = 0);
53 
55  virtual int width(int level = 0);
56 
58  virtual int height(int level = 0);
59 
61  inline int getNumberOfLevels() const
62  {
63  return _levels.size();
64  }
65 
66 #ifdef WITH_CXX_GUARDEDALLOC
67  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:ImagePyramid")
68 #endif
69 };
70 
71 class GaussianPyramid : public ImagePyramid {
72  protected:
73  float _sigma;
74 
75  public:
76  GaussianPyramid(float iSigma = 1.0f) : ImagePyramid()
77  {
78  _sigma = iSigma;
79  }
80 
81  GaussianPyramid(const GrayImage &level0, unsigned nbLevels, float iSigma = 1.0f);
82  GaussianPyramid(GrayImage *level0, unsigned nbLevels, float iSigma = 1.0f);
83  GaussianPyramid(const GaussianPyramid &iBrother);
84  virtual ~GaussianPyramid()
85  {
86  }
87 
88  virtual void BuildPyramid(const GrayImage &level0, unsigned nbLevels);
89  virtual void BuildPyramid(GrayImage *level0, unsigned nbLevels);
90 
91  /* accessors */
92  inline float getSigma() const
93  {
94  return _sigma;
95  }
96 
97  /* modifiers */
98 };
99 
100 } /* 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
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
virtual void BuildPyramid(const GrayImage &level0, unsigned nbLevels)
GaussianPyramid(float iSigma=1.0f)
Definition: ImagePyramid.h:76
virtual float pixel(int x, int y, int level=0)
virtual GrayImage * getLevel(int l)
virtual void BuildPyramid(const GrayImage &level0, unsigned nbLevels)=0
int getNumberOfLevels() const
Definition: ImagePyramid.h:61
virtual int height(int level=0)
virtual int width(int level=0)
std::vector< GrayImage * > _levels
Definition: ImagePyramid.h:24
virtual void BuildPyramid(GrayImage *level0, unsigned nbLevels)=0
inherits from class Rep
Definition: AppCanvas.cpp:18
static unsigned x[3]
Definition: RandGen.cpp:73