apps/png/libpng/pngtest.c File Reference

#include "png.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

Include dependency graph for pngtest.c:

Go to the source code of this file.

Defines

#define READFILE(file, data, length, check)   check=(png_size_t)fread(data,(png_size_t)1,length,file)
#define WRITEFILE(file, data, length, check)   check=(png_size_t)fwrite(data,(png_size_t)1, length, file)
#define FCLOSE(file)   fclose(file)
#define PNG_DEBUG   0
#define SINGLE_ROWBUF_ALLOC
#define STDERR   stdout

Typedefs

typedef version_1_2_8 your_png_h_is_not_version_1_2_8

Functions

int test_one_file PNGARG ((PNG_CONST char *inname, PNG_CONST char *outname))
void read_row_callback (png_structp png_ptr, png_uint_32 row_number, int pass)
void write_row_callback (png_structp png_ptr, png_uint_32 row_number, int pass)
void count_filters (png_structp png_ptr, png_row_infop row_info, png_bytep data)
void count_zero_samples (png_structp png_ptr, png_row_infop row_info, png_bytep data)
int test_one_file (PNG_CONST char *inname, PNG_CONST char *outname)
int main (int argc, char *argv[])

Variables

static int tIME_chunk_present = 0
static char tIME_string [30] = "no tIME chunk present in file"
static int verbose = 0
static int status_pass = 1
static int status_dots_requested = 0
static int status_dots = 1
static png_uint_32 filters_used [256]
static png_uint_32 zero_samples
static int wrote_question = 0
static PNG_CONST char * inname = "pngtest.png"
static PNG_CONST char * outname = "pngout.png"


Define Documentation

#define FCLOSE ( file   )     fclose(file)

Definition at line 52 of file pngtest.c.

Referenced by test_one_file().

#define PNG_DEBUG   0

Definition at line 65 of file pngtest.c.

#define READFILE ( file,
data,
length,
check   )     check=(png_size_t)fread(data,(png_size_t)1,length,file)

Definition at line 48 of file pngtest.c.

Referenced by test_one_file().

#define SINGLE_ROWBUF_ALLOC

Definition at line 69 of file pngtest.c.

Referenced by test_one_file().

#define STDERR   stdout

Definition at line 112 of file pngtest.c.

Referenced by main(), and test_one_file().

#define WRITEFILE ( file,
data,
length,
check   )     check=(png_size_t)fwrite(data,(png_size_t)1, length, file)

Definition at line 50 of file pngtest.c.


Typedef Documentation

typedef version_1_2_8 your_png_h_is_not_version_1_2_8

Definition at line 1554 of file pngtest.c.


Function Documentation

void count_filters ( png_structp  png_ptr,
png_row_infop  row_info,
png_bytep  data 
)

Definition at line 176 of file pngtest.c.

Referenced by test_one_file().

void count_zero_samples ( png_structp  png_ptr,
png_row_infop  row_info,
png_bytep  data 
)

Definition at line 198 of file pngtest.c.

References n, png_bytep, and png_uint_32.

Referenced by test_one_file().

int main ( int  argc,
char *  argv[] 
)

*************************************************************************** ! FILE NAME : autoexposure.c ! DESCRIPTION: Daemon to adjust camera exposure and white balance ! 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
autoexposure.c,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.16 2008/11/18 19:30:16 elphel ! Added initialization of the "next" frame - otherwise it wait _very_ long if the camera frame number is reset ! ! Revision 1.15 2008/11/15 23:08:24 elphel ! 8.0.alpha17 - split autoexposure source file ! ! Revision 1.14 2008/11/15 07:05:38 elphel ! implemented analog gain control (in addition to gammas) while while balancing ! ! Revision 1.13 2008/11/15 03:10:13 elphel ! Some parameters renamed, reassigned. ! ! Revision 1.12 2008/11/14 07:13:32 elphel ! Added gammaReverse() and gammaDirect() functions, TODO lists, bug fixes ! ! Revision 1.11 2008/11/14 01:01:59 elphel ! cleared debug output ! ! Revision 1.10 2008/11/13 05:40:45 elphel ! 8.0.alpha16 - modified histogram storage, profiling ! ! Revision 1.9 2008/11/08 05:52:21 elphel ! debug feature ! ! Revision 1.8 2008/11/04 17:40:34 elphel ! comment typos ! ! Revision 1.7 2008/11/02 00:32:35 elphel ! added TODO ! ! Revision 1.6 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.5 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.4 2008/10/28 07:05:12 elphel ! implemented white balance, HDR mode (1/1 and 2/2) ! ! Revision 1.3 2008/10/26 05:55:38 elphel ! snapshot ! ! Revision 1.2 2008/10/25 19:49:15 elphel ! 8.0.alpha8 - added autoexposure to the installation ! ! Revision 1.1 2008/10/24 00:34:12 elphel ! initial release !

define X313_CHN_DISALL_D 0xaa0 // disable all channels, do not modify refresh or memory as a whole define X313_SDRAM_OFF_D 0xaaa // disable all chennels, refresh and memory itself define X313_SDRAM_ON_D 0xaaf // will disable all channels but refresh

test system memory - now - just for intereference, not a real memory test

allocate memory

deallocate memory

Definition at line 1308 of file pngtest.c.

References exit, filters_used, png_access_version_number(), png_get_copyright(), png_get_header_version(), PNG_HEADER_VERSION_STRING, png_libpng_ver, PNG_LIBPNG_VER, PNG_LIBPNG_VER_STRING, PNG_READ_USER_TRANSFORM_SUPPORTED, png_sizeof, status_dots_requested, STDERR, test_one_file(), tIME_chunk_present, tIME_string, verbose, and zero_samples.

int test_one_file PNGARG ( (PNG_CONST char *inname, PNG_CONST char *outname  ) 

void read_row_callback ( png_structp  png_ptr,
png_uint_32  row_number,
int  pass 
)

Definition at line 128 of file pngtest.c.

References PNG_UINT_31_MAX, and stdout.

Referenced by test_one_file().

int test_one_file ( PNG_CONST char *  inname,
PNG_CONST char *  outname 
)

Definition at line 599 of file pngtest.c.

References background, bit_depth, blue_x, blue_y, color_type, compression_type, count_filters(), count_zero_samples(), FCLOSE, filters_used, gamma, green_x, green_y, height, hist, inbuf, int, intent, location, mod_time, nparams, num_palette, num_text, num_trans, num_unknowns, offset_x, offset_y, palette, params, png_bytep, png_bytep_NULL, png_bytepp_NULL, png_convert_to_rfc1123(), png_create_info_struct(), png_create_read_struct(), png_create_read_struct_2(), png_create_write_struct(), png_create_write_struct_2(), png_debug, png_debug1, png_debug2, png_destroy_info_struct(), png_destroy_read_struct(), png_destroy_write_struct(), png_error_ptr_NULL, png_free(), png_free_data(), PNG_FREE_UNKN, png_get_bKGD(), png_get_cHRM(), png_get_cHRM_fixed(), png_get_gAMA(), png_get_gAMA_fixed(), png_get_hIST(), png_get_iCCP(), png_get_IHDR(), png_get_image_height(), png_get_image_width(), png_get_oFFs(), png_get_pCAL(), png_get_pHYs(), png_get_PLTE(), png_get_rowbytes(), png_get_sBIT(), png_get_sCAL(), png_get_sRGB(), png_get_text(), png_get_tIME(), png_get_tRNS(), png_get_unknown_chunks(), PNG_HANDLE_CHUNK_ALWAYS, PNG_HANDLE_CHUNK_IF_SAFE, png_init_io(), PNG_INTERLACE_NONE, png_jmpbuf, PNG_LIBPNG_VER_STRING, png_malloc(), png_memcmp, png_memcpy, png_read_end(), png_read_info(), png_read_rows(), png_read_status_ptr_NULL, png_set_bKGD(), png_set_cHRM(), png_set_cHRM_fixed(), png_set_error_fn(), png_set_gAMA(), png_set_gAMA_fixed(), png_set_hIST(), png_set_iCCP(), png_set_IHDR(), png_set_interlace_handling(), png_set_keep_unknown_chunks(), png_set_oFFs(), png_set_pCAL(), png_set_pHYs(), png_set_PLTE(), png_set_read_fn(), png_set_read_status_fn(), png_set_read_user_transform_fn(), png_set_sBIT(), png_set_sCAL(), png_set_sRGB(), png_set_text(), png_set_tIME(), png_set_tRNS(), png_set_unknown_chunk_location(), png_set_unknown_chunks(), png_set_write_fn(), png_set_write_status_fn(), png_set_write_user_transform_fn(), png_size_t, png_sizeof, png_strcpy, png_uint_32, png_voidp_NULL, png_write_end(), PNG_WRITE_FLUSH_SUPPORTED, png_write_info(), PNG_WRITE_INTERLACING_SUPPORTED, png_write_rows(), png_write_status_ptr_NULL, PNG_ZBUF_SIZE, profile, proflen, purpose, read_row_callback(), READFILE, red_x, red_y, res_x, res_y, sig_bit, SINGLE_ROWBUF_ALLOC, status_dots_requested, STDERR, text_ptr, tIME_chunk_present, tIME_string, trans, trans_values, type, unit, unit_type, units, unknowns, verbose, white_x, white_y, width, write_row_callback(), wrote_question, X0, X1, and zero_samples.

Referenced by main().

void write_row_callback ( png_structp  png_ptr,
png_uint_32  row_number,
int  pass 
)

Definition at line 155 of file pngtest.c.

References PNG_UINT_31_MAX, and stdout.

Referenced by test_one_file().


Variable Documentation

png_uint_32 filters_used[256] [static]

Definition at line 166 of file pngtest.c.

Referenced by main(), and test_one_file().

PNG_CONST char* inname = "pngtest.png" [static]

Definition at line 1303 of file pngtest.c.

PNG_CONST char* outname = "pngout.png" [static]

Definition at line 1304 of file pngtest.c.

int status_dots = 1 [static]

Definition at line 117 of file pngtest.c.

int status_dots_requested = 0 [static]

Definition at line 116 of file pngtest.c.

Referenced by main(), and test_one_file().

int status_pass = 1 [static]

Definition at line 115 of file pngtest.c.

int tIME_chunk_present = 0 [static]

Definition at line 98 of file pngtest.c.

Referenced by main(), and test_one_file().

char tIME_string[30] = "no tIME chunk present in file" [static]

Definition at line 99 of file pngtest.c.

Referenced by main(), and test_one_file().

int verbose = 0 [static]

Definition at line 102 of file pngtest.c.

int wrote_question = 0 [static]

Definition at line 286 of file pngtest.c.

Referenced by test_one_file().

png_uint_32 zero_samples [static]

Definition at line 187 of file pngtest.c.

Referenced by main(), and test_one_file().


Generated on Fri Nov 28 00:07:17 2008 for elphel by  doxygen 1.5.1