head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.52 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.50 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.48 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.46 pkgsrc-2011Q2-base:1.6 pkgsrc-2009Q4:1.6.0.44 pkgsrc-2009Q4-base:1.6 pkgsrc-2008Q4:1.6.0.42 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.40 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.38 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.36 pkgsrc-2008Q2-base:1.6 pkgsrc-2008Q1:1.6.0.34 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.32 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.30 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.28 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.26 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.24 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.22 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.6.0.20 pkgsrc-2006Q2-base:1.6 pkgsrc-2006Q1:1.6.0.18 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.6.0.16 pkgsrc-2005Q4-base:1.6 pkgsrc-2005Q3:1.6.0.14 pkgsrc-2005Q3-base:1.6 pkgsrc-2005Q2:1.6.0.12 pkgsrc-2005Q2-base:1.6 pkgsrc-2005Q1:1.6.0.10 pkgsrc-2005Q1-base:1.6 pkgsrc-2004Q4:1.6.0.8 pkgsrc-2004Q4-base:1.6 pkgsrc-2004Q3:1.6.0.6 pkgsrc-2004Q3-base:1.6 pkgsrc-2004Q2:1.6.0.4 pkgsrc-2004Q2-base:1.6 pkgsrc-2004Q1:1.6.0.2 pkgsrc-2004Q1-base:1.6 pkgsrc-2003Q4:1.5.0.4 pkgsrc-2003Q4-base:1.5 netbsd-1-6-1:1.5.0.2 netbsd-1-6-1-base:1.5 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.3 netbsd-1-5-RELEASE:1.1.1.1 netbsd-1-4-PATCH003:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.6 date 2004.01.26.11.40.57; author jmmv; state dead; branches; next 1.5; 1.5 date 2002.12.21.11.10.01; author wiz; state Exp; branches; next 1.4; 1.4 date 2002.10.08.13.09.52; author jlam; state dead; branches; next 1.3; 1.3 date 2001.03.06.09.39.59; author wiz; state Exp; branches; next 1.2; 1.2 date 2001.02.13.21.45.08; author tron; state dead; branches; next 1.1; 1.1 date 2000.05.07.20.34.13; author tron; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.05.07.20.34.13; author tron; state Exp; branches; next ; desc @@ 1.6 log @fxtv moved to the multimedia category. @ text @$NetBSD: patch-ae,v 1.5 2002/12/21 11:10:01 wiz Exp $ --- imgsav.c.orig Sun Sep 26 16:35:06 1999 +++ imgsav.c @@@@ -29,6 +29,7 @@@@ /* ******************** Include Files ************** */ +#include #include #include #include @@@@ -254,6 +255,96 @@@@ void TVIMGSAVDoSaveTIFF( char filename[] } +void TVIMGSAVDoSavePNG( char filename[], TV_IMAGE *img ) +{ + char errmsg[160]; + png_structp png_ptr; + png_infop info_ptr; + FILE *out; + TV_INT32 linebytes, + y, + pass, + compon; + TV_UINT8 *buf; + + buf = NULL; + if ( img->pix_geom.type != TV_PIXELTYPE_RGB ) { + fprintf( stderr, "Attempt to save non-RGB data as TIFF\n" ); + exit(1); + } + + /* Open output file */ + if ( (out = fopen( filename, "wb" )) == NULL ) { + sprintf( errmsg, "Can't open output file '%s'", filename ); + XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK ); + return; + } + + /* Create PNG data structures and initialize */ + png_ptr = png_create_write_struct + (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png_ptr) { + sprintf( errmsg, "Can't create PNG write structure" ); + XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK ); + return; + } + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) { + png_destroy_write_struct(&png_ptr, NULL); + sprintf( errmsg, "Can't create PNG info structure" ); + XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK ); + return; + } + + if (setjmp(png_jmpbuf(png_ptr))) { + fprintf( stderr, "PNG write error\n" ); + XBell( TVDISPLAY, 100 ); + png_destroy_write_struct( &png_ptr, &info_ptr ); + free( buf ); + fclose( out ); + unlink( filename ); + return; + } + png_init_io(png_ptr, out); + /* fast compression */ + png_set_compression_level(png_ptr, Z_BEST_SPEED); + + /* Setup image format info (chunks) */ + png_set_IHDR(png_ptr, info_ptr, img->geom.w, img->geom.h, + TV_BITS_PER_COMP, PNG_COLOR_TYPE_RGB /* XXX: ? */, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, + PNG_FILTER_TYPE_DEFAULT); + /* and write it */ + png_write_info(png_ptr, info_ptr); + /* flush image out every 50 rows */ + png_set_flush(png_ptr, 50); + + linebytes = img->geom.w * TV_BYTES_PER_PIX; + + if ( (buf = malloc( linebytes )) == NULL ) + TVUTILOutOfMemory(); + + /* Convert & write the image data */ + for ( pass = 0; pass < 1; pass++ ) { + compon = DoRed | DoGreen | DoBlue; + for ( y = 0; y < img->geom.h; y++ ) { + + /* Format scanline */ + TVIMGSAVFmtScanline24bpp( img, y, compon, buf ); + + /* And write it in PNG */ + png_write_row(png_ptr, buf); + } + } + + /* All done. Close up shop and go home */ + png_write_end(png_ptr, NULL); + png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(out); + free( buf ); +} + + void TVIMGSAVDoSavePPM( char filename[], TV_IMAGE *img ) { static char *S_fp_buf = NULL; @@@@ -407,6 +498,9 @@@@ void TVIMGSAVDoSave( char filename[], TV exit(1); } TVIMGSAVDoSaveTIFF( filename, img ); break; + + case TV_STILL_FMT_PNG : + TVIMGSAVDoSavePNG ( filename, img ); break; case TV_STILL_FMT_PPM : TVIMGSAVDoSavePPM ( filename, img ); break; @ 1.5 log @Add PNG support, written by Thomas Klausner. Sent back to maintainer, but development seems to be dormant right now. Bump version to 1.03nb2. @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @buildlink1 -> buildlink2 and make this work with audio/oss. @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.3 2001/03/06 09:39:59 wiz Exp $ d3 3 a5 3 --- Fxtv.orig Mon Feb 12 22:07:05 2001 +++ Fxtv @@@@ -57,7 +57,7 @@@@ d7 113 a119 7 ! Method to override audio device !Fxtv*doSound: true -!Fxtv*dspDevice: /dev/dsp +!Fxtv*dspDevice: /dev/audio !Fxtv*mixerDevice: /dev/mixer !Fxtv*mixerChannel: line ! line, line1/2/3, cd, mic, video @ 1.3 log @Make /dev/audio default audio output device (instead of /dev/dsp). pkg/12339. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Update "fxtv" package to version 1.03. Changes since version 1.02: - When MPEG-encoding audio, force 16-bit signed intermediate AIFFs -- PCM driver doesn't support this format for some cards like AWE32 (Andre Albsmeier ) - Added METEOR_INPUT_DEV3 support (GUI & Fxtv.defaultInput = "dev3") - Flip channel (to last channel set) feature with TVFlipStation() X action routine (Steve Reid ) - Add SOUND_MIXER_VIDEO audio input (Mike Myer) - Mouse include patch (Anonymous) - Makefile update for LOCALBASE (Alexander Langer ) - NetBSD updates (Thomas Klausner ) ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/graphics/fxtv/README.html - Added 'line1', 'line2', 'line3' as valid mixerChannel values - Uncomment all remote code for NetBSD folks - Remove double-link of libvideo.a from Makefile - Support for france channelset (Daniel Dagneaux ) - Changed -aspectlock to -noaspectlock - Fix -default csvideo not working (greedy strstr matches wrong input) - Remove stray printf in YUV capture - Fixes for capturing when path doesn't contain a dot, and pcm driver sound format limitation work-around (Andre Albsmeier ) - OpenBSD changes from vedge and Matthew McNaughton @ text @d1 1 a1 1 $NetBSD: patch-ae,v 1.1 2000/05/07 20:34:13 tron Exp $ d3 11 a13 12 --- tvcapture.c.orig Sat Oct 16 22:48:29 1999 +++ tvcapture.c Sun May 7 22:28:36 2000 @@@@ -36,8 +36,7 @@@@ #include #include #ifdef __NetBSD__ -# include -# include +# include #else # include #endif @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @Initial import of new "fxtv" package: TV display application for Brooktree 848 compatible TV cards @ text @@