Debian Codegraph @

modules/lsp-runtime-lib/src/main/mm/IColorMap.cpp

raw
1 /*
2 * Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2026 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 25 янв. 2026 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #include <lsp-plug.in/mm/IColorMap.h>
23
24 namespace lsp
25 {
26 namespace mm
27 {
28 IColorMap::IColorMap()
29 {
30 }
31
32 IColorMap::~IColorMap()
33 {
34 vNested.flush();
35 }
36
37 bool IColorMap::resolve(Color & c, const char *name) const noexcept
38 {
39 if (name == NULL)
40 return false;
41
42 for (lltl::iterator<const IColorMap> it = vNested.values(); it; ++it)
43 {
44 const IColorMap *map = it.get();
45 if ((map != NULL) && (map->resolve(c, name)))
46 return true;
47 }
48 return false;
49 }
50
51 bool IColorMap::resolve(Color & c, const LSPString & name) const noexcept
52 {
53 for (lltl::iterator<const IColorMap> it = vNested.values(); it; ++it)
54 {
55 const IColorMap *map = it.get();
56 if ((map != NULL) && (map->resolve(c, name)))
57 return true;
58 }
59 return false;
60 }
61
62 } /* namespace mm */
63 } /* namespace lsp */