Blender V5.0
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
11
12#include <vector>
13
15
16#include "MEM_guardedalloc.h"
17
18namespace Freestyle {
19
20class GrayImage;
21
23 protected:
24 std::vector<GrayImage *> _levels;
25
26 public:
28 ImagePyramid(const ImagePyramid &iBrother);
29 // ImagePyramid(const GrayImage& level0, uint nbLevels);
30 virtual ~ImagePyramid();
31
36 virtual void BuildPyramid(const GrayImage &level0, uint nbLevels) = 0;
37
39 virtual void BuildPyramid(GrayImage *level0, uint nbLevels) = 0;
40
41 virtual GrayImage *getLevel(int l);
50 virtual float pixel(int x, int y, int level = 0);
51
53 virtual int width(int level = 0);
54
56 virtual int height(int level = 0);
57
59 inline int getNumberOfLevels() const
60 {
61 return _levels.size();
62 }
63
64 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:ImagePyramid")
65};
66
68 protected:
69 float _sigma;
70
71 public:
72 GaussianPyramid(float iSigma = 1.0f) : ImagePyramid()
73 {
74 _sigma = iSigma;
75 }
76
77 GaussianPyramid(const GrayImage &level0, uint nbLevels, float iSigma = 1.0f);
78 GaussianPyramid(GrayImage *level0, uint nbLevels, float iSigma = 1.0f);
79 GaussianPyramid(const GaussianPyramid &iBrother);
80 virtual ~GaussianPyramid() {}
81
82 virtual void BuildPyramid(const GrayImage &level0, uint nbLevels);
83 virtual void BuildPyramid(GrayImage *level0, uint nbLevels);
84
85 /* accessors */
86 inline float getSigma() const
87 {
88 return _sigma;
89 }
90
91 /* modifiers */
92};
93
94} /* 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
static uint x[3]
Definition RandGen.cpp:77