Lines Matching +full:top +full:- +full:left

4  * Copyright (C) 2005-2010 Texas Instruments.
11 * Video-for-Linux (Version 2) camera capture driver for
27 #include <linux/dma-mapping.h>
46 crop->width = (pix->width < fbuf->fmt.width) ? in omap_vout_default_crop()
47 pix->width : fbuf->fmt.width; in omap_vout_default_crop()
48 crop->height = (pix->height < fbuf->fmt.height) ? in omap_vout_default_crop()
49 pix->height : fbuf->fmt.height; in omap_vout_default_crop()
50 crop->width &= ~1; in omap_vout_default_crop()
51 crop->height &= ~1; in omap_vout_default_crop()
52 crop->left = ((pix->width - crop->width) >> 1) & ~1; in omap_vout_default_crop()
53 crop->top = ((pix->height - crop->height) >> 1) & ~1; in omap_vout_default_crop()
60 * Returns zero if successful, or -EINVAL if the requested window is
69 try_win = new_win->w; in omap_vout_try_window()
74 if (try_win.left < 0) { in omap_vout_try_window()
75 try_win.width += try_win.left; in omap_vout_try_window()
76 try_win.left = 0; in omap_vout_try_window()
78 if (try_win.top < 0) { in omap_vout_try_window()
79 try_win.height += try_win.top; in omap_vout_try_window()
80 try_win.top = 0; in omap_vout_try_window()
82 try_win.width = (try_win.width < fbuf->fmt.width) ? in omap_vout_try_window()
83 try_win.width : fbuf->fmt.width; in omap_vout_try_window()
84 try_win.height = (try_win.height < fbuf->fmt.height) ? in omap_vout_try_window()
85 try_win.height : fbuf->fmt.height; in omap_vout_try_window()
86 if (try_win.left + try_win.width > fbuf->fmt.width) in omap_vout_try_window()
87 try_win.width = fbuf->fmt.width - try_win.left; in omap_vout_try_window()
88 if (try_win.top + try_win.height > fbuf->fmt.height) in omap_vout_try_window()
89 try_win.height = fbuf->fmt.height - try_win.top; in omap_vout_try_window()
94 return -EINVAL; in omap_vout_try_window()
97 new_win->w = try_win; in omap_vout_try_window()
98 new_win->field = V4L2_FIELD_NONE; in omap_vout_try_window()
99 new_win->clips = NULL; in omap_vout_try_window()
100 new_win->clipcount = 0; in omap_vout_try_window()
101 new_win->bitmap = NULL; in omap_vout_try_window()
111 * successful, new_win, vout->win, and crop are updated.
112 * Returns zero if successful, or -EINVAL if the requested preview window is
126 win->w = new_win->w; in omap_vout_new_window()
127 win->field = new_win->field; in omap_vout_new_window()
128 win->chromakey = new_win->chromakey; in omap_vout_new_window()
133 if ((crop->height/win->w.height) >= 2) in omap_vout_new_window()
134 crop->height = win->w.height * 2; in omap_vout_new_window()
136 if ((crop->width/win->w.width) >= 2) in omap_vout_new_window()
137 crop->width = win->w.width * 2; in omap_vout_new_window()
139 if (crop->width > 768) { in omap_vout_new_window()
144 if (crop->height != win->w.height) in omap_vout_new_window()
145 crop->width = 768; in omap_vout_new_window()
149 if ((crop->height/win->w.height) >= 4) in omap_vout_new_window()
150 crop->height = win->w.height * 4; in omap_vout_new_window()
152 if ((crop->width/win->w.width) >= 4) in omap_vout_new_window()
153 crop->width = win->w.width * 4; in omap_vout_new_window()
166 * Returns zero if successful, or -EINVAL if the requested cropping rectangle is
180 if (try_crop.left < 0) { in omap_vout_new_crop()
181 try_crop.width += try_crop.left; in omap_vout_new_crop()
182 try_crop.left = 0; in omap_vout_new_crop()
184 if (try_crop.top < 0) { in omap_vout_new_crop()
185 try_crop.height += try_crop.top; in omap_vout_new_crop()
186 try_crop.top = 0; in omap_vout_new_crop()
188 try_crop.width = (try_crop.width < pix->width) ? in omap_vout_new_crop()
189 try_crop.width : pix->width; in omap_vout_new_crop()
190 try_crop.height = (try_crop.height < pix->height) ? in omap_vout_new_crop()
191 try_crop.height : pix->height; in omap_vout_new_crop()
192 if (try_crop.left + try_crop.width > pix->width) in omap_vout_new_crop()
193 try_crop.width = pix->width - try_crop.left; in omap_vout_new_crop()
194 if (try_crop.top + try_crop.height > pix->height) in omap_vout_new_crop()
195 try_crop.height = pix->height - try_crop.top; in omap_vout_new_crop()
201 return -EINVAL; in omap_vout_new_crop()
204 if (try_crop.height != win->w.height) { in omap_vout_new_crop()
213 vresize = (1024 * try_crop.height) / win->w.height; in omap_vout_new_crop()
219 win->w.height = ((1024 * try_crop.height) / vresize) & ~1; in omap_vout_new_crop()
220 if (win->w.height == 0) in omap_vout_new_crop()
221 win->w.height = 2; in omap_vout_new_crop()
222 if (win->w.height + win->w.top > fbuf->fmt.height) { in omap_vout_new_crop()
227 win->w.height = (fbuf->fmt.height - win->w.top) & ~1; in omap_vout_new_crop()
232 hresize = (1024 * try_crop.width) / win->w.width; in omap_vout_new_crop()
238 win->w.width = ((1024 * try_crop.width) / hresize) & ~1; in omap_vout_new_crop()
239 if (win->w.width == 0) in omap_vout_new_crop()
240 win->w.width = 2; in omap_vout_new_crop()
241 if (win->w.width + win->w.left > fbuf->fmt.width) { in omap_vout_new_crop()
246 win->w.width = (fbuf->fmt.width - win->w.left) & ~1; in omap_vout_new_crop()
251 if ((try_crop.height/win->w.height) >= 2) in omap_vout_new_crop()
252 try_crop.height = win->w.height * 2; in omap_vout_new_crop()
254 if ((try_crop.width/win->w.width) >= 2) in omap_vout_new_crop()
255 try_crop.width = win->w.width * 2; in omap_vout_new_crop()
262 if (try_crop.height != win->w.height) in omap_vout_new_crop()
266 if ((try_crop.height/win->w.height) >= 4) in omap_vout_new_crop()
267 try_crop.height = win->w.height * 4; in omap_vout_new_crop()
269 if ((try_crop.width/win->w.width) >= 4) in omap_vout_new_crop()
270 try_crop.width = win->w.width * 4; in omap_vout_new_crop()
295 win->w.width = crop->width; in omap_vout_new_format()
296 win->w.height = crop->height; in omap_vout_new_format()
297 win->w.left = ((fbuf->fmt.width - win->w.width) >> 1) & ~1; in omap_vout_new_format()
298 win->w.top = ((fbuf->fmt.height - win->w.height) >> 1) & ~1; in omap_vout_new_format()
319 size -= PAGE_SIZE; in omap_vout_alloc_buffer()
340 size -= PAGE_SIZE; in omap_vout_free_buffer()