annotate libmpcodecs/vf_rectangle.c @ 9443:7df93217d82c

minor 1l I forgot to commit a while back
author rfelker
date Sun, 16 Feb 2003 07:05:24 +0000
parents 8fd62b14cbc0
children e9a2af584986
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
1 #include <stdio.h>
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
2 #include <stdlib.h>
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
3 #include <string.h>
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
4 #include "mp_image.h"
7738
d414735695ea printf -> mp_msg
attila
parents: 7368
diff changeset
5 #include "../mp_msg.h"
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
6 #include "vf.h"
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
7
7127
1e47c2e7aa8e mostly compiler warning fixes, some small bugfix
arpi
parents: 6887
diff changeset
8 #include "../libvo/fastmemcpy.h"
1e47c2e7aa8e mostly compiler warning fixes, some small bugfix
arpi
parents: 6887
diff changeset
9
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
10 struct vf_priv_s {
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
11 int x, y, w, h;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
12 };
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
13
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
14 static int
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
15 config(struct vf_instance_s* vf,
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
16 int width, int height, int d_width, int d_height,
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
17 unsigned int flags, unsigned int outfmt)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
18 {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
19 if (vf->priv->w < 0 || width < vf->priv->w)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
20 vf->priv->w = width;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
21 if (vf->priv->h < 0 || height < vf->priv->h)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
22 vf->priv->h = height;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
23 if (vf->priv->x < 0)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
24 vf->priv->x = (width - vf->priv->w) / 2;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
25 if (vf->priv->y < 0)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
26 vf->priv->y = (height - vf->priv->h) / 2;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
27 if (vf->priv->w + vf->priv->x > width
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
28 || vf->priv->h + vf->priv->y > height) {
7738
d414735695ea printf -> mp_msg
attila
parents: 7368
diff changeset
29 mp_msg(MSGT_VFILTER,MSGL_WARN,"rectangle: bad position/width/height - rectangle area is out of the original!\n");
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
30 return 0;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
31 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
32 return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
33 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
34
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
35 static int
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
36 control(struct vf_instance_s* vf, int request, void *data)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
37 {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
38 const int *const tmp = data;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
39 switch(request){
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
40 case VFCTRL_CHANGE_RECTANGLE:
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
41 switch (tmp[0]){
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
42 case 0:
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
43 vf->priv->w += tmp[1];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
44 return 1;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
45 break;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
46 case 1:
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
47 vf->priv->h += tmp[1];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
48 return 1;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
49 break;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
50 case 2:
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
51 vf->priv->x += tmp[1];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
52 return 1;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
53 break;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
54 case 3:
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
55 vf->priv->y += tmp[1];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
56 return 1;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
57 break;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
58 default:
7738
d414735695ea printf -> mp_msg
attila
parents: 7368
diff changeset
59 mp_msg(MSGT_VFILTER,MSGL_FATAL,"Unknown param %d \n", tmp[0]);
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
60 return 0;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
61 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
62 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
63 return vf_next_control(vf, request, data);
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
64 return 0;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
65 }
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
66 static int
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
67 put_image(struct vf_instance_s* vf, mp_image_t* mpi){
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
68 mp_image_t* dmpi;
8737
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
69 unsigned int bpp = mpi->bpp / 8;
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
70 unsigned int x, y, w, h;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
71 dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP,
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
72 MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
73 mpi->w, mpi->h);
8737
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
74
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
75 memcpy_pic(dmpi->planes[0],mpi->planes[0],mpi->w*bpp, mpi->h,
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
76 dmpi->stride[0],mpi->stride[0]);
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
77 if(mpi->flags&MP_IMGFLAG_PLANAR && mpi->flags&MP_IMGFLAG_YUV){
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
78 memcpy_pic(dmpi->planes[1],mpi->planes[1],
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
79 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
80 dmpi->stride[1],mpi->stride[1]);
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
81 memcpy_pic(dmpi->planes[2],mpi->planes[2],
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
82 mpi->w>>mpi->chroma_x_shift, mpi->h>>mpi->chroma_y_shift,
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
83 dmpi->stride[2],mpi->stride[2]);
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
84 }
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
85
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
86 /* Draw the rectangle */
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
87
8737
8fd62b14cbc0 better image/plane copy
arpi
parents: 7739
diff changeset
88 mp_msg(MSGT_VFILTER,MSGL_INFO, "rectangle: -vop rectangle=%d:%d:%d:%d \n", vf->priv->w, vf->priv->h, vf->priv->x, vf->priv->y);
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
89
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
90 if (vf->priv->x < 0)
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
91 x = 0;
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
92 else if (dmpi->width < vf->priv->x)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
93 x = dmpi->width;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
94 else
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
95 x = vf->priv->x;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
96 if (vf->priv->x + vf->priv->w - 1 < 0)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
97 w = vf->priv->x + vf->priv->w - 1 - x;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
98 else if (dmpi->width < vf->priv->x + vf->priv->w - 1)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
99 w = dmpi->width - x;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
100 else
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
101 w = vf->priv->x + vf->priv->w - 1 - x;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
102 if (vf->priv->y < 0)
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
103 y = 0;
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
104 else if (dmpi->height < vf->priv->y)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
105 y = dmpi->height;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
106 else
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
107 y = vf->priv->y;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
108 if (vf->priv->y + vf->priv->h - 1 < 0)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
109 h = vf->priv->y + vf->priv->h - 1 - y;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
110 else if (dmpi->height < vf->priv->y + vf->priv->h - 1)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
111 h = dmpi->height - y;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
112 else
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
113 h = vf->priv->y + vf->priv->h - 1 - y;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
114
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
115 if (0 <= vf->priv->y && vf->priv->y <= dmpi->height) {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
116 unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
117 unsigned int count = w * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
118 while (count--)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
119 p[count] = 0xff - p[count];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
120 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
121 if (h != 1 && vf->priv->y + vf->priv->h - 1 <= mpi->height) {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
122 unsigned char *p = dmpi->planes[0] + (vf->priv->y + vf->priv->h - 1) * dmpi->stride[0] + x * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
123 unsigned int count = w * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
124 while (count--)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
125 p[count] = 0xff - p[count];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
126 }
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
127 if (0 <= vf->priv->x && vf->priv->x <= dmpi->width) {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
128 unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + x * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
129 unsigned int count = h;
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
130 while (count--) {
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
131 unsigned int i = bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
132 while (i--)
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
133 p[i] = 0xff - p[i];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
134 p += dmpi->stride[0];
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
135 }
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
136 }
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
137 if (w != 1 && vf->priv->x + vf->priv->w - 1 <= mpi->width) {
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
138 unsigned char *p = dmpi->planes[0] + y * dmpi->stride[0] + (vf->priv->x + vf->priv->w - 1) * bpp;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
139 unsigned int count = h;
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
140 while (count--) {
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
141 unsigned int i = bpp;
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
142 while (i--)
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
143 p[i] = 0xff - p[i];
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
144 p += dmpi->stride[0];
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
145 }
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
146 }
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
147 return vf_next_put_image(vf, dmpi);
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
148 }
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
149
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
150 static int
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
151 open(vf_instance_t* vf, char* args) {
6887
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
152 vf->config = config;
66427e850216 Add the control VFCTRL_CHANGE_RECTANGLE
kmkaplan
parents: 6820
diff changeset
153 vf->control = control;
6820
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
154 vf->put_image = put_image;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
155 vf->priv = malloc(sizeof(struct vf_priv_s));
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
156 vf->priv->x = -1;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
157 vf->priv->y = -1;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
158 vf->priv->w = -1;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
159 vf->priv->h = -1;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
160 if (args)
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
161 sscanf(args, "%d:%d:%d:%d",
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
162 &vf->priv->w, &vf->priv->h, &vf->priv->x, &vf->priv->y);
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
163 return 1;
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
164 }
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
165
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
166 vf_info_t vf_info_rectangle = {
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
167 "draw rectangle",
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
168 "rectangle",
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
169 "Kim Minh Kaplan",
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
170 "",
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
171 open
a99c7700e4f1 New plugin to test crop parameters. Arguments are the same as for the
kmkaplan
parents:
diff changeset
172 };