#include <asm/elphel/c313a.h>
#include <asm/elphel/exifa.h>
#include <asm/elphel/autoexp.h>
Include dependency graph for elphel_php.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | PHP_ELPHEL_H 1 |
#define | ELPHEL_G(v) (elphel_globals.v) |
currently ZTS is not defined | |
#define | PHP_ELPHEL_VERSION "1.0" |
#define | PHP_ELPHEL_EXTNAME "elphel" |
#define | phpext_elphel_ptr &elphel_module_entry |
Functions | |
PHP_FUNCTION (elph_hello) | |
this function below is just for experiments | |
PHP_FUNCTION (elphel_get_P_value) | |
PHP_FUNCTION (elphel_set_P_value) | |
Set acquisition/compression parameters. Second half (>=1024) maps to the read parameters (see above). | |
PHP_FUNCTION (elphel_get_P_arr) | |
PHP_FUNCTION (elphel_get_P_warr) | |
Same as above, but reads _written_ parameters, not the output ones. | |
PHP_FUNCTION (elphel_set_P_arr) | |
PHP_FUNCTION (elphel_get_state) | |
Get sensor state, usually 7- sensor is running, compressor is stopped, 8 - compressor is runing. | |
PHP_FUNCTION (elphel_program_sensor) | |
program sesnor/compressor according to the parameters specified. Argument==0 - restart the sensor, 1 - do it "on the fly" | |
PHP_FUNCTION (elphel_compressor_cmd) | |
Send arbitrary command to the FPGA compressor. | |
PHP_FUNCTION (elphel_compressor_reset) | |
Reset FPGA compressor (reinitialize, may need to issue twice in a row). | |
PHP_FUNCTION (elphel_compressor_run) | |
Start FPGA compressor. | |
PHP_FUNCTION (elphel_compressor_stop) | |
Stop FPGA comressor (need to wait when it is stopped). | |
PHP_FUNCTION (elphel_compressor_frame) | |
Acquire one frame to the buffer. | |
PHP_FUNCTION (elphel_is_compressor_idle) | |
return 1 if compressor is actually stopped | |
PHP_FUNCTION (elphel_reset_sensor) | |
reset sensor, and re-initialize it | |
PHP_FUNCTION (elphel_set_fpga_time) | |
PHP_FUNCTION (elphel_get_fpga_time) | |
Get current FPGA time as (double) seconds. | |
PHP_FUNCTION (elphel_flush_cache) | |
PHP_FUNCTION (elphel_white_balance) | |
PHP_FUNCTION (elphel_autoexposure_set) | |
Set autoexposure parameters according to the ones written. | |
PHP_FUNCTION (elphel_autoexposure_get) | |
copy window and exposure parameters to autoexp_state | |
PHP_FUNCTION (elphel_wait_frame) | |
wait for the next frame to be compressed (and related parameters updated | |
PHP_FUNCTION (elphel_fpga_read) | |
Low-level, direct FPGA read/write. | |
PHP_FUNCTION (elphel_fpga_write) | |
PHP_FUNCTION (elphel_trigger) | |
Program trigger parameters, start/restart trigger. | |
PHP_FUNCTION (elphel_gamma) | |
PHP_FUNCTION (elphel_histogram) | |
PHP_FUNCTION (elphel_get_gamma) | |
PHP_FUNCTION (elphel_get_histogram) | |
PHP_FUNCTION (elphel_get_exif_field) | |
PHP_FUNCTION (elphel_set_exif_field) | |
PHP_FUNCTION (elphel_get_exif_elphel) | |
PHP_FUNCTION (elphel_get_circbuf_pointers) | |
PHP_FUNCTION (elphel_update_exif) | |
PHP_MINIT_FUNCTION (elphel) | |
PHP_MSHUTDOWN_FUNCTION (elphel) | |
PHP_RINIT_FUNCTION (elphel) | |
PHP_MINFO_FUNCTION (elphel) | |
Variables | |
int | fd_exif |
int | fd_exifdir |
int | fd_exifmeta |
int | fd_sens |
unsigned long * | imageParamsR |
int | fd_circ |
unsigned long * | ccam_dma_buf |
unsigned long | ccam_dma_buf_len |
int | fd_autoexp |
void * | hist_gamma_mmap |
exif_dir_table_t | exif_dir [ExifKmlNumber] |
here histogram+gamma tables will be mmaped for reading | |
int | exif_size |
store locations of the fields needed for KML generations in the Exif block | |
zend_module_entry | elphel_module_entry |
#define ELPHEL_G | ( | v | ) | (elphel_globals.v) |
currently ZTS is not defined
Definition at line 35 of file elphel_php.h.
Referenced by calcWhiteBalance(), createExifDirectory(), init_sens(), PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
#define PHP_ELPHEL_EXTNAME "elphel" |
Definition at line 39 of file elphel_php.h.
#define PHP_ELPHEL_H 1 |
Definition at line 2 of file elphel_php.h.
#define PHP_ELPHEL_VERSION "1.0" |
#define phpext_elphel_ptr &elphel_module_entry |
Definition at line 83 of file elphel_php.h.
PHP_FUNCTION | ( | elphel_update_exif | ) |
PHP_FUNCTION | ( | elphel_get_circbuf_pointers | ) |
Definition at line 219 of file elphel_php.c.
References buff_size, ccam_dma_buf, CIRCLSEEK_FIRST, CIRCLSEEK_NEXT, CIRCLSEEK_READY, CIRCLSEEK_SCND, ELPHEL_G, and fd_circ.
PHP_FUNCTION | ( | elphel_get_exif_elphel | ) |
Definition at line 249 of file elphel_php.c.
References createExifDirectory(), dst, ELPHEL_G, EXIF_COMPASS_PITCH_ASCII, EXIF_COMPASS_ROLL_ASCII, exif_dir, Exif_GPSInfo_CompassDirection, Exif_GPSInfo_CompassDirection_Index, Exif_GPSInfo_CompassPitch, Exif_GPSInfo_CompassPitch_Index, Exif_GPSInfo_CompassPitchRef, Exif_GPSInfo_CompassPitchRef_Index, Exif_GPSInfo_CompassRoll, Exif_GPSInfo_CompassRoll_Index, Exif_GPSInfo_CompassRollRef, Exif_GPSInfo_CompassRollRef_Index, Exif_GPSInfo_GPSAltitude, Exif_GPSInfo_GPSAltitude_Index, Exif_GPSInfo_GPSAltitudeRef, Exif_GPSInfo_GPSAltitudeRef_Index, Exif_GPSInfo_GPSDateStamp, Exif_GPSInfo_GPSDateStamp_Index, Exif_GPSInfo_GPSLatitude, Exif_GPSInfo_GPSLatitude_Index, Exif_GPSInfo_GPSLatitudeRef, Exif_GPSInfo_GPSLatitudeRef_Index, Exif_GPSInfo_GPSLongitude, Exif_GPSInfo_GPSLongitude_Index, Exif_GPSInfo_GPSLongitudeRef, Exif_GPSInfo_GPSLongitudeRef_Index, Exif_GPSInfo_GPSMeasureMode, Exif_GPSInfo_GPSMeasureMode_Index, Exif_GPSInfo_GPSTimeStamp, Exif_GPSInfo_GPSTimeStamp_Index, Exif_Image_FrameNumber, Exif_Image_FrameNumber_Index, Exif_Image_ImageDescription, Exif_Image_ImageDescription_Index, Exif_Photo_DateTimeOriginal, Exif_Photo_DateTimeOriginal_Index, Exif_Photo_ExposureTime, Exif_Photo_ExposureTime_Index, Exif_Photo_SubSecTimeOriginal, Exif_Photo_SubSecTimeOriginal_Index, fd_exif, exif_dir_table_t::len, exif_dir_table_t::ltag, read, and saferead255.
PHP_FUNCTION | ( | elphel_set_exif_field | ) |
Definition at line 493 of file elphel_php.c.
References ELPHEL_G, fd_exifdir, fd_exifmeta, exif_dir_table_t::ltag, read, and write.
PHP_FUNCTION | ( | elphel_get_exif_field | ) |
Definition at line 460 of file elphel_php.c.
References ELPHEL_G, fd_exif, fd_exifdir, exif_dir_table_t::ltag, and read.
PHP_FUNCTION | ( | elphel_get_histogram | ) |
PHP_FUNCTION | ( | elphel_get_gamma | ) |
PHP_FUNCTION | ( | elphel_histogram | ) |
Definition at line 617 of file elphel_php.c.
References ELPHEL_G, hist_gamma_mmap, HIST_LEN, and memcpy().
PHP_FUNCTION | ( | elphel_gamma | ) |
*********************************** GAMMA ****************************************** Uses gamma table selected by first parameter (0 - R, 1 - G, 2 - GB, 3 - B) and the fraction (0..1.0) to find (and interpolate) the output value
wrong channel
copying array, so they will be "frozen", not updated with the new frames here - no need to copy...
Definition at line 596 of file elphel_php.c.
References ELPHEL_G, gamma, GAMMA_LEN, hist_gamma_mmap, HIST_LEN, and memcpy().
PHP_FUNCTION | ( | elphel_trigger | ) |
Program trigger parameters, start/restart trigger.
Definition at line 1112 of file elphel_php.c.
References ELPHEL_G, fd_sens, and LSEEK_TRIGGER_PGM.
PHP_FUNCTION | ( | elphel_fpga_write | ) |
PHP_FUNCTION | ( | elphel_fpga_read | ) |
PHP_FUNCTION | ( | elphel_wait_frame | ) |
wait for the next frame to be compressed (and related parameters updated
Definition at line 538 of file elphel_php.c.
References CIRCLSEEK_TOWP, CIRCLSEEK_WAIT, ELPHEL_G, and fd_circ.
PHP_FUNCTION | ( | elphel_autoexposure_get | ) |
copy window and exposure parameters to autoexp_state
Definition at line 553 of file elphel_php.c.
References ELPHEL_G, fd_sens, and LSEEK_AUTOEXP_GET.
PHP_FUNCTION | ( | elphel_autoexposure_set | ) |
Set autoexposure parameters according to the ones written.
Definition at line 546 of file elphel_php.c.
References ELPHEL_G, fd_sens, and LSEEK_AUTOEXP_SET.
PHP_FUNCTION | ( | elphel_white_balance | ) |
elphel_white_balance ([double thrsh [, double minfrac [, double rscale [,double bscale]]]]); needs program non_stop to apply calculated results returns 0 if OK, else - negative (error number)
R/G, B/G. G1/G
threshold (0..255) for the "brightest color"
minimal number of pixels above threshold for the brightest color (threshold will be lowered to satisfy min_pixels)
error, negative
apply color correction (if any) to the result
program the calculated values make sure that with small steps the integer values are changed by at least 1
Definition at line 769 of file elphel_php.c.
References bscale, calcWhiteBalance(), ELPHEL_G, imageParamsR, P_ACTUAL_HEIGHT, P_ACTUAL_WIDTH, P_BSCALE, P_GSCALE, P_NUMBER, P_RSCALE, rscale, and s.
PHP_FUNCTION | ( | elphel_flush_cache | ) |
PHP_FUNCTION | ( | elphel_get_fpga_time | ) |
Get current FPGA time as (double) seconds.
Definition at line 1102 of file elphel_php.c.
References ELPHEL_G, fd_sens, imageParamsR, LSEEK_GET_FPGA_TIME, P_MICROSECONDS, and P_SECONDS.
PHP_FUNCTION | ( | elphel_set_fpga_time | ) |
set FPGA clock. Input parameter - (double) seconds (i.e. from 01/01/1970) This clock is used to timestamp each image returns same time rounded to microseconds (as written to FPGA)
Definition at line 1085 of file elphel_php.c.
References ELPHEL_G, fd_sens, imageParamsR, LSEEK_SET_FPGA_TIME, P_MICROSECONDS, P_NUMBER, and P_SECONDS.
PHP_FUNCTION | ( | elphel_reset_sensor | ) |
reset sensor, and re-initialize it
reset circbuf and DMA
reset senosr
re-initialize sensor
Definition at line 1075 of file elphel_php.c.
References ELPHEL_G, fd_sens, init_sens(), JPEG_CMD_RESET, and LSEEK_RESET_SENSOR.
PHP_FUNCTION | ( | elphel_is_compressor_idle | ) |
return 1 if compressor is actually stopped
Definition at line 1066 of file elphel_php.c.
References ELPHEL_G, fd_sens, imageParamsR, LSEEK_CAMSEQSTATE, P_COMPRESSOR_CMD, and state.
PHP_FUNCTION | ( | elphel_compressor_frame | ) |
Acquire one frame to the buffer.
Definition at line 1059 of file elphel_php.c.
References ELPHEL_G, fd_sens, and JPEG_CMD_ACQUIRE.
PHP_FUNCTION | ( | elphel_compressor_stop | ) |
Stop FPGA comressor (need to wait when it is stopped).
Definition at line 1053 of file elphel_php.c.
References ELPHEL_G, fd_sens, and JPEG_CMD_JUST_STOP.
PHP_FUNCTION | ( | elphel_compressor_run | ) |
Start FPGA compressor.
Definition at line 1045 of file elphel_php.c.
References ELPHEL_G, fd_sens, and JPEG_CMD_START.
PHP_FUNCTION | ( | elphel_compressor_reset | ) |
Reset FPGA compressor (reinitialize, may need to issue twice in a row).
Definition at line 1038 of file elphel_php.c.
References ELPHEL_G, fd_sens, and JPEG_CMD_RESET0.
PHP_FUNCTION | ( | elphel_compressor_cmd | ) |
PHP_FUNCTION | ( | elphel_program_sensor | ) |
program sesnor/compressor according to the parameters specified. Argument==0 - restart the sensor, 1 - do it "on the fly"
Definition at line 1014 of file elphel_php.c.
References ELPHEL_G, fd_sens, init_sens(), PROGRAM_SENSOR_0, and PROGRAM_SENSOR_1.
PHP_FUNCTION | ( | elphel_get_state | ) |
Get sensor state, usually 7- sensor is running, compressor is stopped, 8 - compressor is runing.
Definition at line 1008 of file elphel_php.c.
References ELPHEL_G, fd_sens, and LSEEK_CAMSEQSTATE.
PHP_FUNCTION | ( | elphel_set_P_arr | ) |
This function reads associative array and writes values to the camera registers, using "ELPHEL_* constants" to determine register address from the provided key in each key/value pair All non-numerical values are ignored Returns number of values written
Definition at line 891 of file elphel_php.c.
References data, ELPHEL_G, imageParamsR, init_sens(), and P_NUMBER.
PHP_FUNCTION | ( | elphel_get_P_warr | ) |
Same as above, but reads _written_ parameters, not the output ones.
Definition at line 857 of file elphel_php.c.
References data, ELPHEL_G, imageParamsR, init_sens(), and P_NUMBER.
PHP_FUNCTION | ( | elphel_get_P_arr | ) |
This function reads associative array and uses the keys as a template for the result array. If mey is one of the defined P_VALUE names (same as global constant but w/o "ELPHEL_" prefix) then the result array will have element with the same key and the value equal to the value of the camera parameter
Definition at line 828 of file elphel_php.c.
References data, ELPHEL_G, imageParamsR, and init_sens().
PHP_FUNCTION | ( | elphel_set_P_value | ) |
Set acquisition/compression parameters. Second half (>=1024) maps to the read parameters (see above).
Definition at line 989 of file elphel_php.c.
References data, ELPHEL_G, imageParamsR, init_sens(), and P_NUMBER.
PHP_FUNCTION | ( | elphel_get_P_value | ) |
Read value from the sensor/compressor parameters ("read" parameters, verified by the driver), see asm/elphel/c313a.h Second half (>=1024) maps to write parameters (to be used by the camera driver)
Definition at line 975 of file elphel_php.c.
References ELPHEL_G, imageParamsR, init_sens(), and P_NUMBER.
PHP_FUNCTION | ( | elph_hello | ) |
this function below is just for experiments
this below works
Definition at line 525 of file elphel_php.c.
References DEFINE_P_NAMES, ELPHEL_G, and imageParamsR.
PHP_MINFO_FUNCTION | ( | elphel | ) |
PHP_MINIT_FUNCTION | ( | elphel | ) |
Definition at line 1205 of file elphel_php.c.
References DEFINE_P_NAMES, and php_elphel_init_globals().
PHP_MSHUTDOWN_FUNCTION | ( | elphel | ) |
Definition at line 1222 of file elphel_php.c.
References ccam_dma_buf, ELPHEL_G, fd_autoexp, fd_circ, fd_exif, fd_exifdir, fd_exifmeta, fd_sens, hist_gamma_mmap, and imageParamsR.
PHP_RINIT_FUNCTION | ( | elphel | ) |
Definition at line 1198 of file elphel_php.c.
unsigned long* ccam_dma_buf |
Definition at line 24 of file elphel_php.h.
unsigned long ccam_dma_buf_len |
Definition at line 25 of file elphel_php.h.
zend_module_entry elphel_module_entry |
Definition at line 134 of file elphel_php.c.
struct exif_dir_table_t exif_dir[ExifKmlNumber] |
here histogram+gamma tables will be mmaped for reading
Definition at line 28 of file elphel_php.h.
Referenced by createExifDirectory(), and PHP_FUNCTION().
store locations of the fields needed for KML generations in the Exif block
Definition at line 29 of file elphel_php.h.
Referenced by createExifDirectory().
Definition at line 23 of file elphel_php.h.
Referenced by listener_loop(), PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
Definition at line 18 of file elphel_php.h.
Referenced by main(), PHP_FUNCTION(), PHP_MSHUTDOWN_FUNCTION(), and sendImage().
Definition at line 19 of file elphel_php.h.
Referenced by createExifDirectory(), PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
Definition at line 20 of file elphel_php.h.
Referenced by PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
Definition at line 21 of file elphel_php.h.
Referenced by framePointersXML(), init_sens(), PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
void* hist_gamma_mmap |
Definition at line 27 of file elphel_php.h.
Referenced by calcWhiteBalance(), PHP_FUNCTION(), and PHP_MSHUTDOWN_FUNCTION().
unsigned long* imageParamsR |
Definition at line 22 of file elphel_php.h.