Update of /cvsroot/pure-data/externals/pdp/modules/image_io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2628/modules/image_io
Modified Files: pdp_glx.c pdp_qt.c pdp_v4l.c pdp_xv.c Log Message: pdp current darcs merge
Index: pdp_xv.c =================================================================== RCS file: /cvsroot/pure-data/externals/pdp/modules/image_io/pdp_xv.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdp_xv.c 16 Dec 2005 01:05:33 -0000 1.3 --- pdp_xv.c 1 Sep 2006 13:45:30 -0000 1.4 *************** *** 154,157 **** --- 154,158 ---- static void pdp_xv_bang_callback(t_pdp_xv *x) { + /* receive events + send to outputs */ t_pdp_list *eventlist = pdp_xwindow_get_eventlist(x->x_xwin);
Index: pdp_glx.c =================================================================== RCS file: /cvsroot/pure-data/externals/pdp/modules/image_io/pdp_glx.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdp_glx.c 16 Dec 2005 01:05:33 -0000 1.3 --- pdp_glx.c 1 Sep 2006 13:45:30 -0000 1.4 *************** *** 73,76 **** --- 73,77 ---- int x_initialized; int x_autocreate; + int x_interpol;
} t_pdp_glx; *************** *** 376,381 **** glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
--- 377,391 ---- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); ! ! if (x->x_interpol){ ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); ! } ! else { ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); ! glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); ! } ! ! glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
*************** *** 486,489 **** --- 496,502 ---- }
+ static void pdp_glx_interpol(t_pdp_glx *x, t_float finterpol){ + x->x_interpol = (int)finterpol; + }
*************** *** 526,529 **** --- 539,544 ---- x->x_tex_height = 64;
+ x->x_interpol = 1; + //pdp_glx_create(x);
*************** *** 564,567 **** --- 579,583 ---- class_addmethod(pdp_glx_class, (t_method)pdp_glx_fullscreen, gensym("fullscreen"), A_NULL); class_addmethod(pdp_glx_class, (t_method)pdp_glx_moveresize, gensym("posdim"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL); + class_addmethod(pdp_glx_class, (t_method)pdp_glx_interpol, gensym("interpol"), A_FLOAT, A_NULL); class_addmethod(pdp_glx_class, (t_method)pdp_glx_tile, gensym("tile"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_NULL);
Index: pdp_v4l.c =================================================================== RCS file: /cvsroot/pure-data/externals/pdp/modules/image_io/pdp_v4l.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdp_v4l.c 16 Dec 2005 01:05:33 -0000 1.3 --- pdp_v4l.c 1 Sep 2006 13:45:30 -0000 1.4 *************** *** 185,188 **** --- 185,200 ---- }
+ static void pdp_v4l_pwc_agc(t_pdp_v4l *x, float gain){ + gain *= (float)(1<<16); + int g = (int)gain; + if (g < 0) g = -1; // automatic + if (g > 1<<16) g = 1<<16 - 1; // fixed + + //post("pdp_v4l: setting agc to %d", g); + if (ioctl(x->x_tvfd, VIDIOCPWCSAGC, &g)){ + post("pdp_v4l: pwc: VIDIOCPWCSAGC"); + //goto closit; + } + }
static void pdp_v4l_pwc_init(t_pdp_v4l *x) *************** *** 207,214 **** --- 219,237 ---- post("pdp_v4l: detected pwc");
+ if(ioctl(x->x_tvfd, VIDIOCPWCRUSER)){ perror("pdp_v4l: pwc: VIDIOCPWCRUSER"); goto closit; } + + /* this is a workaround: + we disable AGC after restoring user prefs + something is wrong with newer cams (like Qickcam 4000 pro) + */ + + if (1){ + pdp_v4l_pwc_agc(x, 1.0); + } +
if (ioctl(x->x_tvfd, VIDIOCGWIN, &x->x_vwin)){ *************** *** 825,828 **** --- 848,852 ---- class_addmethod(pdp_v4l_class, (t_method)pdp_v4l_freq, gensym("freq"), A_FLOAT, A_NULL); class_addmethod(pdp_v4l_class, (t_method)pdp_v4l_freqMHz, gensym("freqMHz"), A_FLOAT, A_NULL); + class_addmethod(pdp_v4l_class, (t_method)pdp_v4l_pwc_agc, gensym("gain"), A_FLOAT, A_NULL); class_addmethod(pdp_v4l_class, (t_method)pdp_v4l_format, gensym("captureformat"), A_SYMBOL, A_NULL);
Index: pdp_qt.c =================================================================== RCS file: /cvsroot/pure-data/externals/pdp/modules/image_io/pdp_qt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdp_qt.c 16 Dec 2005 01:05:33 -0000 1.3 --- pdp_qt.c 1 Sep 2006 13:45:30 -0000 1.4 *************** *** 20,25 ****
! #include <quicktime/lqt.h> ! #include <quicktime/colormodels.h>
#include "pdp.h" --- 20,27 ----
! //#include <quicktime/lqt.h> ! //#include <quicktime/colormodels.h> ! #include <lqt/lqt.h> ! #include <lqt/colormodels.h>
#include "pdp.h"