Debian Codegraph @

src/mixer2/value/value.cpp

raw symbols SCIP
1 /* value.cpp
2 * Copyright (C) 2006 Jean-Sebastien Senecal ([email protected])
3 * This file is a Frei0r plugin.
4 * The code is a modified version of code from the Gimp.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #include "frei0r.hpp"cxx . . $ `<file>/include/frei0r.hpp`/
22 #include "frei0r/math.h"cxx . . $ `<file>/include/frei0r/math.h`/
23 #include "frei0r/colorspace.h"cxx . . $ `<file>/include/frei0r/colorspace.h`/
24
25 #define NBYTEScxx . . $ `src/mixer2/value/value.cpp:25:9`! 4
26
27 class valuecxx . . $ value# : public frei0rcxx . . $ frei0r/::mixer2cxx . . $ frei0r/mixer2#
28 {
29 public:
30 valuecxx . . $ value#value(b4d55b1286ff73e8).(unsigned int width, unsigned int height)
31 {
32 }
33
34 /**
35 *
36 * Perform a conversion to value only of the source in1 using
37 * the value of in2.
38 *
39 **/
40 void updatecxx . . $ value#update(aea6c563decfb03a).(double time,
41 uint32_t* out,
42 const uint32_t* in1,
43 const uint32_t* in2)
44 {
45 const uint8_t *src1 = reinterpret_cast<const uint8_t*>(in1);
46 const uint8_t *src2 = reinterpret_cast<const uint8_t*>(in2);
47 uint8_t *dst = reinterpret_cast<uint8_t*>(out);
48 uint32_t sizeCounter = sizecxx . . $ frei0r/fx#size.;
49 int r1, g1, b1;
50 int r2, g2, b2;
51
52 /* assumes inputs are only 4 byte RGBA pixels */
53 /* assumes inputs are only 4 byte RGBA pixels */
54 while (sizeCounter--)
55 {
56 r1 = src1[0];
57 g1 = src1[1];
58 b1 = src1[2];
59 r2 = src2[0];
60 g2 = src2[1];
61 b2 = src2[2];
62 rgb_to_hsv_intcxx . . $ rgb_to_hsv_int(9bece3db80ddac65).(&r1, &g1, &b1);
63 rgb_to_hsv_intcxx . . $ rgb_to_hsv_int(9bece3db80ddac65).(&r2, &g2, &b2);
64
65 b1 = b2;
66
67 /* set the destination */
68 hsv_to_rgb_intcxx . . $ hsv_to_rgb_int(9bece3db80ddac65).(&r1, &g1, &b1);
69
70 dst[0] = r1;
71 dst[1] = g1;
72 dst[2] = b1;
73
74 dst[3] = MINcxx . . $ `include/frei0r/math.h:67:9`!(src1[3], src2[3]);
75
76 src1 += NBYTEScxx . . $ `src/mixer2/value/value.cpp:25:9`!;
77 src2 += NBYTEScxx . . $ `src/mixer2/value/value.cpp:25:9`!;
78 dst += NBYTEScxx . . $ `src/mixer2/value/value.cpp:25:9`!;
79 }
80 }
81
82
83 };
84
85
86 frei0rcxx . . $ frei0r/::constructcxx . . $ frei0r/construct#<valuecxx . . $ value#> plugincxx . . $ plugin.("value"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
87 "Perform a conversion to value only of the source input1 using the value of input2."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
88 "Jean-Sebastien Senecal"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
89 0,2,
90 F0R_COLOR_MODEL_RGBA8888cxx . . $ `include/frei0r.h:308:9`!);
91