| 1 | /* |
| 2 | This frei0r plugin generates solid color images |
| 3 | |
| 4 | Copyright (C) 2004, 2005 Martin Bayer <[email protected]> |
| 5 | |
| 6 | This library is free software; you can redistribute it and/or |
| 7 | modify it under the terms of the GNU Lesser General Public |
| 8 | License as published by the Free Software Foundation; either |
| 9 | version 2.1 of the License, or (at your option) any later version. |
| 10 | |
| 11 | This library 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 GNU |
| 14 | Lesser General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU Lesser General Public |
| 17 | License along with this library; if not, write to the Free Software |
| 18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #include "frei0r.hpp"cxx . . $ `<file>/include/frei0r.hpp`/ |
| 22 | |
| 23 | #include <algorithm> |
| 24 | |
| 25 | class onecol0rcxx . . $ onecol0r# : public frei0rcxx . . $ frei0r/::sourcecxx . . $ frei0r/source# |
| 26 | { |
| 27 | public: |
| 28 | onecol0rcxx . . $ onecol0r#onecol0r(b4d55b1286ff73e8).(unsigned int width, unsigned int height) |
| 29 | { |
| 30 | register_paramcxx . . $ frei0r/fx#register_param(82eda48613cf5a7a).(colorcxx . . $ onecol0r#color.,"Color"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,"the color of the image"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 31 | colorcxx . . $ onecol0r#color..r = colorcxx . . $ onecol0r#color..g = colorcxx . . $ onecol0r#color..b = 0; |
| 32 | } |
| 33 | |
| 34 | virtual void updatecxx . . $ onecol0r#update(c707e0475ee5518c).(double time, |
| 35 | uint32_t* out) |
| 36 | { |
| 37 | unsigned int col; |
| 38 | unsigned char* c = reinterpret_cast<unsigned char*>(&col); |
| 39 | |
| 40 | c[0]=static_cast<unsigned char>(colorcxx . . $ onecol0r#color..b*255); |
| 41 | c[1]=static_cast<unsigned char>(colorcxx . . $ onecol0r#color..g*255); |
| 42 | c[2]=static_cast<unsigned char>(colorcxx . . $ onecol0r#color..r*255); |
| 43 | c[3]=255; |
| 44 | |
| 45 | stdcxx . . $ std/::fillcxx . . $ std/fill(4a9bfaed88eccda7).(out, out+widthcxx . . $ frei0r/fx#width.*heightcxx . . $ frei0r/fx#height., col); |
| 46 | } |
| 47 | |
| 48 | private: |
| 49 | f0r_param_color colorcxx . . $ onecol0r#color.; |
| 50 | }; |
| 51 | |
| 52 | |
| 53 | frei0rcxx . . $ frei0r/::constructcxx . . $ frei0r/construct#<onecol0rcxx . . $ onecol0r#> plugincxx . . $ plugin.("onecol0r"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 54 | "image with just one color"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 55 | "Martin Bayer"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., |
| 56 | 0,3); |
| 57 |