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