Diff of /packages/web/353/php_top/raw.php [000000] .. [a7b9ef] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/packages/web/353/php_top/raw.php
@@ -0,0 +1,48 @@
+<?php
+/*!*******************************************************************************
+*! FILE NAME  : raw.php
+*! DESCRIPTION: 
+*! Copyright (C) 2008 Elphel, Inc
+*! -----------------------------------------------------------------------------**
+*!
+*!  This program is free software: you can redistribute it and/or modify
+*!  it under the terms of the GNU General Public License as published by
+*!  the Free Software Foundation, either version 3 of the License, or
+*!  (at your option) any later version.
+*!
+*!  This program is distributed in the hope that it will be useful,
+*!  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*!  GNU General Public License for more details.
+*!
+*!  You should have received a copy of the GNU General Public License
+*!  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*! -----------------------------------------------------------------------------**
+*!  $Log: raw.php,v $
+*!  Revision 1.1  2009/10/15 19:42:16  oneartplease
+*!  added raw demo files
+*!
+*!  Revision 1.2  2008/08/18 06:00:34  elphel
+*!  Made it acquire one image at a  time
+*!
+*!  Revision 1.1  2008/08/18 03:27:06  kimstig
+*!  Raw image access demo
+*!
+*! 
+*/
+
+    $name = "/dev/ccam_img";
+    elphel_compressor_run() ; /// just to make sure it is on (needed for elphel_wait_frame())
+    elphel_fpga_write(4,4) ;  /// Acquire single frame to video buffer
+    elphel_wait_frame();      /// wait for the next frame to be compressed (just to make sure frame is acquired)
+    $fp = fopen($name, 'rb'); 
+    fseek($fp, 0, SEEK_END);  /// file pointer at the end of the file (to find the file size)
+    $fsize = ftell($fp);      /// get file size
+    fseek($fp, 0, SEEK_SET);  /// rewind to the start of the file
+/// send the headers
+    header("Content-Type: application/octet-stream");
+    header('Content-Disposition: attachment; '.'filename="image.raw"');
+    header("Content-Length: ".$fsize."\n");
+    header("Pragma: no-cache\n");
+    fpassthru($fp);           /// send the raw data itself
+    fclose($fp);