Blender V4.3
ImagePyramid.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include <vector>
13
15
16#ifdef WITH_CXX_GUARDEDALLOC
17# include "MEM_guardedalloc.h"
18#endif
19
20namespace Freestyle {
21
22class GrayImage;
23
25 protected:
26 std::vector<GrayImage *> _levels;
27
28 public:
30 ImagePyramid(const ImagePyramid &iBrother);
31 // ImagePyramid(const GrayImage& level0, uint nbLevels);
32 virtual ~ImagePyramid();
33
38 virtual void BuildPyramid(const GrayImage &level0, uint nbLevels) = 0;
39
41 virtual void BuildPyramid(GrayImage *level0, uint 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
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, uint nbLevels, float iSigma = 1.0f);
82 GaussianPyramid(GrayImage *level0, uint nbLevels, float iSigma = 1.0f);
83 GaussianPyramid(const GaussianPyramid &iBrother);
84 virtual ~GaussianPyramid() {}
85
86 virtual void BuildPyramid(const GrayImage &level0, uint nbLevels);
87 virtual void BuildPyramid(GrayImage *level0, uint nbLevels);
88
89 /* accessors */
90 inline float getSigma() const
91 {
92 return _sigma;
93 }
94
95 /* modifiers */
96};
97
98} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
virtual void BuildPyramid(const GrayImage &level0, uint nbLevels)
GaussianPyramid(float iSigma=1.0f)
virtual void BuildPyramid(GrayImage *level0, uint nbLevels)=0
virtual float pixel(int x, int y, int level=0)
virtual GrayImage * getLevel(int l)
int getNumberOfLevels() const
virtual int height(int level=0)
virtual int width(int level=0)
virtual void BuildPyramid(const GrayImage &level0, uint nbLevels)=0
std::vector< GrayImage * > _levels
inherits from class Rep
Definition AppCanvas.cpp:20