]> git.sesse.net Git - casparcg/blob - core/mixer/image/image_kernel.cpp
2.0. Updated rendered and fixed some interlacing bugs.
[casparcg] / core / mixer / image / image_kernel.cpp
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\r
6 *    CasparCG is free software: you can redistribute it and/or modify\r
7 *    it under the terms of the GNU General Public License as published by\r
8 *    the Free Software Foundation, either version 3 of the License, or\r
9 *    (at your option) any later version.\r
10 *\r
11 *    CasparCG is distributed in the hope that it will be useful,\r
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 *    GNU General Public License for more details.\r
15 \r
16 *    You should have received a copy of the GNU General Public License\r
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 */\r
20 #include "../../stdafx.h"\r
21 \r
22 #include "image_kernel.h"\r
23 #include "blending_glsl.h"\r
24 #include "../gpu/shader.h"\r
25 #include "../gpu/device_buffer.h"\r
26 \r
27 #include <common/exception/exceptions.h>\r
28 #include <common/gl/gl_check.h>\r
29 \r
30 #include <core/video_format.h>\r
31 #include <core/producer/frame/pixel_format.h>\r
32 #include <core/producer/frame/image_transform.h>\r
33 \r
34 #include <boost/noncopyable.hpp>\r
35 \r
36 #include <unordered_map>\r
37 \r
38 namespace caspar { namespace core {\r
39         \r
40 GLubyte upper_pattern[] = {\r
41         0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,\r
42         0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,\r
43         0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,\r
44         0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00};\r
45                 \r
46 GLubyte lower_pattern[] = {\r
47         0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, \r
48         0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,\r
49         0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,\r
50         0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff};\r
51 \r
52 struct image_kernel::implementation : boost::noncopyable\r
53 {       \r
54         std::unique_ptr<shader> shader_;\r
55         \r
56         implementation()\r
57         {\r
58                 std::string vertex = \r
59                         "void main()                                                                                                                                            \n"\r
60                         "{                                                                                                                                                                      \n"\r
61                         "       gl_TexCoord[0] = gl_MultiTexCoord0;                                                                                             \n"\r
62                         "       gl_TexCoord[1] = gl_MultiTexCoord1;                                                                                             \n"\r
63                         "       gl_FrontColor  = gl_Color;                                                                                                              \n"\r
64                         "       gl_Position    = ftransform();                                                                                                  \n"\r
65                         "}                                                                                                                                                                      \n";\r
66 \r
67                 std::string fragment = std::string() +\r
68                         "#version 120                                                                                                                                           \n"\r
69                         "uniform sampler2D      background;                                                                                                             \n"\r
70                         "uniform sampler2D      plane[4];                                                                                                               \n"\r
71                         "uniform sampler2D      local_key;                                                                                                              \n"\r
72                         "uniform sampler2D      layer_key;                                                                                                              \n"\r
73                         "                                                                                                                                                                       \n"\r
74                         "uniform bool           is_hd;                                                                                                                  \n"\r
75                         "uniform bool           has_local_key;                                                                                                  \n"\r
76                         "uniform bool           has_layer_key;                                                                                                  \n"\r
77                         "uniform int            blend_mode;                                                                                                             \n"\r
78                         "uniform int            alpha_mode;                                                                                                             \n"\r
79                         "uniform int            pixel_format;                                                                                                   \n"\r
80                         "                                                                                                                                                                       \n"\r
81                         "uniform bool           levels;                                                                                                                 \n"\r
82                         "uniform float          min_input;                                                                                                              \n"\r
83                         "uniform float          max_input;                                                                                                              \n"\r
84                         "uniform float          gamma;                                                                                                                  \n"\r
85                         "uniform float          min_output;                                                                                                             \n"\r
86                         "uniform float          max_output;                                                                                                             \n"\r
87                         "                                                                                                                                                                       \n"\r
88                         "uniform bool           csb;                                                                                                                    \n"\r
89                         "uniform float          brt;                                                                                                                    \n"\r
90                         "uniform float          sat;                                                                                                                    \n"\r
91                         "uniform float          con;                                                                                                                    \n"\r
92                         "                                                                                                                                                                       \n"\r
93 \r
94                         +\r
95 \r
96                         get_blend_glsl()\r
97                         \r
98                         +\r
99 \r
100                         "vec3 get_blend_color(vec3 back, vec3 fore)                                                                                     \n"\r
101                         "{                                                                                                                                                                      \n"\r
102                         "       switch(blend_mode)                                                                                                                              \n"\r
103                         "       {                                                                                                                                                               \n"\r
104                         "       case  0: return BlendNormal(back, fore);                                                                                \n"\r
105                         "       case  1: return BlendLighten(back, fore);                                                                               \n"\r
106                         "       case  2: return BlendDarken(back, fore);                                                                                \n"\r
107                         "       case  3: return BlendMultiply(back, fore);                                                                              \n"\r
108                         "       case  4: return BlendAverage(back, fore);                                                                               \n"\r
109                         "       case  5: return BlendAdd(back, fore);                                                                                   \n"\r
110                         "       case  6: return BlendSubstract(back, fore);                                                                             \n"\r
111                         "       case  7: return BlendDifference(back, fore);                                                                    \n"\r
112                         "       case  8: return BlendNegation(back, fore);                                                                              \n"\r
113                         "       case  9: return BlendExclusion(back, fore);                                                                             \n"\r
114                         "       case 10: return BlendScreen(back, fore);                                                                                \n"\r
115                         "       case 11: return BlendOverlay(back, fore);                                                                               \n"\r
116                         //"     case 12: return BlendSoftLight(back, fore);                                                                             \n"\r
117                         "       case 13: return BlendHardLight(back, fore);                                                                             \n"\r
118                         "       case 14: return BlendColorDodge(back, fore);                                                                    \n"\r
119                         "       case 15: return BlendColorBurn(back, fore);                                                                             \n"\r
120                         "       case 16: return BlendLinearDodge(back, fore);                                                                   \n"\r
121                         "       case 17: return BlendLinearBurn(back, fore);                                                                    \n"\r
122                         "       case 18: return BlendLinearLight(back, fore);                                                                   \n"\r
123                         "       case 19: return BlendVividLight(back, fore);                                                                    \n"\r
124                         "       case 20: return BlendPinLight(back, fore);                                                                              \n"\r
125                         "       case 21: return BlendHardMix(back, fore);                                                                               \n"\r
126                         "       case 22: return BlendReflect(back, fore);                                                                               \n"\r
127                         "       case 23: return BlendGlow(back, fore);                                                                                  \n"\r
128                         "       case 24: return BlendPhoenix(back, fore);                                                                               \n"\r
129                         "       case 25: return BlendHue(back, fore);                                                                                   \n"\r
130                         "       case 26: return BlendSaturation(back, fore);                                                                    \n"\r
131                         "       case 27: return BlendColor(back, fore);                                                                                 \n"\r
132                         "       case 28: return BlendLuminosity(back, fore);                                                                    \n"\r
133                         "       }                                                                                                                                                               \n"\r
134                         "                                                                                                                                                                       \n"\r
135                         "       return BlendNormal(back, fore);                                                                                                 \n"\r
136                         "}                                                                                                                                                                      \n"\r
137                         "                                                                                                                                                                       \n"                                                                                                                                                       \r
138                         "vec4 blend_color(vec4 fore)                                                                                                            \n"\r
139                         "{                                                                                                                                                                      \n"\r
140                         "   vec4 back = texture2D(background, gl_TexCoord[1].st);                                                       \n"\r
141                         "   if(levels)                                                                                                                                          \n"\r
142                         "               fore.rgb = LevelsControl(fore.rgb, min_input, max_input, gamma, min_output, max_output); \n"\r
143                         "       if(csb)                                                                                                                                                 \n"\r
144                         "               fore.rgb = ContrastSaturationBrightness(fore.rgb, brt, sat, con);                       \n"\r
145                         "   fore.rgb = get_blend_color(back.bgr, fore.rgb);                                                                     \n"\r
146                         "                                                                                                                                                                       \n"\r
147                         "       return vec4(mix(back.rgb, fore.rgb, fore.a), back.a + fore.a);                                  \n"\r
148                         "}                                                                                                                                                                      \n"\r
149                         "                                                                                                                                                                       \n"\r
150                         "// NOTE: YCbCr, ITU-R, http://www.intersil.com/data/an/an9717.pdf                                      \n"\r
151                         "// TODO: Support for more yuv formats might be needed.                                                         \n"\r
152                         "vec4 ycbcra_to_rgba_sd(float y, float cb, float cr, float a)                                           \n"\r
153                         "{                                                                                                                                                                      \n"\r
154                         "       cb -= 0.5;                                                                                                                                              \n"\r
155                         "       cr -= 0.5;                                                                                                                                              \n"\r
156                         "       y = 1.164*(y-0.0625);                                                                                                                   \n"\r
157                         "                                                                                                                                                                       \n"\r
158                         "       vec4 color;                                                                                                                                             \n"\r
159                         "       color.r = y + 2.018 * cb;                                                                                                               \n"\r
160                         "       color.b = y + 1.596 * cr;                                                                                                               \n"\r
161                         "       color.g = y - 0.813 * cr - 0.391 * cb;                                                                                  \n"\r
162                         "       color.a = a;                                                                                                                                    \n"\r
163                         "                                                                                                                                                                       \n"\r
164                         "       return color;                                                                                                                                   \n"\r
165                         "}                                                                                                                                                                      \n"                     \r
166                         "                                                                                                                                                                       \n"\r
167                         "vec4 ycbcra_to_rgba_hd(float y, float cb, float cr, float a)                                           \n"\r
168                         "{                                                                                                                                                                      \n"\r
169                         "       cb -= 0.5;                                                                                                                                              \n"\r
170                         "       cr -= 0.5;                                                                                                                                              \n"\r
171                         "       y = 1.164*(y-0.0625);                                                                                                                   \n"\r
172                         "                                                                                                                                                                       \n"\r
173                         "       vec4 color;                                                                                                                                             \n"\r
174                         "       color.r = y + 2.115 * cb;                                                                                                               \n"\r
175                         "       color.b = y + 1.793 * cr;                                                                                                               \n"\r
176                         "       color.g = y - 0.534 * cr - 0.213 * cb;                                                                                  \n"\r
177                         "       color.a = a;                                                                                                                                    \n"\r
178                         "                                                                                                                                                                       \n"\r
179                         "       return color;                                                                                                                                   \n"\r
180                         "}                                                                                                                                                                      \n"                     \r
181                         "                                                                                                                                                                       \n"                     \r
182                         "vec4 ycbcra_to_rgba(float y, float cb, float cr, float a)                                                      \n"\r
183                         "{                                                                                                                                                                      \n"\r
184                         "       if(is_hd)                                                                                                                                               \n"\r
185                         "               return ycbcra_to_rgba_hd(y, cb, cr, a);                                                                         \n"\r
186                         "       else                                                                                                                                                    \n"\r
187                         "               return ycbcra_to_rgba_sd(y, cb, cr, a);                                                                         \n"\r
188                         "}                                                                                                                                                                      \n"\r
189                         "                                                                                                                                                                       \n"\r
190                         "vec4 get_rgba_color()                                                                                                                          \n"\r
191                         "{                                                                                                                                                                      \n"\r
192                         "       switch(pixel_format)                                                                                                                    \n"\r
193                         "       {                                                                                                                                                               \n"\r
194                         "       case 0:         //gray                                                                                                                          \n"\r
195                         "               return vec4(texture2D(plane[0], gl_TexCoord[0].st).rrr, 1.0);                           \n"\r
196                         "       case 1:         //bgra,                                                                                                                         \n"\r
197                         "               return texture2D(plane[0], gl_TexCoord[0].st).bgra;                                                     \n"\r
198                         "       case 2:         //rgba,                                                                                                                         \n"\r
199                         "               return texture2D(plane[0], gl_TexCoord[0].st).rgba;                                                     \n"\r
200                         "       case 3:         //argb,                                                                                                                         \n"\r
201                         "               return texture2D(plane[0], gl_TexCoord[0].st).argb;                                                     \n"\r
202                         "       case 4:         //abgr,                                                                                                                         \n"\r
203                         "               return texture2D(plane[0], gl_TexCoord[0].st).gbar;                                                     \n"\r
204                         "       case 5:         //ycbcr,                                                                                                                        \n"\r
205                         "               {                                                                                                                                                       \n"\r
206                         "                       float y  = texture2D(plane[0], gl_TexCoord[0].st).r;                                    \n"\r
207                         "                       float cb = texture2D(plane[1], gl_TexCoord[0].st).r;                                    \n"\r
208                         "                       float cr = texture2D(plane[2], gl_TexCoord[0].st).r;                                    \n"\r
209                         "                       return ycbcra_to_rgba(y, cb, cr, 1.0);                                                                  \n"\r
210                         "               }                                                                                                                                                       \n"\r
211                         "       case 6:         //ycbcra                                                                                                                        \n"\r
212                         "               {                                                                                                                                                       \n"\r
213                         "                       float y  = texture2D(plane[0], gl_TexCoord[0].st).r;                                    \n"\r
214                         "                       float cb = texture2D(plane[1], gl_TexCoord[0].st).r;                                    \n"\r
215                         "                       float cr = texture2D(plane[2], gl_TexCoord[0].st).r;                                    \n"\r
216                         "                       float a  = texture2D(plane[3], gl_TexCoord[0].st).r;                                    \n"\r
217                         "                       return ycbcra_to_rgba(y, cb, cr, a);                                                                    \n"\r
218                         "               }                                                                                                                                                       \n"\r
219                         "       }                                                                                                                                                               \n"\r
220                         "       return vec4(0.0, 0.0, 0.0, 0.0);                                                                                                \n"\r
221                         "}                                                                                                                                                                      \n"\r
222                         "                                                                                                                                                                       \n"\r
223                         "void main()                                                                                                                                            \n"\r
224                         "{                                                                                                                                                                      \n"\r
225                         "       vec4 color = get_rgba_color();                                                                                                  \n"\r
226                         "       if(has_local_key)                                                                                                                               \n"\r
227                         "               color.a *= texture2D(local_key, gl_TexCoord[1].st).r;                                           \n"\r
228                         "       if(has_layer_key)                                                                                                                               \n"\r
229                         "               color.a *= texture2D(layer_key, gl_TexCoord[1].st).r;                                           \n"\r
230                         "       gl_FragColor = blend_color(color.bgra * gl_Color);                                                              \n"\r
231                         "}                                                                                                                                                                      \n"\r
232                         ;\r
233 \r
234                         shader_.reset(new shader(vertex, fragment));\r
235         }\r
236 \r
237         \r
238         void draw(size_t                                                                                width, \r
239                           size_t                                                                                height, \r
240                           const core::pixel_format_desc&                                pix_desc, \r
241                           const core::image_transform&                                  transform,\r
242                           core::video_mode::type                                                mode, \r
243                           const std::vector<safe_ptr<device_buffer>>&   planes, \r
244                           const safe_ptr<device_buffer>&                                background,\r
245                           const std::shared_ptr<device_buffer>&                 local_key,                        \r
246                           const std::shared_ptr<device_buffer>&                 layer_key)\r
247         {\r
248                 if(planes.empty())\r
249                         return;\r
250 \r
251                 GL(glEnable(GL_TEXTURE_2D));\r
252                 GL(glEnable(GL_POLYGON_STIPPLE));\r
253                         \r
254                 if(mode == core::video_mode::upper)\r
255                         glPolygonStipple(upper_pattern);\r
256                 else if(mode == core::video_mode::lower)\r
257                         glPolygonStipple(lower_pattern);\r
258                 else\r
259                         GL(glDisable(GL_POLYGON_STIPPLE));\r
260 \r
261                 // Bind textures\r
262 \r
263                 for(size_t n = 0; n < planes.size(); ++n)\r
264                         planes[n]->bind(n);\r
265 \r
266                 if(local_key)\r
267                         local_key->bind(4);\r
268                 \r
269                 if(layer_key)\r
270                         layer_key->bind(5);\r
271 \r
272                 background->bind(6);\r
273 \r
274                 // Setup shader\r
275 \r
276                 shader_->use(); \r
277 \r
278                 shader_->set("plane[0]",                0);\r
279                 shader_->set("plane[1]",                1);\r
280                 shader_->set("plane[2]",                2);\r
281                 shader_->set("plane[3]",                3);\r
282                 shader_->set("local_key",               4);\r
283                 shader_->set("layer_key",               5);\r
284                 shader_->set("background",              6);\r
285                 shader_->set("is_hd",                   pix_desc.planes.at(0).height > 700 ? 1 : 0);\r
286                 shader_->set("has_local_key",   local_key ? 1 : 0);\r
287                 shader_->set("has_layer_key",   layer_key ? 1 : 0);\r
288                 shader_->set("blend_mode",              transform.get_is_key() ? core::image_transform::blend_mode::normal : transform.get_blend_mode());\r
289                 shader_->set("alpha_mode",              transform.get_alpha_mode());\r
290                 shader_->set("pixel_format",    pix_desc.pix_fmt);      \r
291 \r
292                 auto levels = transform.get_levels();\r
293 \r
294                 if(levels.min_input  > 0.001 ||\r
295                    levels.max_input  < 0.999 ||\r
296                    levels.min_output > 0.001 ||\r
297                    levels.max_output < 0.999 ||\r
298                    std::abs(levels.gamma - 1.0) > 0.001)\r
299                 {\r
300                         shader_->set("levels", true);   \r
301                         shader_->set("min_input", levels.min_input);    \r
302                         shader_->set("max_input", levels.max_input);\r
303                         shader_->set("min_output", levels.min_output);\r
304                         shader_->set("max_output", levels.max_output);\r
305                         shader_->set("gamma", levels.gamma);\r
306                 }\r
307                 else\r
308                         shader_->set("levels", false);  \r
309 \r
310                 if(std::abs(transform.get_brightness() - 1.0) > 0.001 ||\r
311                    std::abs(transform.get_saturation() - 1.0) > 0.001 ||\r
312                    std::abs(transform.get_contrast() - 1.0) > 0.001)\r
313                 {\r
314                         shader_->set("csb",     true);  \r
315                         \r
316                         shader_->set("brt", transform.get_brightness());        \r
317                         shader_->set("sat", transform.get_saturation());\r
318                         shader_->set("con", transform.get_contrast());\r
319                 }\r
320                 else\r
321                         shader_->set("csb",     false); \r
322                 \r
323                 // Setup drawing area\r
324 \r
325                 GL(glColor4d(transform.get_gain(), transform.get_gain(), transform.get_gain(), transform.get_opacity()));\r
326                 GL(glViewport(0, 0, width, height));\r
327                                                 \r
328                 auto m_p = transform.get_clip_translation();\r
329                 auto m_s = transform.get_clip_scale();\r
330                 double w = static_cast<double>(width);\r
331                 double h = static_cast<double>(height);\r
332 \r
333                 GL(glEnable(GL_SCISSOR_TEST));\r
334                 GL(glScissor(static_cast<size_t>(m_p[0]*w), static_cast<size_t>(m_p[1]*h), static_cast<size_t>(m_s[0]*w), static_cast<size_t>(m_s[1]*h)));\r
335                         \r
336                 auto f_p = transform.get_fill_translation();\r
337                 auto f_s = transform.get_fill_scale();\r
338                 \r
339                 // Draw\r
340 \r
341                 glBegin(GL_QUADS);\r
342                         glMultiTexCoord2d(GL_TEXTURE0, 0.0, 0.0); glMultiTexCoord2d(GL_TEXTURE1,  f_p[0]        ,  f_p[1]        );             glVertex2d( f_p[0]        *2.0-1.0,  f_p[1]        *2.0-1.0);\r
343                         glMultiTexCoord2d(GL_TEXTURE0, 1.0, 0.0); glMultiTexCoord2d(GL_TEXTURE1, (f_p[0]+f_s[0]),  f_p[1]        );             glVertex2d((f_p[0]+f_s[0])*2.0-1.0,  f_p[1]        *2.0-1.0);\r
344                         glMultiTexCoord2d(GL_TEXTURE0, 1.0, 1.0); glMultiTexCoord2d(GL_TEXTURE1, (f_p[0]+f_s[0]), (f_p[1]+f_s[1]));             glVertex2d((f_p[0]+f_s[0])*2.0-1.0, (f_p[1]+f_s[1])*2.0-1.0);\r
345                         glMultiTexCoord2d(GL_TEXTURE0, 0.0, 1.0); glMultiTexCoord2d(GL_TEXTURE1,  f_p[0]        , (f_p[1]+f_s[1]));             glVertex2d( f_p[0]        *2.0-1.0, (f_p[1]+f_s[1])*2.0-1.0);\r
346                 glEnd();\r
347 \r
348                 GL(glDisable(GL_SCISSOR_TEST)); \r
349                 GL(glDisable(GL_POLYGON_STIPPLE));\r
350         }\r
351 };\r
352 \r
353 image_kernel::image_kernel() : impl_(new implementation()){}\r
354 \r
355 void image_kernel::draw(size_t width, size_t height, const core::pixel_format_desc& pix_desc, const core::image_transform& transform, core::video_mode::type mode, const std::vector<safe_ptr<device_buffer>>& planes, \r
356                                                           const safe_ptr<device_buffer>& background, const std::shared_ptr<device_buffer>& local_key, const std::shared_ptr<device_buffer>& layer_key)\r
357 {\r
358         impl_->draw(width, height, pix_desc, transform, mode, planes, background, local_key, layer_key);\r
359 }\r
360 \r
361 }}