packages/web/353/php_top/framepars.php File Reference

Go to the source code of this file.

Functions

 myval ($s)
 printGammaStructure ()
 getGammaStructure ()
 printRawGamma ($page=0)
 printHistogram ($frame)
 printRawHistogram ($needed, $frame)
 printRawFrame ($frame)
 image_table8 ()

Variables

 $imgsrv = "http://".$_SERVER['SERVER_ADDR'].":8081"
 d = D&amp
 frame = N[&ampF[&amp
 flags
 d = D&amp
 frame = N[&ampF[&amp
 test = 1]]</b> - shortcut for the previous command with the flag "n" (force new). test=1 - show a series of images around test command, i.e. <a href="?na=WOI_WIDTH&d=0xa20&frame=next3&test=1">na=WOI_WIDTH&amp
 d = 0xa20&amp
 frame = next3&amp
 test = 1</a> would run compressor
skip frames
skip change WOI_WIDTH frames
in the 
future
skip change WOI_WIDTH frames
in the wait frames and stop
compressor Then show last
acquired images in a table<
/li >< li >< b > 
sa = A&amp
 d = D&amp
i e< ahref="?sa=DEBUG&d=0"> sa = DEBUG&amp
 d
 $address = ""
 $data = ""
 $frame = ""
 $gamma_page = ""
 $flags = 0
 $elp_const = get_defined_constants(true)
 $elp_const = $elp_const["elphel"]
 $test = 0
 $hist_needed = 0
 $prof_template
 $now = elphel_get_frame()-2
 $time_start = elphel_get_fpga_time()
 data is available 2 frames behind
 $prof_raw = array()
 $time_end = elphel_get_fpga_time()
 $prof = array()
 break
case histogram_reverse
 break
case gamma_direct
 break
case gamma_reverse
 break
 $rslt = $xml->asXML()
case cmd
 $framepars_file = fopen("/dev/frameparsall","r")
 Maybe needed to wait for 7, then 0?
 $frame = 0
 $gamma = 57
 $black = 10
 $scale_r = (int) (1.0 * 1024)
 $scale_g = (int) (0.9 * 1024)
 $scale_b = (int) (1.1 * 1024)
 $scale_gb = (int) (0.9 * 1024)
 $gamma_pars
 $frame = elphel_get_frame()
 $scale_g = (int) (1.0 * 1024)
 $scale_b = (int) (1.0 * 1024)
 $scale_gb = (int) (1.0 * 1024)
 $gamma_pars
 $frame = elphel_get_frame()
 $scale_g = (int) (0.9 * 1024)
 $scale_b = (int) (1.1 * 1024)
 $scale_gb = (int) (0.9 * 1024)
 $gamma_pars
 $frame = elphel_get_frame()
 $scale_g = (int) (1.0 * 1024)
 $scale_b = (int) (1.0 * 1024)
 $scale_gb = (int) (1.0 * 1024)
 $gamma_pars
 $frame = elphel_get_frame()
 $jpeg_start = ftell($circbuf_file)
 $header_file = fopen("/dev/jpeghead","r")
 $header_size = ftell($header_file)
 positions to the end
 $header = fread ($header_file,8192)
 positions to the beginning
 $aheader = unpack('C*',$header)
case a
 $rslt = $xml->asXML()
 break
case d
 break
case hist_raw
case hist
case f
 and fall to "frame"
 break
case flags
 break
case n
 break
default __pad3__
 break
case t
 break
case gamma
 break
case gamma_structure
else $data = elphel_get_P_value($address, $frame)


Function Documentation

getGammaStructure (  ) 

Definition at line 730 of file framepars.php.

References SEEK_END.

image_table8 (  ) 

Definition at line 1024 of file framepars.php.

References $imgsrv, $scale, a, height, src, and width.

myval ( s  ) 

******************************************************************************* ! FILE NAME : framepars.php ! DESCRIPTION: Provides control of FPGA compressor/image acquisition ! to the circular buffer (circbuf) ! Copyright (C) 2007-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
framepars.php,v
! Revision 1.1.1.1 2008/11/27 20:04:03 elphel ! ! ! Revision 1.26 2008/11/27 09:29:22 elphel ! new file - diag_utils.php that includes somewhat cleaned-up version of utilities from framepars.php. That file installation is moved to attic ! ! Revision 1.25 2008/11/17 23:42:04 elphel ! changed myval() to accept numbers in "" ! ! Revision 1.24 2008/11/13 05:40:45 elphel ! 8.0.alpha16 - modified histogram storage, profiling ! ! Revision 1.23 2008/11/04 17:45:08 elphel ! added interface for testing new functions: elphel_gamma(), elphel_reverse_gamma(), elphel_histogram(), elphel_reverse_histogram(); links to individual gamma pages in the cache from "framepars.php?gamma_structure" ! ! Revision 1.22 2008/10/31 18:26:32 elphel ! Adding support for constants like SENSOR_REGS32 (defined constant plus 32 to simplify referencing sensor registers from PHP ! ! Revision 1.21 2008/10/29 04:18:28 elphel ! v.8.0.alpha10 made a separate structure for global parameters (not related to particular frames in a frame queue) ! ! Revision 1.20 2008/10/28 07:03:03 elphel ! reports error when wrong constant name is entered (before in silently used 0) ! ! Revision 1.19 2008/10/23 18:26:15 elphel ! Fixed percentile calculations in histograms ! ! Revision 1.18 2008/10/23 08:11:58 elphel ! support for histograms testing ! ! Revision 1.17 2008/10/22 03:47:45 elphel ! minor ! ! Revision 1.16 2008/10/21 21:29:15 elphel ! using support fro xml output in imgsrv ! ! Revision 1.15 2008/10/21 04:22:57 elphel ! XTRA_FPGA=1000 is included in cmd=init ! ! Revision 1.14 2008/10/19 07:01:24 elphel ! updated to use elphel_skip_frames(); ! ! Revision 1.13 2008/10/18 06:16:49 elphel ! changing test modes, init does not start compressor ! ! Revision 1.12 2008/10/15 22:28:56 elphel ! snapshot 8.0.alpha2 ! ! Revision 1.11 2008/10/13 16:57:18 elphel ! switched to ELPHEL_* defined constants from locally defined ones ! ! Revision 1.10 2008/10/13 04:48:25 elphel ! added sample gamma initialization to cmd=init ! ! Revision 1.8 2008/10/11 18:46:07 elphel ! snapshot ! ! Revision 1.7 2008/10/10 17:06:59 elphel ! just a snapshot ! ! Revision 1.6 2008/10/06 08:31:08 elphel ! snapshot, first images ! ! Revision 1.5 2008/10/05 05:13:33 elphel ! snapshot003 ! ! Revision 1.4 2008/10/04 16:10:12 elphel ! snapshot ! ! Revision 1.3 2008/09/28 00:31:57 elphel ! snapshot ! ! Revision 1.2 2008/09/25 00:58:12 elphel ! snapshot ! ! Revision 1.1 2008/09/22 22:55:50 elphel ! snapshot !

Definition at line 103 of file framepars.php.

References $s.

printGammaStructure (  ) 

Definition at line 680 of file framepars.php.

References getGammaStructure().

printHistogram ( frame  ) 

Definition at line 908 of file framepars.php.

References $a, and $frame.

printRawFrame ( frame  ) 

Definition at line 990 of file framepars.php.

References $a, and $frame.

printRawGamma ( page = 0  ) 

Definition at line 777 of file framepars.php.

References $a, $black, $d, $gamma, and $scale.

printRawHistogram ( needed,
frame 
)

Definition at line 941 of file framepars.php.

References $a, $d, and $frame.


Variable Documentation

$address = ""

Definition at line 145 of file framepars.php.

$aheader = unpack('C*',$header)

Definition at line 437 of file framepars.php.

Referenced by showJpegHeader().

$black = 10

Definition at line 355 of file framepars.php.

Referenced by addGammas(), and printRawGamma().

else $data = elphel_get_P_value($address, $frame)

Definition at line 612 of file framepars.php.

$data = ""

Definition at line 146 of file framepars.php.

$elp_const = $elp_const["elphel"]

Definition at line 151 of file framepars.php.

$elp_const = get_defined_constants(true)

Definition at line 150 of file framepars.php.

$flags = 0

Definition at line 149 of file framepars.php.

$frame = elphel_get_frame()

Definition at line 415 of file framepars.php.

$frame = elphel_get_frame()

Definition at line 399 of file framepars.php.

$frame = elphel_get_frame()

Definition at line 383 of file framepars.php.

$frame = elphel_get_frame()

Definition at line 367 of file framepars.php.

$frame = 0

Definition at line 280 of file framepars.php.

$frame = ""

Definition at line 147 of file framepars.php.

Referenced by decodeSet(), decodeTodo(), encodeTodo(), printHistogram(), printRawFrame(), printRawHistogram(), showImgData(), showLastImages(), and showSequence().

$framepars_file = fopen("/dev/frameparsall","r")

Maybe needed to wait for 7, then 0?

Definition at line 272 of file framepars.php.

$gamma = 57

Definition at line 354 of file framepars.php.

Referenced by addGammas(), and printRawGamma().

$gamma_page = ""

Definition at line 148 of file framepars.php.

$gamma_pars

Initial value:

array("GTAB_R"   => ($black<<24) | ($gamma << 16) | ($scale_r  & 0xffff),
                             "GTAB_G"   => ($black<<24) | ($gamma << 16) | ($scale_g  & 0xffff),
                             "GTAB_B"   => ($black<<24) | ($gamma << 16) | ($scale_b  & 0xffff),
                             "GTAB_GB"  => ($black<<24) | ($gamma << 16) | ($scale_gb & 0xffff))

Definition at line 411 of file framepars.php.

$gamma_pars

Initial value:

array("GTAB_R"   => ($black<<24) | ($gamma << 16) | ($scale_r  & 0xffff),
                             "GTAB_G"   => ($black<<24) | ($gamma << 16) | ($scale_g  & 0xffff),
                             "GTAB_B"   => ($black<<24) | ($gamma << 16) | ($scale_b  & 0xffff),
                             "GTAB_GB"  => ($black<<24) | ($gamma << 16) | ($scale_gb & 0xffff))

Definition at line 395 of file framepars.php.

$gamma_pars

Initial value:

array("GTAB_R"   => ($black<<24) | ($gamma << 16) | ($scale_r  & 0xffff),
                             "GTAB_G"   => ($black<<24) | ($gamma << 16) | ($scale_g  & 0xffff),
                             "GTAB_B"   => ($black<<24) | ($gamma << 16) | ($scale_b  & 0xffff),
                             "GTAB_GB"  => ($black<<24) | ($gamma << 16) | ($scale_gb & 0xffff))

Definition at line 379 of file framepars.php.

$gamma_pars

Initial value:

array("GTAB_R"   => ($black<<24) | ($gamma << 16) | ($scale_r  & 0xffff),
                             "GTAB_G"   => ($black<<24) | ($gamma << 16) | ($scale_g  & 0xffff),
                             "GTAB_B"   => ($black<<24) | ($gamma << 16) | ($scale_b  & 0xffff),
                             "GTAB_GB"  => ($black<<24) | ($gamma << 16) | ($scale_gb & 0xffff))

Definition at line 363 of file framepars.php.

$header = fread ($header_file,8192)

positions to the beginning

Definition at line 434 of file framepars.php.

Referenced by parse_array(), and showJpegHeader().

$header_file = fopen("/dev/jpeghead","r")

Definition at line 427 of file framepars.php.

Referenced by showJpegHeader().

$header_size = ftell($header_file)

positions to the end

Definition at line 431 of file framepars.php.

Referenced by showJpegHeader().

$hist_needed = 0

Definition at line 153 of file framepars.php.

$imgsrv = "http://".$_SERVER['SERVER_ADDR'].":8081"

Definition at line 108 of file framepars.php.

$jpeg_start = ftell($circbuf_file)

Definition at line 424 of file framepars.php.

Referenced by showJpegHeader().

$now = elphel_get_frame()-2

Definition at line 169 of file framepars.php.

Referenced by profileShow().

$prof = array()

Definition at line 176 of file framepars.php.

Referenced by profileShow().

$prof_raw = array()

Definition at line 171 of file framepars.php.

Referenced by profileShow().

$prof_template

Initial value:

array(
                 "PROFILE00"=>0,"PROFILE01"=>0,
                 "PROFILE02"=>0,"PROFILE03"=>0,
                 "PROFILE04"=>0,"PROFILE05"=>0,
                 "PROFILE06"=>0,"PROFILE07"=>0,
                 "PROFILE08"=>0,"PROFILE09"=>0,
                 "PROFILE10"=>0,"PROFILE11"=>0,
                 "PROFILE12"=>0,"PROFILE13"=>0,
                 "PROFILE14"=>0,"PROFILE15"=>0
)

Definition at line 159 of file framepars.php.

Referenced by profileShow().

$rslt = $xml->asXML()

Definition at line 486 of file framepars.php.

$rslt = $xml->asXML()

Definition at line 249 of file framepars.php.

$scale_b = (int) (1.0 * 1024)

Definition at line 406 of file framepars.php.

$scale_b = (int) (1.1 * 1024)

Definition at line 390 of file framepars.php.

$scale_b = (int) (1.0 * 1024)

Definition at line 374 of file framepars.php.

$scale_b = (int) (1.1 * 1024)

Definition at line 358 of file framepars.php.

$scale_g = (int) (1.0 * 1024)

Definition at line 405 of file framepars.php.

$scale_g = (int) (0.9 * 1024)

Definition at line 389 of file framepars.php.

$scale_g = (int) (1.0 * 1024)

Definition at line 373 of file framepars.php.

$scale_g = (int) (0.9 * 1024)

Definition at line 357 of file framepars.php.

$scale_gb = (int) (1.0 * 1024)

Definition at line 407 of file framepars.php.

$scale_gb = (int) (0.9 * 1024)

Definition at line 391 of file framepars.php.

$scale_gb = (int) (1.0 * 1024)

Definition at line 375 of file framepars.php.

$scale_gb = (int) (0.9 * 1024)

Definition at line 359 of file framepars.php.

$scale_r = (int) (1.0 * 1024)

Definition at line 356 of file framepars.php.

$test = 0

Definition at line 152 of file framepars.php.

Referenced by checkSclSda().

$time_end = elphel_get_fpga_time()

Definition at line 175 of file framepars.php.

Referenced by profileShow().

$time_start = elphel_get_fpga_time()

data is available 2 frames behind

Definition at line 170 of file framepars.php.

Referenced by profileShow().

default __pad3__

Definition at line 552 of file framepars.php.

case a

Definition at line 471 of file framepars.php.

Referenced by Socket::_is_multicast(), createDefaultConfig(), exif_getutc(), image_table8(), jpeg_htable_fpga_encode(), jpeg_session_start(), main(), Streamer::Main(), nand_correct_data(), nand_trans_result(), png_do_gamma(), png_read_filter_row(), printDefaultPage(), processGet(), profileShow(), run_daemon(), showUsage(), and String::split_to_list().

break

Definition at line 562 of file framepars.php.

break

Definition at line 558 of file framepars.php.

break

Definition at line 554 of file framepars.php.

break

Definition at line 550 of file framepars.php.

break

Definition at line 546 of file framepars.php.

break

Definition at line 537 of file framepars.php.

break

Definition at line 497 of file framepars.php.

break

Definition at line 493 of file framepars.php.

break

Definition at line 247 of file framepars.php.

break

Definition at line 241 of file framepars.php.

break

Definition at line 235 of file framepars.php.

break

Definition at line 229 of file framepars.php.

case cmd

Definition at line 259 of file framepars.php.

Referenced by cris_ide_start_dma(), crisv32_eth_get_mdio_reg(), crisv32_eth_reset_tranceiver(), crisv32_eth_set_mdio_reg(), main(), and parse_cmd().

case d

Definition at line 496 of file framepars.php.

d

Initial value:

0</a> - turn debug logging off<br/></li>
    <li><b>frame=F</b> - Print raw frame parameters data for frame <b>F</b>. Valid values 0..7 and -1 (that will show function triggers instead of the parameter values). Frame 0 also hold "static" parameters - when written with "s" flags they only go there other parameters propagate to the future frames during frame interrupts.</li>
    <li><b>"gamma_structure</b> - show structure of the gamma tables cache. Gamma cache consists of 255 pages and index one, based on linked lists. It is designed to minimize floating point calcualions (made outside of the kernel) and facilitate scaling (integer) needed fro white balancing. So the "prototype" (non-scaled curves are cached in the top list with connected lists of scaled derivatives. For each table there are several sub-tables that can be requested (and cached after that) - reverse table (for histogram processing) and FPGA table (formatted to be written to the FPGA). Each gamma "type" is marked with a 16-bit hash, by default calculated as gamma value (in percents, 8 bits) and black level shift (fat zero), but it is possible to load arbitrary table and mark it with unique 16-bit hash16. When the curve is loaded it can be send to any of the 4 color channels with arbitrary 16-bit scale (0x400 is 1.0) by writing to one of GTAB_R, GTAB_G, GTAB_GB or GTAB_B registers (16 higher bits - hash16, lower 16 - scale, it is possible to change any set of bytes of the 32-bit word adding byte masks to the flags     ELPHEL_CONST_FRAMEPAIR_BYTE0, ELPHEL_CONST_FRAMEPAIR_BYTE1, ELPHEL_CONST_FRAMEPAIR_BYTE2, ELPHEL_CONST_FRAMEPAIR_BYTE3, ELPHEL_CONST_FRAMEPAIR_WORD0,FRAMEPAIR_WORD1.</li>
    <li><b>"gamma=G</b> - show raw data of the gamma page <b>G</b> (page 0 is a root)</li>
  </ul>
USAGE

Definition at line 136 of file framepars.php.

d = D&amp

Definition at line 136 of file framepars.php.

d = 0xa20&amp

Definition at line 135 of file framepars.php.

d = D&amp

Definition at line 135 of file framepars.php.

d = D&amp

Definition at line 132 of file framepars.php.

Referenced by change_broadcast(), change_gateway(), change_netmask(), changeIP(), encode_time(), exif_getutc(), fpga_io_ioctl(), gamma_calc_scaled(), jtag_write_bits(), load_defaults(), main(), mainJavascript(), memcpy(), mt9x001_pgm_window_common(), parse(), parse_args(), parse_cmd(), pgm_recalcseq(), PHP_FUNCTION(), png_do_gamma(), png_do_write_interlace(), png_set_dither(), Audio::process(), read_broadcast(), read_gateway(), read_ip(), read_netmask(), snd_config_set_ascii(), snd_config_walk(), snd_func_getenv(), snd_func_igetenv(), splitConstantName(), udp_init4(), write_coil_form(), and write_png().

case f

and fall to "frame"

Definition at line 505 of file framepars.php.

Referenced by begin_wave(), camogm_free(), camogm_status(), create_elphel353_kdevelop(), exif_getutc(), F_add(), F_div(), F_mul(), F_sub(), listParams(), load_defaults(), main(), Video::process(), Audio::process(), readParam(), RTP_Stream::thread(), write_sdp(), and writeParam().

case flags

Definition at line 545 of file framepars.php.

flags

Initial value:

G]]</b> - Set parameter <b>A</b> with data<b>D</b> (hex data may be used).
               Address can also use defined constant names (w/o "ELPHEL_" prefix). <b>F</b> - absolute frame number (most likely will fail) or one of
               <b>this</b>, <b>next</b>, <b>next2</b>, <b>next3</b>, <b>next4</b>, <b>next5</b>, <b>next6</b> (next4 is usually safe to use). <G> - flags/modifiers - numeric value or "s" - static/not frame-related parameter or "n" - new parameter (force to be treated as new even if the value is the same as was before) </li>
    <li><b>na=A&amp

Definition at line 132 of file framepars.php.

frame = next3&amp

Definition at line 135 of file framepars.php.

frame = N[&ampF[&amp

Definition at line 135 of file framepars.php.

frame = N[&ampF[&amp

Definition at line 132 of file framepars.php.

skip frames

Definition at line 135 of file framepars.php.

Referenced by createDefaultConfig().

skip change WOI_WIDTH frames in the future

Definition at line 135 of file framepars.php.

Referenced by PHP_FUNCTION(), and showUsage().

case gamma

Definition at line 561 of file framepars.php.

case gamma_direct

Definition at line 237 of file framepars.php.

Referenced by gammaReverse(), PHP_FUNCTION(), and showUsage().

case gamma_reverse

Definition at line 243 of file framepars.php.

Referenced by gammaReverse(), PHP_FUNCTION(), and showUsage().

case gamma_structure

Definition at line 565 of file framepars.php.

case hist

Definition at line 502 of file framepars.php.

case hist_raw

Definition at line 499 of file framepars.php.

case histogram_reverse

Definition at line 231 of file framepars.php.

Referenced by showUsage().

case n

Definition at line 549 of file framepars.php.

Referenced by _snd_config_evaluate(), _snd_config_make(), _snd_config_make_add(), _snd_config_save_leaves(), _snd_config_search(), conf_load(), count_zero_samples(), F_add(), F_and(), F_assoc(), F_assq(), F_compare_strings(), F_concat(), F_div(), F_format(), F_mul(), F_nth(), F_or(), F_princ(), F_progn(), F_rassoc(), F_rassq(), F_setq(), F_sub(), F_unsetq(), find_module(), flush_window(), fpga_io_write(), i2cread16(), main(), nand_rw(), parse_args(), parse_array_def(), parse_def(), parse_special(), parse_value(), recursive_add_host_directory(), rflflash_nand_rw(), seq_receive(), snd_config_add(), snd_config_hook_load(), snd_config_hook_load_for_all_cards(), snd_config_hooks(), snd_config_hooks_call(), snd_config_substitute(), snd_func_card_driver(), snd_func_card_id(), snd_func_concat(), snd_func_getenv(), snd_func_pcm_args_by_class(), snd_func_pcm_id(), snd_func_refer(), String::split_list_to_map(), strip_events(), x353raw_fpn_readline(), x353raw_fpn_writeline(), x353raw_frame_readline(), and x353raw_frame_writeline().

i e<ahref="?sa=DEBUG&d=0"> sa = DEBUG&amp

Definition at line 136 of file framepars.php.

skip change WOI_WIDTH frames in the wait frames and stop compressor Then show last acquired images in a table</li><li><b> sa = A&amp

Definition at line 136 of file framepars.php.

Referenced by fpga_io_table_write(), fsdram_read(), fsdram_write(), main(), pgm_memcompressor(), pgm_memsensor(), x353raw_fpn_readline(), x353raw_fpn_writeline(), x353raw_frame_readline(), and x353raw_frame_writeline().

case t

Definition at line 557 of file framepars.php.

Referenced by Audio::Audio(), audio_init(), Video::capture(), conf_save(), ext353__ioctl(), handle_request(), handle_SETUP(), main(), Streamer::Main(), parse_client_data(), png_do_swap(), png_set_dither(), Socket::Socket(), stream_status_to_file(), streamer_start(), usleepFPGA(), and xstrdup().

test = 1</a> would run compressor

Definition at line 135 of file framepars.php.

test = 1]]</b> - shortcut for the previous command with the flag "n" (force new). test=1 - show a series of images around test command, i.e. <a href="?na=WOI_WIDTH&d=0xa20&frame=next3&test=1">na=WOI_WIDTH&amp

Definition at line 135 of file framepars.php.


Generated on Fri Nov 28 00:08:38 2008 for elphel by  doxygen 1.5.1