Re: [V4L] Image clipping with mmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Abheek Anand wrote:
> Hi
> A little bit of context for the situation which prompted me to send in
> this mail. I need to perform 'digital zooms' on segments of the image, and
> since the app is a real time thing would like it to be as efficient as
> possible. So the policy i thought of using, since V4L doesnt support this,
> was to scale and crop, which is why i needed to do clip the image.
> 
> I would welcome any ideas on a way around this,

Capture the whole image, but actually use only the area you are intrested
in and ignore everything else.  There are two ways to do that without
copying around the image:

 (1) Pass around the image data as array of char*, each element of the array
     pointing to a scanline.
 (2) Teach your software _not_ to assume that width * depth == bytesperline.
     Pass around two values with the image: bytesperline (the number you have
     to add to get the start of the next scanline) and width (the numper of
     pixels per line you are going actually to use).

This still will bump more data over PCI than you'll need, but it doesn't take
up CPU time.

  Gerd

-- 
Wirtschaftsinformatiker == Leute, die zwar die aktuellen Aktienkurse
jedes Softwareherstellers kennen, aber keines der Produkte auch nur
ansatzweise bedienen können.		-- Benedict Mangelsdorff





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux