Re: YUYV capture

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



Woohoo! I did it!

I have seen other postings on cropping before, so if anyone is interested to
see how I did it, here's the code snippet:

In my case: (x,y)=(72,56) and (width,height)=(660,382)

for (i = y; i < (y + height); i++)
{
    for (j = (x * 2); j < ((x + width) * 2); j++)
    {
        data[((i - y) * (width * 2)) + ((j - (x * 2)) + 1)] =
            temp[(i * (width * 2)) + (j + 1)];
    }
}

This little bit of code copies the rectangle that we are interested in from
the "temp" buffer into the beginning of the "data" buffer. The "temp" buffer
is the full frame, as captured by v4l. The "data" buffer is a user allocated
buffer to hold the "interesting" data from the full frame.

I hope that someone will find this useful.

/G





[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