Debian Codegraph @

src/generator/test_pat/test_pat_B.c

raw symbols SCIP
1 /*
2 test_pat_B
3 This frei0r plugin generates TV test card approximations
4 Version 0.1 may 2010
5
6 Copyright (C) 2010 Marko Cebokli http://lea.hamradio.si/~s57uuu
7
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23 */
24
25 /***********************************************************
26 Test patterns: Broadcast test cards
27
28 This plugin draws a set of test patterns, similar to popular
29 TV test cards
30
31 The patterns are drawn into a temporary float array, for two reasons:
32 1. drawing routines are color model independent,
33 2. drawing is done only when a parameter changes.
34
35 only the function floatrgba2color()
36 needs to care about color models, endianness, DV legality etc.
37
38 *************************************************************/
39
40 //compile: gcc -Wall -c -fPIC test_pat_B.c -o test_pat_B.o
41
42 //link: gcc -lm -shared -o test_pat_B.so test_pat_B.o
43
44 #include <stdlib.h>
45 #include <assert.h>
46 #include <math.h>
47
48 #include "frei0r.h"cxx . . $ `<file>/include/frei0r.h`/
49
50
51
52 double PIcxx . . $ PI.=3.14159265358979;
53
54 typedef structcxx . . $ $anonymous_type_c70e65480d823f90_0#
55 {
56 float rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.;
57 float gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.;
58 float bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.;
59 float acxx . . $ $anonymous_type_c70e65480d823f90_0#a.;
60 } float_rgbacxx . . $ float_rgba#;
61
62
63 //------------------------------------------------------------------
64 void draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(float_rgbacxx . . $ float_rgba# *s, int w, int h, float x, float y, float wr, float hr, float_rgbacxx . . $ float_rgba# c)
65 {
66 int i,j;
67 int zx,kx,zy,ky;
68
69 zx=x; if (zx<0) zx=0;
70 zy=y; if (zy<0) zy=0;
71 kx=x+wr; if (kx>w) kx=w;
72 ky=y+hr; if (ky>h) ky=h;
73 for (i=zy;i<ky;i++)
74 for (j=zx;j<kx;j++)
75 s[w*i+j]=c;
76
77 }
78
79 //-----------------------------------------------------------
80 //pocasna za velike kroge.....
81 void draw_circlecxx . . $ draw_circle(95ec086e18d41672).(float_rgbacxx . . $ float_rgba# *sl, int w, int h, float ar, int x, int y, int rn, int rz, float_rgbacxx . . $ float_rgba# c)
82 {
83 int i,j;
84 int zx,kx,zy,ky;
85 float rr,rmin,rmax;
86
87 zx=x-rz/ar-1; if (zx<0) zx=0;
88 zy=y-rz-1; if (zy<0) zy=0;
89 kx=x+rz/ar+1; if (kx>w) kx=w;
90 ky=y+rz+1; if (ky>h) ky=h;
91 rmin=(float)rn;
92 rmax=(float)rz;
93 for (i=zy;i<ky;i++)
94 for (j=zx;j<kx;j++)
95 {
96 rr=sqrtf((i-y)*(i-y)+(j-x)*(j-x)*ar*ar);
97 if ((rr>=rmin)&&(rr<=rmax)) sl[w*i+j]=c;
98 }
99
100 }
101
102
103 //------------------------------------------------------------------
104 //ar = pixel aspect ratio
105 //x,y = center
106 //xb,yb = upper left corner of box
107 //vx,vy = size of box
108 void draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(float_rgbacxx . . $ float_rgba# *s, int w, int h, float x, float y, float r, float xb, float yb, float vx, float vy, float ar, float_rgbacxx . . $ float_rgba# c)
109 {
110 int xz,yz,xk,yk;
111 int i,j;
112 float rr;
113
114 xz=x-r/ar-1; if (xz<0) xz=0; if (xz<xb) xz=xb;
115 xk=x+r/ar+1; if (xk>w) xk=w; if (xk>(xb+vx)) xk=xb+vx;
116 yz=y-r-1; if (yz<0) yz=0; if (yz<yb) yz=yb;
117 yk=y+r+1; if (yk>h) yk=h; if (yk>(yb+vy)) yk=yb+vy;
118
119 for (i=yz;i<yk;i++)
120 for (j=xz;j<xk;j++)
121 {
122 rr=sqrtf((i-y)*(i-y)+(j-x)*(j-x)*ar*ar);
123 if (rr<r) s[i*w+j]=c;
124 }
125
126 }
127
128 //---------------------------------------------------------
129 //draw an approximation of the Philips PM5544 test pattern
130 //ar = pixel aspect ratio
131 void draw_pmcxx . . $ draw_pm(13a9e8ce05d2ba2b).(float_rgbacxx . . $ float_rgba# *s, int w, int h, float ar)
132 {
133 float_rgbacxx . . $ float_rgba# c;
134 int vky,vkx,nkx,x0,y0,x0d,y0d;
135 int i,j;
136 float rk,v1,v2;
137 float f,df; //faza in korak faze za rastre
138 float a;
139
140 //doloci velikost kocke po y tako, da jih bo po visini 13.x
141 //z malo rezerve...
142 vky=(h-25)/13;
143 //velikost koceke po x prilagodimo glede na frame in pix aspect
144 vkx=(int)rintf((float)vky/ar);
145 nkx=w/vkx-1; //stevilo kock po x (naredi da bo vedno liho???)
146 x0=(w-vkx*nkx)/2; //zacetni offset za centriranje
147 y0=(h-vky*13)/2;
148 x0d=x0; y0d=y0; //ostanek na desni in dol
149 if ((w-vkx*nkx)%2==1) x0d++;
150 if ((h-vky*13)%2==1) y0d++;
151 rk=6.0*vky;
152 c.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0;
153
154 //ozadje
155 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.45; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.45; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.45;
156 for (i=0;i<w*h;i++) s[i]=c;
157
158 //narisi mrezo
159 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.92; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.92; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.92;
160 for (i=x0;i<w;i=i+vkx) draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i-1,0,3,h,c);
161 for (i=y0;i<h;i=i+vky) draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,i-1,w,3,c);
162
163 //robovi
164 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
165 for (i=x0;i<w;i=i+2*vkx)
166 {
167 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i+2,0,vkx-3,y0-1,c); //zgoraj
168 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i+2,h-y0d+2,vkx-3,y0d-2,c);//spodaj
169 }
170 for (i=y0;i<h;i=i+2*vky)
171 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,i+2,x0-1,vky-3,c); //levo
172 for (i=y0;i<h;i=i+2*vky)
173 {
174 if ((nkx%2)==0) {c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;}
175 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w-x0d+2,i+2,x0d-2,vky-3,c);//desno
176 }
177 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;
178 for (i=x0+vkx;i<w-vkx;i=i+2*vkx)
179 {
180 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i+2,0,vkx-3,y0-1,c); //zgoraj
181 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i+2,h-y0d+2,vkx-3,y0d-2,c);//spodaj
182 }
183 for (i=y0+vky;i<h-vky;i=i+2*vky)
184 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h-1,0,i+2,x0-1,vky-3,c); //levo
185 for (i=y0+vky;i<h-vky;i=i+2*vky)
186 {
187 if ((nkx%2)==0) {c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;}
188 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w-x0d+2,i+2,x0d-2,vky-3,c);//desno
189 }
190 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;
191 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,0,x0-1,y0-1,c); //zg lev
192 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,h-y0d+2,x0-1,y0d-1,c); //sp lev
193 if ((nkx%2)==0) {c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;}
194 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w-x0d+2,0,x0d-1,y0-1,c); //zg des
195 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w-x0d+2,h-y0d+2,x0d-1,y0d-1,c); //sp des
196
197 // "slusalke"
198 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.158; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.602; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.441;
199 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+vkx+2,y0+vky+2,vkx-3,11*vky/2-2,c);
200 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx-1,y0+vky+2,2,2*vky-3,c);
201 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.286; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.455; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.861;
202 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx+2,y0+vky+2,vkx-3,2*vky-4,c);
203 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx+1,y0+vky+2,2,2*vky-3,c);
204 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.736; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.307; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.441;
205 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+vkx+2,y0+13*vky/2+2,vkx-3,11*vky/2-3,c);
206 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx-1,y0+10*vky+2,2,2*vky-3,c);
207 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.609; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.455; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.020;
208 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx+2,y0+10*vky+2,vkx-3,2*vky-4,c);
209 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+2*vkx+1,y0+10*vky+2,2,2*vky-3,c);
210 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.286; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.455; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.861;
211 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-3)*vkx+2,y0+vky+2,vkx-3,2*vky-4,c);
212 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx-1,y0+vky+2,2,2*vky-3,c);
213 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.451; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.555; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.000;
214 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx+2,y0+vky+2,vkx-3,11*vky/2-2,c);
215 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx+1,y0+vky+2,2,2*vky-3,c);
216 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.609; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.455; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.020;
217 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-3)*vkx+2,y0+10*vky+2,vkx-3,2*vky-4,c);
218 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx-1,y0+10*vky+2,2,2*vky-3,c);
219 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.455; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.355; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.957;
220 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx+2,y0+13*vky/2+2,vkx-3,11*vky/2-3,c);
221 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,x0+(nkx-2)*vkx+1,y0+10*vky+2,2,2*vky-3,c);
222
223 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;
224 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, 0.0,0.0,w,y0+2*vky, ar,c);
225 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0; //beli na vrhu
226 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-6*vkx,y0+2*vky, 12*vkx, 2*vky, ar,c); //crni visine 2
227
228 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;
229 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-3*vkx,y0+2*vky,6*vkx,vky,c); //beli za crtico
230
231 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
232 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-2.5*vkx,y0+2*vky,3,vky,c); //crtica
233 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-2*vkx,y0+vky,4*vkx,vky,c); //title zg
234
235 //izmenicni crno sivi
236 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.723; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.723; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.723;
237 v1=vkx*11.09/16.0;
238 for (i=w/2-5.5*vkx+v1;i<w/2+4*vkx;i=i+2.0*v1)
239 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i,y0+3*vky,v1,vky,c);
240 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-5.5*vkx+15*v1,y0+3*vky,vkx,vky, ar,c);
241
242 //barve
243 v2=rk/3.0/ar;
244 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.730; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.73; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
245 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-3*v2,y0+4*vky,v2,2*vky, ar,c);
246 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.74; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.74;
247 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-2*v2,y0+4*vky,v2,2*vky,c);
248 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
249 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-v2,y0+4*vky,v2+1,2*vky,c);
250 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
251 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2,y0+4*vky,v2,2*vky,c);
252 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.765; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
253 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+v2,y0+4*vky,v2,2*vky,c);
254 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.765;
255 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2+2*v2,y0+4*vky,v2,2*vky, ar,c);
256
257 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
258 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-6.1*vkx,y0+6*vky, 13.2*vkx, 4*vky, ar,c); //crno spodaj, podloga za center, raster, sivine
259
260 //rastri
261 f=3.14;
262 df=(float)w/42.66/ar; //perioda v pix
263 df=6.28/df; //fazni korak
264 for (i=(w/2-2.5*v2);i<(w/2-1.5*v2);i++)
265 {
266 a=0.47+0.47*cosf(f);
267 f=f+df;
268 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
269 for (j=(y0+7*vky);j<(y0+9*vky);j++)
270 s[j*w+i]=c;
271 }
272 df=(float)w/96.0/ar; df=6.28/df; //fazni korak
273 for (i=(w/2-1.5*v2);i<(w/2-0.5*v2);i++)
274 {
275 a=0.47+0.47*cosf(f);
276 f=f+df;
277 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
278 for (j=(y0+7*vky);j<(y0+9*vky);j++)
279 s[j*w+i]=c;
280 }
281 df=(float)w/149.0/ar; df=6.28/df; //fazni korak
282 for (i=(w/2-0.5*v2);i<(w/2+0.5*v2);i++)
283 {
284 a=0.47+0.47*cosf(f);
285 f=f+df;
286 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
287 for (j=(y0+7*vky);j<(y0+9*vky);j++)
288 s[j*w+i]=c;
289 }
290 df=(float)w/202.0/ar; df=6.28/df; //fazni korak
291 for (i=(w/2+0.5*v2);i<(w/2+1.5*v2);i++)
292 {
293 a=0.47+0.47*cosf(f);
294 f=f+df;
295 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
296 for (j=(y0+7*vky);j<(y0+9*vky);j++)
297 s[j*w+i]=c;
298 }
299 df=(float)w/256.0/ar; df=6.28/df; //fazni korak
300 for (i=(w/2+1.5*v2);i<(w/2+2.5*v2);i++)
301 {
302 a=0.47+0.47*cosf(f);
303 f=f+df;
304 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
305 for (j=(y0+7*vky);j<(y0+9*vky);j++)
306 s[j*w+i]=c;
307 }
308
309 //centralni del
310 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
311 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-vkx/2,y0+5*vky,vkx,3*vky,c); //pokonc crni
312 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.98; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.98; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.98;
313 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-rk/ar+1,y0+6.5*vky,2*rk/ar,2,c); //bela crta
314 for (i=(w/2-5.5*vkx-1);i<(w/2+5.5*vkx);i=i+vkx)
315 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i,y0+6*vky,2,vky,c); //bele crtice
316 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-1,y0+5*vky,2,3*vky,c); //pokonci bela
317
318 //sivine
319 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.172; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.172; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.172;
320 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-2*v2,y0+9*vky,v2,vky,c);
321 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.37; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.37; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.37;
322 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-v2,y0+9*vky,v2+1,vky,c);
323 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.566; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.566; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.566;
324 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2,y0+9*vky,v2,vky,c);
325 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.77; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.77; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.77;
326 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+v2,y0+9*vky,v2,vky,c);
327 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.97; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.97; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.97;
328 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2+2*v2,y0+9*vky, v2, vky, ar,c);
329
330
331 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-rk,y0+10*vky, 2*rk, vky, ar,c); //bela podloga
332 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
333 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-3*vkx,y0+10*vky,6*vkx,vky,c); //title sp
334 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.97; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.97; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.97;
335 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-2.5*vkx,y0+10*vky,3,vky,c); //crtica
336
337 //spodnji del
338 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.73; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.73; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
339 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-4*vkx,y0+11*vky, 4*vkx, 2*vky, ar,c);
340 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2+0.5*vkx,y0+11*vky, 4*vkx, 2*vky, ar,c);
341 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.758; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
342 draw_boxed_circlecxx . . $ draw_boxed_circle(53f901b370f9e849).(s,w,h, w/2.0,h/2.0,rk, w/2-0.5*vkx,y0+11*vky, vkx, 2*vky, ar,c);
343
344 }
345
346 //---------------------------------------------------------
347 //draw an approximation of the Telefunken FuBK test pattern
348 //ar = pixel aspect ratio
349 //simpl=1: does not draw the circle and central vertical
350 void draw_fucxx . . $ draw_fu(69e49cb628e87f6f).(float_rgbacxx . . $ float_rgba# *s, int w, int h, float ar, int simpl)
351 {
352 float_rgbacxx . . $ float_rgba# c;
353 int vky,vkx,nkx,x0,y0;
354 int i,j,z,k;
355 float rk,v1;
356 float f,df; //faza in korak faze za rastre
357 float a;
358
359 //doloci velikost kocke po y tako, da jih bo po visini 14.x
360 //z malo rezerve...
361 vky=(h-10)/14;
362 //velikost koceke po x prilagodimo glede na frame in pix aspect
363 vkx=(int)rintf((float)vky/ar);
364 nkx=w/vkx-1; //stevilo kock po x
365 if (nkx%2==1) nkx--;
366 x0=(w-vkx*nkx)/2; //zacetni offset za centriranje
367 if (x0>vkx) x0=x0-vkx;
368 y0=(h-vky*14)/2;
369 rk=6.7*vky;
370 c.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0;
371
372 //ozadje
373 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.25; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.25; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.25;
374 for (i=0;i<w*h;i++) s[i]=c;
375
376 //narisi mrezo
377 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
378 for (i=x0;i<w;i=i+vkx) draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,i-1,0,3,h,c);
379 for (i=y0;i<h;i=i+vky) draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,i-1,w,3,c);
380
381 //barve zgoraj
382 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
383 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+1,y0+2*vky+1,1.5*vkx,3*vky,c);
384 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
385 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-4.5*vkx,y0+2*vky+1,1.5*vkx,3*vky,c);
386 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
387 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-3*vkx,y0+2*vky+1,1.5*vkx,3*vky,c);
388 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
389 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-1.5*vkx,y0+2*vky+1,1.5*vkx,3*vky,c);
390 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
391 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2,y0+2*vky+1,1.5*vkx,3*vky,c);
392 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
393 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+1.5*vkx,y0+2*vky+1,1.5*vkx,3*vky,c);
394 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
395 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+3*vkx,y0+2*vky+1,1.5*vkx,3*vky,c);
396 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
397 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+4.5*vkx,y0+2*vky+1,1.5*vkx-1,3*vky,c);
398
399 //sivine
400 v1=12*vkx/5;
401 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
402 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+1,y0+5*vky,v1-1,2*vky-1,c);
403 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.3; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.3; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.3;
404 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+v1,y0+5*vky,v1,2*vky-1,c);
405 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.5; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.5; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.5;
406 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+2*v1,y0+5*vky,v1,2*vky-1,c);
407 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
408 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+3*v1,y0+5*vky,v1,2*vky-1,c);
409 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
410 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+4*v1,y0+5*vky,v1,2*vky-1,c);
411
412 //bela podloga za title, rasteje in spico
413 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx,y0+7*vky,12*vkx,3*vky,c);
414
415 //title bar
416 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
417 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-1.5*v1,y0+7*vky+1,3*v1,vky,c);
418 //sivina pod rastri
419 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.54; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.54; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.54;
420 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-4.5*vkx,y0+8*vky,10.5*vkx-1,vky,c);
421
422 //rastri
423 f=-3.14/2.0;
424 df=(float)w/52.0/ar; df=6.28/df; //fazni korak
425 for (i=(w/2-0.646*rk/ar);i<(w/2-0.373*rk/ar);i++)
426 {
427 a=0.5+0.49*cosf(f);
428 f=f+df;
429 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
430 for (j=(y0+8*vky);j<(y0+9*vky);j++)
431 s[j*w+i]=c;
432 }
433 f=-3.14/2.0;
434 df=(float)w/103.0/ar; df=6.28/df; //fazni korak
435 for (i=(w/2-0.332*rk/ar);i<(w/2-0.060*rk/ar);i++)
436 {
437 a=0.5+0.49*cosf(f);
438 f=f+df;
439 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
440 for (j=(y0+8*vky);j<(y0+9*vky);j++)
441 s[j*w+i]=c;
442 }
443 f=-3.14/2.0;
444 df=(float)w/156.0/ar; df=6.28/df; //fazni korak
445 for (i=(w/2+0.056*rk/ar);i<(w/2+0.299*rk/ar);i++)
446 {
447 a=0.5+0.49*cosf(f);
448 f=f+df;
449 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=a;
450 for (j=(y0+8*vky);j<(y0+9*vky);j++)
451 s[j*w+i]=c;
452 }
453
454 //rjava
455 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.69; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.5; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
456 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+0.369*rk/ar,y0+8*vky,0.437*rk/ar,vky,c);
457
458
459 //spica
460 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
461 v1=vkx/2.857;
462 z=w/2-v1/2+2;
463 for (i=(y0+9*vky);i<(y0+10*vky);i++)
464 {
465 k=z+v1*((y0+10*vky)-i)/vky;
466 for (j=z;j<k;j++) s[i*w+j]=c;
467 }
468
469 //rdeci gradient
470 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.055; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.375;
471 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+1,y0+10*vky+1,2*vkx,vky-1,c);
472 for (i=(w/2-4*vkx);i<(w/2+2*vkx);i++)
473 {
474 a=(((float)w/2.0+2.0*vkx)-(float)i)/(6.0*(float)vkx);
475 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=.999*a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.055*a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.375*a;
476 for (j=(y0+10*vky+1);j<(y0+11*vky);j++)
477 s[j*w+i]=c;
478 }
479 //plavi gradient
480 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.375; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.254; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
481 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-6*vkx+1,y0+11*vky,2*vkx,vky-1,c);
482 for (i=(w/2-4*vkx);i<(w/2+2*vkx);i++)
483 {
484 a=(((float)w/2.0+2.0*vkx)-(float)i)/(6.0*(float)vkx);
485 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=.375*a; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.254*a; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00*a;
486 for (j=(y0+11*vky);j<(y0+12*vky-1);j++)
487 s[j*w+i]=c;
488 }
489
490 //sivo spodaj desno
491 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.375; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.375; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.375;
492 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2+2*vkx,y0+10*vky+1,4*vkx-1,2*vky-2,c);
493
494 if (simpl==0)
495 {
496 //crta na sredi
497 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
498 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,w/2-1,y0+5*vky,3,4*vky,c);
499
500 //krog
501 draw_circlecxx . . $ draw_circle(95ec086e18d41672).(s,w,h,ar,w/2,h/2,rk,rk+3,c);
502 }
503
504 }
505
506 //----------------------------------------------------------
507 //simple color bars
508 //m=modulation 0: 100% 1: 95% 2: 75%
509 //r=0 bars only r=1 read area below ("PAL" color bars)
510 void bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(float_rgbacxx . . $ float_rgba# *s, int w, int h, int m, int r)
511 {
512 float_rgbacxx . . $ float_rgba# white,yellow,cyan,green,magenta,red,blue,black;
513 int h1;
514
515 switch (m)
516 {
517 case 0: //100% (PAL) color bars 100.0.100.0
518 white.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; white.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; white.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
519 yellow.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; yellow.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; yellow.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
520 cyan.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; cyan.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; cyan.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
521 green.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; green.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; green.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
522 magenta.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; magenta.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; magenta.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
523 red.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; red.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; red.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
524 blue.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; blue.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; blue.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
525 black.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; black.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; black.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
526 break;
527 case 1: //95% (BBC) color bars 100.0.100.25
528 white.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; white.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; white.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
529 yellow.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; yellow.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; yellow.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.25;
530 cyan.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.25; cyan.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; cyan.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
531 green.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.25; green.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; green.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.25;
532 magenta.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; magenta.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.25; magenta.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
533 red.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; red.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.25; red.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.25;
534 blue.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.25; blue.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.25; blue.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
535 black.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; black.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; black.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
536 break;
537 case 2: //75% (IBA/EBU) color bars 100.0.75.0
538 white.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; white.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; white.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
539 yellow.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; yellow.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; yellow.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
540 cyan.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; cyan.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; cyan.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
541 green.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; green.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; green.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
542 magenta.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; magenta.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; magenta.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
543 red.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; red.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; red.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
544 blue.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; blue.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; blue.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
545 black.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; black.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; black.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
546 break;
547 default:
548 break;
549 }
550 white.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; yellow.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; cyan.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; green.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0;
551 magenta.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; red.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; blue.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0; black.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0;
552
553 if (r==0) h1=h; else h1=0.55*h;
554
555 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0*w/8,0,w/8+1,h,white);
556 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,1*w/8,0,w/8+1,h,yellow);
557 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,2*w/8,0,w/8+1,h,cyan);
558 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,3*w/8,0,w/8+1,h,green);
559 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,4*w/8,0,w/8+1,h,magenta);
560 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,5*w/8,0,w/8+1,h,red);
561 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,6*w/8,0,w/8+1,h,blue);
562 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,7*w/8,0,w/8+1,h,black);
563
564 if (r==1)
565 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0,h1,w,h-h1,red);
566
567 }
568
569 //----------------------------------------------------------
570 //draws an approximation to the SMPTE color bars
571 void bars_smptecxx . . $ bars_smpte(5f7f483e616c44f6).(float_rgbacxx . . $ float_rgba# *s, int w, int h)
572 {
573 float_rgbacxx . . $ float_rgba# c;
574
575 c.acxx . . $ $anonymous_type_c70e65480d823f90_0#a.=1.0;
576
577 //top bars
578 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
579 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0*w/7,0,w/7+1,2*h/3+1,c);
580 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
581 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,1*w/7,0,w/7+1,2*h/3+1,c);
582 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
583 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,2*w/7,0,w/7+1,2*h/3+1,c);
584 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
585 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,3*w/7,0,w/7+1,2*h/3+1,c);
586 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
587 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,4*w/7,0,w/7+1,2*h/3+1,c);
588 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.0;
589 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,5*w/7,0,w/7+1,2*h/3+1,c);
590 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
591 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,6*w/7,0,w/7+1,2*h/3+1,c);
592
593 //middle bars
594 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
595 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0*w/7,2*h/3,w/7+1,h/12+1,c);
596 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
597 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,1*w/7,2*h/3,w/7+1,h/12+1,c);
598 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
599 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,2*w/7,2*h/3,w/7+1,h/12+1,c);
600 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
601 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,3*w/7,2*h/3,w/7+1,h/12+1,c);
602 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
603 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,4*w/7,2*h/3,w/7+1,h/12+1,c);
604 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
605 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,5*w/7,2*h/3,w/7+1,h/12+1,c);
606 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.75; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.75; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.75;
607 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,6*w/7,2*h/3,w/7+1,h/12+1,c);
608
609 //bottom bars
610 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.0; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.129; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.297;
611 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,0*w/28,3*h/4,5*w/28+1,h/4+1,c);
612 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=1.00; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=1.00; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=1.00;
613 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,5*w/28,3*h/4,5*w/28+1,h/4+1,c);
614 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.195; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.0; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.414;
615 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,10*w/28,3*h/4,5*w/28+1,h/4+1,c);
616 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
617 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,15*w/28,3*h/4,7*w/28+1,h/4+1,c);
618
619 //pluge bars
620 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.035; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.035; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.035;
621 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,15*w/21,3*h/4,w/21+1,h/4+1,c);
622 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
623 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,16*w/21,3*h/4,w/21+1,h/4+1,c);
624 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.113; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.113; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.113;
625 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,17*w/21,3*h/4,w/21+1,h/4+1,c);
626
627 c.rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.=0.074; c.gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.=0.074; c.bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.=0.074;
628 draw_rectanglecxx . . $ draw_rectangle(bea8b81928a0543e).(s,w,h,6*w/7,3*h/4,w/7+1,h/4+1,c);
629
630 }
631
632
633 //-----------------------------------------------------
634 //converts the internal RGB float image into
635 //Frei0r rgba8888 color
636 //sets alpha to opaque
637 void floatrgba2colorcxx . . $ floatrgba2color(7e35642528ab9dd1).(float_rgbacxx . . $ float_rgba# *sl, uint32_tcxx . . $ uint32_t#* outframe, int w , int h)
638 {
639 int i;
640 uint32_tcxx . . $ uint32_t# p;
641
642 for (i=0;i<w*h;i++)
643 {
644 p=(uint32_tcxx . . $ uint32_t#)(255.0*sl[i].bcxx . . $ $anonymous_type_c70e65480d823f90_0#b.) & 0xFF;
645 p=(p<<8) + ((uint32_tcxx . . $ uint32_t#)(255.0*sl[i].gcxx . . $ $anonymous_type_c70e65480d823f90_0#g.) & 0xFF);
646 p=(p<<8) + ((uint32_tcxx . . $ uint32_t#)(255.0*sl[i].rcxx . . $ $anonymous_type_c70e65480d823f90_0#r.) & 0xFF);
647 outframe[i] = p + 0xFF000000; //no transparency
648 }
649
650 }
651
652 //-----------------------------------------------------
653 //stretch [0...1] to parameter range [min...max] linear
654 float map_value_forwardcxx . . $ map_value_forward(1935fda23fc189b2).(double v, float min, float max)
655 {
656 return min+(max-min)*v;
657 }
658
659 //-----------------------------------------------------
660 //collapse from parameter range [min...max] to [0...1] linear
661 double map_value_backwardcxx . . $ map_value_backward(937b104db0ceee62).(float v, float min, float max)
662 {
663 return (v-min)/(max-min);
664 }
665
666 //-----------------------------------------------------
667 //stretch [0...1] to parameter range [min...max] logarithmic
668 //min and max must be positive!
669 float map_value_forward_logcxx . . $ map_value_forward_log(1935fda23fc189b2).(double v, float min, float max)
670 {
671 float sr,k;
672
673 sr=sqrtf(min*max);
674 k=2.0*logcxx . . $ log(447c67c6676f75c3).(max/sr);
675 return sr*expf(k*(v-0.5));
676 }
677
678 //-----------------------------------------------------
679 //collapse from parameter range [min...max] to [0...1] logarithmic
680 //min and max must be positive!
681 double map_value_backward_logcxx . . $ map_value_backward_log(937b104db0ceee62).(float v, float min, float max)
682 {
683 float sr,k;
684
685 sr=sqrtf(min*max);
686 k=2.0*logcxx . . $ log(447c67c6676f75c3).(max/sr);
687 return logf(v/sr)/k+0.5;
688 }
689
690 //**************************************************
691 //obligatory frei0r stuff follows
692
693 //------------------------------------------------
694 //this structure holds an instance of the test_pat_B plugin
695 typedef structcxx . . $ $anonymous_type_c70e65480d823f90_1#
696 {
697 unsigned int wcxx . . $ $anonymous_type_c70e65480d823f90_1#w.;
698 unsigned int hcxx . . $ $anonymous_type_c70e65480d823f90_1#h.;
699
700 int typecxx . . $ $anonymous_type_c70e65480d823f90_1#type.;
701 int asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt.;
702 float mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar.;
703
704 float parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.;
705 float_rgbacxx . . $ float_rgba# *slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl.;
706
707 } tp_inst_tcxx . . $ tp_inst_t#;
708
709 //----------------------------------------------------
710 int f0r_initcxx . . $ f0r_init(b126dc7c1de90089).()
711 {
712 return 1;
713 }
714
715 //--------------------------------------------------
716 void f0r_deinitcxx . . $ f0r_deinit(49f6e7a06ebc5aa8).()
717 { /* no initialization required */ }
718
719 //--------------------------------------------------
720 void f0r_get_plugin_infocxx . . $ f0r_get_plugin_info(35d753456c0ea59c).(f0r_plugin_info_tcxx . . $ f0r_plugin_info_t#* tp_info)
721 {
722 tp_info->namecxx . . $ f0r_plugin_info#name. = "test_pat_B";
723 tp_info->authorcxx . . $ f0r_plugin_info#author. = "Marko Cebokli";
724 tp_info->plugin_typecxx . . $ f0r_plugin_info#plugin_type. = F0R_PLUGIN_TYPE_SOURCEcxx . . $ `include/frei0r.h:249:9`!;
725 // tp_info->plugin_type = F0R_PLUGIN_TYPE_FILTER;
726 tp_info->color_modelcxx . . $ f0r_plugin_info#color_model. = F0R_COLOR_MODEL_RGBA8888cxx . . $ `include/frei0r.h:308:9`!;
727 tp_info->frei0r_versioncxx . . $ f0r_plugin_info#frei0r_version. = FREI0R_MAJOR_VERSIONcxx . . $ `include/frei0r.h:217:9`!;
728 tp_info->major_versioncxx . . $ f0r_plugin_info#major_version. = 0;
729 tp_info->minor_versioncxx . . $ f0r_plugin_info#minor_version. = 1;
730 tp_info->num_paramscxx . . $ f0r_plugin_info#num_params. = 3;
731 tp_info->explanationcxx . . $ f0r_plugin_info#explanation. = "Generates test card lookalikes";
732 }
733
734 //--------------------------------------------------
735 void f0r_get_param_infocxx . . $ f0r_get_param_info(a9f9aa7954cc4a37).(f0r_param_info_tcxx . . $ f0r_param_info_t#* info, int param_index)
736 {
737 switch (param_index)
738 {
739 case 0:
740 info->namecxx . . $ f0r_param_info#name. = "Type";
741 info->typecxx . . $ f0r_param_info#type. = F0R_PARAM_DOUBLEcxx . . $ `include/frei0r.h:383:9`!;
742 info->explanationcxx . . $ f0r_param_info#explanation. = "8 choices, select test pattern"; break;
743 case 1:
744 info->namecxx . . $ f0r_param_info#name. ="Aspect type";
745 info->typecxx . . $ f0r_param_info#type. = F0R_PARAM_DOUBLEcxx . . $ `include/frei0r.h:383:9`!;
746 info->explanationcxx . . $ f0r_param_info#explanation. = "7 choices, pixel aspect ratio";
747 break;
748 case 2:
749 info->namecxx . . $ f0r_param_info#name. = "Manual Aspect";
750 info->typecxx . . $ f0r_param_info#type. = F0R_PARAM_DOUBLEcxx . . $ `include/frei0r.h:383:9`!;
751 info->explanationcxx . . $ f0r_param_info#explanation. = "Manual pixel aspect ratio (Aspect type 6)";
752 break;
753 }
754 }
755
756 //--------------------------------------------------
757 f0r_instance_tcxx . . $ f0r_instance_t# f0r_constructcxx . . $ f0r_construct(da3f471cd007a696).(unsigned int width, unsigned int height)
758 {
759 tp_inst_tcxx . . $ tp_inst_t#* inst = calloccxx . . $ calloc(63a7bf2941bfcd7a).(1, sizeof(*inst));
760 inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w. = width;
761 inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h. = height;
762
763 inst->typecxx . . $ $anonymous_type_c70e65480d823f90_1#type.=0;
764 inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt.=0;
765 inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar.=1.0;
766
767 inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.0;
768 inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl.=(float_rgbacxx . . $ float_rgba#*)calloccxx . . $ calloc(63a7bf2941bfcd7a).(width*height,sizeof(float_rgbacxx . . $ float_rgba#));
769
770 bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., 0, 0);
771
772 return (f0r_instance_tcxx . . $ f0r_instance_t#)inst;
773 }
774
775 //--------------------------------------------------
776 void f0r_destructcxx . . $ f0r_destruct(5d22bdacc48458e8).(f0r_instance_tcxx . . $ f0r_instance_t# instance)
777 {
778 tp_inst_tcxx . . $ tp_inst_t#* inst = (tp_inst_tcxx . . $ tp_inst_t#*)instance;
779
780 freecxx . . $ free(5d22bdacc48458e8).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl.);
781 freecxx . . $ free(5d22bdacc48458e8).(inst);
782 }
783
784 //--------------------------------------------------
785 void f0r_set_param_valuecxx . . $ f0r_set_param_value(5be095a8278d2bf5).(f0r_instance_tcxx . . $ f0r_instance_t# instance, f0r_param_tcxx . . $ f0r_param_t# param, int param_index)
786 {
787 tp_inst_tcxx . . $ tp_inst_t#* inst = (tp_inst_tcxx . . $ tp_inst_t#*)instance;
788
789 f0r_param_doublecxx . . $ f0r_param_double#* p = (f0r_param_doublecxx . . $ f0r_param_double#*) param;
790
791 int chg,tmpi;
792 float tmpf;
793
794 chg=0;
795 switch (param_index)
796 {
797 case 0: //type
798 tmpf=*((double*)p);
799 if (tmpf>=1.0)
800 tmpi=(int)tmpf;
801 else
802 tmpi = map_value_forwardcxx . . $ map_value_forward(1935fda23fc189b2).(tmpf, 0.0, 7.9999);
803 if ((tmpi<0)||(tmpi>7.0)) break;
804 if (inst->typecxx . . $ $anonymous_type_c70e65480d823f90_1#type. != tmpi) chg=1;
805 inst->typecxx . . $ $anonymous_type_c70e65480d823f90_1#type. = tmpi;
806 break;
807 case 1: //aspect type
808 tmpf=*((double*)p);
809 if (tmpf>=1.0)
810 tmpi=(int)tmpf;
811 else
812 tmpi = map_value_forwardcxx . . $ map_value_forward(1935fda23fc189b2).(tmpf, 0.0, 6.9999);
813 if ((tmpi<0)||(tmpi>6.0)) break;
814 if (inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt. != tmpi) chg=1;
815 inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt. = tmpi;
816 switch (inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt.) //pixel aspect ratio
817 {
818 case 0: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.000;break; //square pixels
819 case 1: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.067;break; //PAL DV
820 case 2: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.455;break; //PAL wide
821 case 3: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=0.889;break; //NTSC DV
822 case 4: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.212;break; //NTSC wide
823 case 5: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=1.333;break; //HDV
824 case 6: inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar.;break; //manual
825 }
826 break;
827 case 2: //manual aspect
828 tmpf = map_value_forward_logcxx . . $ map_value_forward_log(1935fda23fc189b2).(*((double*)p), 0.5, 2.0);
829 if (inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar. != tmpf) chg=1;
830 inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar. = tmpf;
831 if (inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt.==4) inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.=inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar.;
832 break;
833 }
834
835 if (chg==0) return;
836
837 switch (inst->typecxx . . $ $anonymous_type_c70e65480d823f90_1#type.)
838 {
839 case 0: //100% PAL color bars
840 bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., 0, 0);
841 break;
842 case 1: //PAL color bars with red
843 bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., 0, 1);
844 break;
845 case 2: //95% BBC color bars
846 bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., 1, 0);
847 break;
848 case 3: //75% EBU color bars
849 bars_simplecxx . . $ bars_simple(bdbcee8254e8f865).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., 2, 0);
850 break;
851 case 4: //SMPTE color bars
852 bars_smptecxx . . $ bars_smpte(5f7f483e616c44f6).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h.);
853 break;
854 case 5: //philips PM5544
855 draw_pmcxx . . $ draw_pm(13a9e8ce05d2ba2b).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par.);
856 break;
857 case 6: //FuBK
858 draw_fucxx . . $ draw_fu(69e49cb628e87f6f).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par., 0);
859 break;
860 case 7: //simplified FuBK
861 draw_fucxx . . $ draw_fu(69e49cb628e87f6f).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w., inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h., inst->parcxx . . $ $anonymous_type_c70e65480d823f90_1#par., 1);
862 break;
863 default:
864 break;
865 }
866
867 }
868
869 //-------------------------------------------------
870 void f0r_get_param_valuecxx . . $ f0r_get_param_value(5be095a8278d2bf5).(f0r_instance_tcxx . . $ f0r_instance_t# instance, f0r_param_tcxx . . $ f0r_param_t# param, int param_index)
871 {
872 tp_inst_tcxx . . $ tp_inst_t#* inst = (tp_inst_tcxx . . $ tp_inst_t#*)instance;
873
874 f0r_param_doublecxx . . $ f0r_param_double#* p = (f0r_param_doublecxx . . $ f0r_param_double#*) param;
875
876 switch (param_index)
877 {
878 case 0: //type
879 *p = map_value_backwardcxx . . $ map_value_backward(937b104db0ceee62).(inst->typecxx . . $ $anonymous_type_c70e65480d823f90_1#type., 0.0, 7.9999);
880 break;
881 case 1: //aspect type
882 *p = map_value_backwardcxx . . $ map_value_backward(937b104db0ceee62).(inst->asptcxx . . $ $anonymous_type_c70e65480d823f90_1#aspt., 0.0, 6.9999);
883 break;
884 case 2: //manual aspect
885 *p = map_value_backward_logcxx . . $ map_value_backward_log(937b104db0ceee62).(inst->mparcxx . . $ $anonymous_type_c70e65480d823f90_1#mpar., 0.5, 2.0);
886 break;
887 }
888 }
889
890 //---------------------------------------------------
891 void f0r_updatecxx . . $ f0r_update(96cd7b27f2fca8a7).(f0r_instance_tcxx . . $ f0r_instance_t# instance, double time, const uint32_tcxx . . $ uint32_t#* inframe, uint32_tcxx . . $ uint32_t#* outframe)
892 {
893
894 assertcxx . . $ `<external>/4398592474888995393/assert.h:77:11`!(instance);
895 tp_inst_tcxx . . $ tp_inst_t#* inst = (tp_inst_tcxx . . $ tp_inst_t#*)instance;
896
897 floatrgba2colorcxx . . $ floatrgba2color(7e35642528ab9dd1).(inst->slcxx . . $ $anonymous_type_c70e65480d823f90_1#sl., outframe, inst->wcxx . . $ $anonymous_type_c70e65480d823f90_1#w. , inst->hcxx . . $ $anonymous_type_c70e65480d823f90_1#h.);
898
899 }