Re: capture bufffer structure

From: Damien Douxchamps <damien_at_douxchamps.net>
Date: Tue 12 Apr 2005 - 03:11:49 CEST
Message-Id: <1113268309.2547.9.camel@spiff>

Hi aeby,

On Mon, 2005-04-11 at 19:06 +0200, Reto Aebersold wrote:
> Hi all,
>
> I try to make a simple DMA transfer. I'm able to setup the camera and
> grab a frame, but I don't know how to read correctly the RGB pixel
> values from the capture buffer. How is the buffer organized? If I try to
> write the image to a ppm file, I see the captured picture 4 times and
> with incorrect colors.
> How should I write the data correctly to the file? Below the code to
> store the image to a file and my DMA setup.

You can look at the sources or coriander to see how it is handled. Since
the specs might help too I have sent you a copy of the IIDC specs in a
personal email.

Damien

> Thanks a lot,
> aeby
>
> //DMA setup
> int format = FORMAT_SVGA_NONCOMPRESSED_1;
> int mode = MODE_800x600_RGB;
> int frameRate = FRAMERATE_15;
> dc1394_dma_setup_capture( raw1394Handle, cameraNodes[0], channel,
> format, mode, speed, frameRate, 8, 1, device, &dc1394Camera );
>
>
> // Write to file
> fprintf(imagefile,"P6\n%u %u\n# %s\n255\n", dc1394Camera.frame_width,
> dc1394Camera.frame_height, "Test image" );
> for ( int i = 0; i < dc1394Camera.frame_height*dc1394Camera.frame_width;
> i++) {
> unsigned char val = dc1394Camera.capture_buffer[i] >> 16;
> fwrite(&val, 1, 1, imagefile );
> val = dc1394Camera.capture_buffer[i] >> 8;
> fwrite(&val, 1, 1, imagefile );
> val = dc1394Camera.capture_buffer[i];
> fwrite(&val, 1, 1, imagefile );
> }
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> mailing list Linux1394-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux1394-user
>

-- 
  _    Damien 'Takahara' Douxchamps, PhD
 ('-   Post-doctoral investigator
 //\   Image Processing Group, Nara Institute of Science and Technology
 V_/_  http://chihara.aist-nara.ac.jp/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
mailing list Linux1394-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux1394-user
Received on Tue Apr 12 03:14:46 2005

This archive was generated by hypermail 2.1.8 : Mon 02 May 2005 - 09:16:53 CEST