Revision: 9893 http://pure-data.svn.sourceforge.net/pure-data/?rev=9893&view=rev Author: eighthave Date: 2008-05-23 18:51:05 -0700 (Fri, 23 May 2008)
Log Message: ----------- - First stabs at getting pdvjtools as part of Pd-extended - build fixes for Mac OS X - updated help files to standard names
Modified Paths: -------------- trunk/externals/Makefile trunk/externals/pdvjtools/videogrid/videogrid.cpp
Added Paths: ----------- trunk/externals/pdvjtools/Makefile trunk/externals/pdvjtools/imagegrid/imagegrid.libs trunk/externals/pdvjtools/pdp_frei0r/pdp_frei0r-help.pd trunk/externals/pdvjtools/pix_preview/pix_preview.cc trunk/externals/pdvjtools/videogrid/videogrid.libs
Removed Paths: ------------- trunk/externals/pdvjtools/pdp_frei0r/help_pdp_frei0r.pd trunk/externals/pdvjtools/pix_preview/pix_preview.cpp
Modified: trunk/externals/Makefile =================================================================== --- trunk/externals/Makefile 2008-05-24 01:44:50 UTC (rev 9892) +++ trunk/externals/Makefile 2008-05-24 01:51:05 UTC (rev 9893) @@ -43,20 +43,20 @@ # this variable is to support old "win" directories, rather than "windows" BUILDSRC_OS_NAME = $(OS_NAME)
-CFLAGS = -DPD $(OPT_CFLAGS) -I$(pd_src)/src -Wall -W $(DEBUG_CFLAGS) +CFLAGS = -DPD $(OPT_CFLAGS) -I$(pd_src)/src -Wall -W $(DEBUG_CFLAGS) -I$(gem_src)/src LDFLAGS = LIBS = -lm
ifeq ($(OS_NAME),darwin) - CFLAGS += -I/sw/include -DMACOSX -DUNIX -Dunix - LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -L/sw/lib \ - -weak_framework Carbon + CFLAGS += -I/sw/include -I$(externals_src)/pdp/include -DMACOSX -DUNIX -Dunix + LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \ + -L/sw/lib -weak_framework Carbon LIBS += -lc DYLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup -read_only_relocs warning -L/sw/lib STRIP = strip -x endif ifeq ($(OS_NAME),linux) - CFLAGS += -DUNIX -Dunix -fPIC + CFLAGS += -I$(externals_src)/pdp/include -DUNIX -Dunix -fPIC LDFLAGS += -Wl,-export_dynamic -shared LIBS += -lc DYLIB_LDFLAGS = $(LDFLAGS) @@ -2091,6 +2091,45 @@
#------------------------------------------------------------------------------# +# PDVJTOOLS +PDVJTOOLS_NAME=pdvjtools +PDVJTOOLS_OBJECTS := $(wildcard $(externals_src)/pdvjtools/*/*.c) +PDVJTOOLS_CPP_OBJECTS := $(wildcard $(externals_src)/pdvjtools/*/*.cpp) +pdvjtools: $(PDVJTOOLS_OBJECTS:.c=.$(EXTENSION)) \ +$(PDVJTOOLS_CPP_OBJECTS:.cpp=.$(EXTENSION)) + +pdvjtools_install: pdvjtools + install -d $(objectsdir)/$(PDVJTOOLS_NAME) + $(scripts_src)/generate-libdir-metafile.sh $(objectsdir) $(PDVJTOOLS_NAME) \ + --author "" \ + --description "Pure Data Video Junk" + install -p $(PDVJTOOLS_OBJECTS:.c=.$(EXTENSION)) $(objectsdir)/$(PDVJTOOLS_NAME) + install -d $(helpdir)/$(PDVJTOOLS_NAME) + install -p $(externals_src)/pdvjtools/*/*-help.pd \ + $(helpdir)/$(PDVJTOOLS_NAME) + install -d $(manualsdir)/$(PDVJTOOLS_NAME) + install -p $(externals_src)/pdvjtools/pdp_freeframe/INSTALL \ + $(manualsdir)/$(PDVJTOOLS_NAME)/pdp_freeframe_INSTALL + install -p $(externals_src)/pdvjtools/pdp_frei0r/INSTALL \ + $(manualsdir)/$(PDVJTOOLS_NAME)/pdp_frei0r_INSTALL +# install -d $(readmesdir) +# install -p $(externals_src)/pdvjtools/README \ +# $(readmesdir)/$(PDVJTOOLS_NAME).txt +# install -d $(examplesdir)/$(PDVJTOOLS_NAME) +# install -p $(externals_src)/pdvjtools/examples/*.pd \ +# $(examplesdir)/$(PDVJTOOLS_NAME) + +pdvjtools_clean: + -rm -f -- $(PDVJTOOLS_OBJECTS:.c=.$(EXTENSION)) + -rm -f -- $(PDVJTOOLS_CPP_OBJECTS:.cpp=.$(EXTENSION)) + -rm -f -- $(PDVJTOOLS_OBJECTS:.c=.o) + -rm -f -- $(PDVJTOOLS_CPP_OBJECTS:.cpp=.o) + -rm -f -- $(externals_src)/pdvjtools/*.bak + -rm -f -- $(externals_src)/pdvjtools/*.*~ + + + +#------------------------------------------------------------------------------# # PIDIP PIDIP_NAME=pidip $(externals_src)/pidip/configure: $(externals_src)/pidip/configure.ac
Added: trunk/externals/pdvjtools/Makefile =================================================================== --- trunk/externals/pdvjtools/Makefile (rev 0) +++ trunk/externals/pdvjtools/Makefile 2008-05-24 01:51:05 UTC (rev 9893) @@ -0,0 +1,17 @@ +TARGET := $(shell pwd | sed 's|.*/(.*)$$|\1|') +EXTERNALS_ROOT := $(shell pwd | sed 's|^(/.*externals).*|\1|') + +default: + make -C $(EXTERNALS_ROOT) $(TARGET) + +install: + make -C $(EXTERNALS_ROOT) $(TARGET)_install + +clean: + make -C $(EXTERNALS_ROOT) $(TARGET)_clean + +test_locations: + make -C $(EXTERNALS_ROOT) test_locations + +etags: + etags *.[ch] ~/code/pure-data/trunk/pd/src/*.[ch] /usr/include/*.h /usr/include/sys/*.h
Added: trunk/externals/pdvjtools/imagegrid/imagegrid.libs =================================================================== --- trunk/externals/pdvjtools/imagegrid/imagegrid.libs (rev 0) +++ trunk/externals/pdvjtools/imagegrid/imagegrid.libs 2008-05-24 01:51:05 UTC (rev 9893) @@ -0,0 +1 @@ +-lMagick -lWand
Deleted: trunk/externals/pdvjtools/pdp_frei0r/help_pdp_frei0r.pd =================================================================== --- trunk/externals/pdvjtools/pdp_frei0r/help_pdp_frei0r.pd 2008-05-24 01:44:50 UTC (rev 9892) +++ trunk/externals/pdvjtools/pdp_frei0r/help_pdp_frei0r.pd 2008-05-24 01:51:05 UTC (rev 9893) @@ -1,330 +0,0 @@ -#N canvas 528 22 996 665 10; -#X floatatom 151 379 5 0 0 0 - - -; -#X obj 196 377 hradio 15 1 0 49 empty empty empty 0 -6 0 8 -262144 --1 -1 0; -#X obj 261 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 401 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 541 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X msg 258 191 param 3 $1; -#X msg 398 190 param 4 $1; -#X msg 539 190 param 5 $1; -#X text 197 358 Select the plugin; -#X text 258 72 Adjust plugin parameters.; -#X symbolatom 87 501 20 0 0 0 - - -; -#X text 240 501 <-- plugin name; -#X floatatom 106 479 5 0 0 0 - - -; -#X text 154 477 <-- number of parameters; -#X text 205 451 <-- parameter name; -#X text 232 423 <-- parameter type; -#X obj 263 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 401 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 542 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 261 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 402 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 544 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X msg 260 131 param 0 $1; -#X msg 398 131 param 1 $1; -#X msg 539 131 param 2 $1; -#X msg 260 254 param 6 $1; -#X msg 399 253 param 7 $1; -#X msg 541 253 param 8 $1; -#N canvas 0 22 996 665 pname 0; -#X obj 51 119 l2s; -#X obj 80 119 l2s; -#X obj 111 119 l2s; -#X obj 143 119 l2s; -#X obj 207 120 l2s; -#X obj 236 120 l2s; -#X obj 267 120 l2s; -#X obj 298 119 l2s; -#X obj 327 119 l2s; -#X obj 97 51 inlet; -#X obj 51 154 s ffparam0; -#X obj 79 178 s ffparam1; -#X obj 118 205 s ffparam2; -#X obj 148 227 s ffparam3; -#X obj 185 157 s ffparam4; -#X obj 213 181 s ffparam5; -#X obj 255 206 s ffparam6; -#X obj 283 230 s ffparam7; -#X obj 305 155 s ffparam8; -#X obj 391 53 inlet; -#X msg 390 79 symbol; -#X obj 359 118 l2s; -#X obj 391 118 l2s; -#X obj 97 79 route 0 1 2 3 4 5 6 7 8 9 10; -#X obj 357 178 s ffparam9; -#X obj 414 202 s ffparam10; -#X connect 0 0 10 0; -#X connect 1 0 11 0; -#X connect 2 0 12 0; -#X connect 3 0 13 0; -#X connect 4 0 14 0; -#X connect 5 0 15 0; -#X connect 6 0 16 0; -#X connect 7 0 17 0; -#X connect 8 0 18 0; -#X connect 9 0 23 0; -#X connect 19 0 20 0; -#X connect 20 0 10 0; -#X connect 20 0 11 0; -#X connect 20 0 12 0; -#X connect 20 0 13 0; -#X connect 20 0 14 0; -#X connect 20 0 15 0; -#X connect 20 0 16 0; -#X connect 20 0 17 0; -#X connect 20 0 18 0; -#X connect 20 0 24 0; -#X connect 20 0 25 0; -#X connect 21 0 24 0; -#X connect 22 0 25 0; -#X connect 23 0 0 0; -#X connect 23 1 1 0; -#X connect 23 2 2 0; -#X connect 23 3 3 0; -#X connect 23 4 4 0; -#X connect 23 5 5 0; -#X connect 23 6 6 0; -#X connect 23 7 7 0; -#X connect 23 8 8 0; -#X connect 23 9 21 0; -#X connect 23 10 22 0; -#X restore 137 451 pd pname; -#X symbolatom 260 93 18 0 0 0 - ffparam0 -; -#X symbolatom 399 92 18 0 0 0 - ffparam1 -; -#X symbolatom 538 92 18 0 0 0 - ffparam2 -; -#X symbolatom 261 154 18 0 0 0 - ffparam3 -; -#X symbolatom 400 153 18 0 0 0 - ffparam4 -; -#X symbolatom 539 153 18 0 0 0 - ffparam5 -; -#X symbolatom 261 214 18 0 0 0 - ffparam6 -; -#X symbolatom 400 213 18 0 0 0 - ffparam7 -; -#X symbolatom 539 213 18 0 0 0 - ffparam8 -; -#X text 489 424 frei0r host for Pure Data Packet version 0.1; -#X text 491 439 by Lluis Gomez i Bigorda (lluis@artefacte.org); -#X text 510 452 & Yves Degoyon (ydegoyon@free.fr); -#X text 491 495 made at piksel yearly gathering : http://www.piksel.no -; -#X obj 155 423 print type; -#X text 491 467 using frei0r specification 1.1 by Georg Seidel , Phillip -Promesberger and Martin Bayer; -#X obj 261 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X obj 404 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; -#X symbolatom 261 283 18 0 0 0 - ffparam9 -; -#X symbolatom 400 283 18 0 0 0 - ffparam10 -; -#X msg 259 323 param 9 $1; -#X msg 401 323 param 10 $1; -#X obj 46 545 pdp_xv; -#N canvas 222 59 450 300 input1 0; -#X obj 49 181 pdp_qt; -#X msg 49 49 bang; -#X msg 110 111 loop 1; -#X obj 50 214 pdp_scale 320 240; -#X msg 167 111 open $1; -#X obj 167 89 openpanel; -#X text 98 49 Load a mov file; -#X obj 244 113 pdp_v4l; -#X msg 244 58 bang; -#X obj 49 250 outlet; -#X obj 49 5 inlet; -#X obj 251 7 inlet; -#X obj 247 33 route 0; -#X msg 298 59 stop; -#X obj 50 28 route 0; -#X msg 14 79 stop; -#X obj 49 111 metro 80; -#X obj 244 86 metro 80; -#X connect 0 0 3 0; -#X connect 1 0 2 0; -#X connect 1 0 5 0; -#X connect 1 0 16 0; -#X connect 2 0 0 0; -#X connect 3 0 9 0; -#X connect 4 0 0 0; -#X connect 5 0 4 0; -#X connect 7 0 3 0; -#X connect 8 0 17 0; -#X connect 10 0 14 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 12 1 8 0; -#X connect 13 0 17 0; -#X connect 14 0 15 0; -#X connect 14 1 1 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X connect 17 0 7 0; -#X restore 44 44 pd input1; -#X text 49 24 .mov; -#X text 115 24 cam; -#X obj 102 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#X obj 44 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#X text 85 89 .mov; -#X text 151 89 cam; -#X obj 138 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#X obj 80 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 -; -#N canvas 222 59 450 300 input2 0; -#X obj 49 181 pdp_qt; -#X msg 49 49 bang; -#X msg 110 111 loop 1; -#X obj 50 214 pdp_scale 320 240; -#X msg 167 111 open $1; -#X obj 167 89 openpanel; -#X text 98 49 Load a mov file; -#X obj 244 113 pdp_v4l; -#X msg 244 58 bang; -#X obj 49 250 outlet; -#X obj 49 5 inlet; -#X obj 251 7 inlet; -#X obj 247 33 route 0; -#X msg 298 59 stop; -#X obj 50 28 route 0; -#X msg 14 79 stop; -#X obj 49 111 metro 80; -#X obj 244 86 metro 80; -#X connect 0 0 3 0; -#X connect 1 0 2 0; -#X connect 1 0 5 0; -#X connect 1 0 16 0; -#X connect 2 0 0 0; -#X connect 3 0 9 0; -#X connect 4 0 0 0; -#X connect 5 0 4 0; -#X connect 7 0 3 0; -#X connect 8 0 17 0; -#X connect 10 0 14 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 12 1 8 0; -#X connect 13 0 17 0; -#X connect 14 0 15 0; -#X connect 14 1 1 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X connect 17 0 7 0; -#X restore 80 109 pd input2; -#X text 116 148 .mov; -#X text 182 148 cam; -#X obj 169 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 111 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#N canvas 222 59 450 300 input3 0; -#X obj 49 181 pdp_qt; -#X msg 49 49 bang; -#X msg 110 111 loop 1; -#X obj 50 214 pdp_scale 320 240; -#X msg 167 111 open $1; -#X obj 167 89 openpanel; -#X text 98 49 Load a mov file; -#X obj 244 113 pdp_v4l; -#X msg 244 58 bang; -#X obj 49 250 outlet; -#X obj 49 5 inlet; -#X obj 251 7 inlet; -#X obj 247 33 route 0; -#X msg 298 59 stop; -#X obj 50 28 route 0; -#X msg 14 79 stop; -#X obj 49 111 metro 80; -#X obj 244 86 metro 80; -#X connect 0 0 3 0; -#X connect 1 0 2 0; -#X connect 1 0 5 0; -#X connect 1 0 16 0; -#X connect 2 0 0 0; -#X connect 3 0 9 0; -#X connect 4 0 0 0; -#X connect 5 0 4 0; -#X connect 7 0 3 0; -#X connect 8 0 17 0; -#X connect 10 0 14 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 12 1 8 0; -#X connect 13 0 17 0; -#X connect 14 0 15 0; -#X connect 14 1 1 0; -#X connect 15 0 16 0; -#X connect 16 0 0 0; -#X connect 17 0 7 0; -#X restore 111 168 pd input3; -#X obj 43 202 pdp_scale 320 240; -#X obj 69 232 pdp_scale 320 240; -#X obj 93 262 pdp_scale 320 240; -#X obj 905 409 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 905 461 pdp_control; -#X msg 905 434 thread $1; -#X floatatom 905 522 5 0 0 0 - - -; -#X obj 905 493 route pdp_drop; -#X text 498 547 constructor : pdp_frei0r <index>; -#X obj 46 376 pdp_frei0r 16; -#X text 499 562 you can get the index from the list of loaded plugins -; -#X text 498 575 at startup ( check pd window ); -#X text 13 290 WARNING : sizes of inputs; -#X text 12 302 _must_ be the same; -#X msg 290 18 plugindir /usr/local/lib/frei0r; -#X connect 0 0 75 3; -#X connect 1 0 0 0; -#X connect 2 0 5 0; -#X connect 3 0 6 0; -#X connect 4 0 7 0; -#X connect 5 0 75 0; -#X connect 6 0 75 0; -#X connect 7 0 75 0; -#X connect 12 0 28 1; -#X connect 16 0 22 0; -#X connect 17 0 23 0; -#X connect 18 0 24 0; -#X connect 19 0 25 0; -#X connect 20 0 26 0; -#X connect 21 0 27 0; -#X connect 22 0 75 0; -#X connect 23 0 75 0; -#X connect 24 0 75 0; -#X connect 25 0 75 0; -#X connect 26 0 75 0; -#X connect 27 0 75 0; -#X connect 44 0 48 0; -#X connect 45 0 49 0; -#X connect 48 0 75 0; -#X connect 49 0 75 0; -#X connect 51 0 66 0; -#X connect 54 0 51 1; -#X connect 55 0 51 0; -#X connect 58 0 60 1; -#X connect 59 0 60 0; -#X connect 60 0 67 0; -#X connect 63 0 65 1; -#X connect 64 0 65 0; -#X connect 65 0 68 0; -#X connect 66 0 75 0; -#X connect 67 0 75 1; -#X connect 68 0 75 2; -#X connect 69 0 71 0; -#X connect 70 0 73 0; -#X connect 71 0 70 0; -#X connect 73 0 72 0; -#X connect 75 0 50 0; -#X connect 75 1 10 0; -#X connect 75 2 12 0; -#X connect 75 3 28 0; -#X connect 75 4 42 0; -#X connect 80 0 75 0;
Copied: trunk/externals/pdvjtools/pdp_frei0r/pdp_frei0r-help.pd (from rev 9892, trunk/externals/pdvjtools/pdp_frei0r/help_pdp_frei0r.pd) =================================================================== --- trunk/externals/pdvjtools/pdp_frei0r/pdp_frei0r-help.pd (rev 0) +++ trunk/externals/pdvjtools/pdp_frei0r/pdp_frei0r-help.pd 2008-05-24 01:51:05 UTC (rev 9893) @@ -0,0 +1,330 @@ +#N canvas 528 22 996 665 10; +#X floatatom 151 379 5 0 0 0 - - -; +#X obj 196 377 hradio 15 1 0 49 empty empty empty 0 -6 0 8 -262144 +-1 -1 0; +#X obj 261 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 401 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 541 171 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X msg 258 191 param 3 $1; +#X msg 398 190 param 4 $1; +#X msg 539 190 param 5 $1; +#X text 197 358 Select the plugin; +#X text 258 72 Adjust plugin parameters.; +#X symbolatom 87 501 20 0 0 0 - - -; +#X text 240 501 <-- plugin name; +#X floatatom 106 479 5 0 0 0 - - -; +#X text 154 477 <-- number of parameters; +#X text 205 451 <-- parameter name; +#X text 232 423 <-- parameter type; +#X obj 263 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 401 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 542 112 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 261 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 402 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 544 234 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X msg 260 131 param 0 $1; +#X msg 398 131 param 1 $1; +#X msg 539 131 param 2 $1; +#X msg 260 254 param 6 $1; +#X msg 399 253 param 7 $1; +#X msg 541 253 param 8 $1; +#N canvas 0 22 996 665 pname 0; +#X obj 51 119 l2s; +#X obj 80 119 l2s; +#X obj 111 119 l2s; +#X obj 143 119 l2s; +#X obj 207 120 l2s; +#X obj 236 120 l2s; +#X obj 267 120 l2s; +#X obj 298 119 l2s; +#X obj 327 119 l2s; +#X obj 97 51 inlet; +#X obj 51 154 s ffparam0; +#X obj 79 178 s ffparam1; +#X obj 118 205 s ffparam2; +#X obj 148 227 s ffparam3; +#X obj 185 157 s ffparam4; +#X obj 213 181 s ffparam5; +#X obj 255 206 s ffparam6; +#X obj 283 230 s ffparam7; +#X obj 305 155 s ffparam8; +#X obj 391 53 inlet; +#X msg 390 79 symbol; +#X obj 359 118 l2s; +#X obj 391 118 l2s; +#X obj 97 79 route 0 1 2 3 4 5 6 7 8 9 10; +#X obj 357 178 s ffparam9; +#X obj 414 202 s ffparam10; +#X connect 0 0 10 0; +#X connect 1 0 11 0; +#X connect 2 0 12 0; +#X connect 3 0 13 0; +#X connect 4 0 14 0; +#X connect 5 0 15 0; +#X connect 6 0 16 0; +#X connect 7 0 17 0; +#X connect 8 0 18 0; +#X connect 9 0 23 0; +#X connect 19 0 20 0; +#X connect 20 0 10 0; +#X connect 20 0 11 0; +#X connect 20 0 12 0; +#X connect 20 0 13 0; +#X connect 20 0 14 0; +#X connect 20 0 15 0; +#X connect 20 0 16 0; +#X connect 20 0 17 0; +#X connect 20 0 18 0; +#X connect 20 0 24 0; +#X connect 20 0 25 0; +#X connect 21 0 24 0; +#X connect 22 0 25 0; +#X connect 23 0 0 0; +#X connect 23 1 1 0; +#X connect 23 2 2 0; +#X connect 23 3 3 0; +#X connect 23 4 4 0; +#X connect 23 5 5 0; +#X connect 23 6 6 0; +#X connect 23 7 7 0; +#X connect 23 8 8 0; +#X connect 23 9 21 0; +#X connect 23 10 22 0; +#X restore 137 451 pd pname; +#X symbolatom 260 93 18 0 0 0 - ffparam0 -; +#X symbolatom 399 92 18 0 0 0 - ffparam1 -; +#X symbolatom 538 92 18 0 0 0 - ffparam2 -; +#X symbolatom 261 154 18 0 0 0 - ffparam3 -; +#X symbolatom 400 153 18 0 0 0 - ffparam4 -; +#X symbolatom 539 153 18 0 0 0 - ffparam5 -; +#X symbolatom 261 214 18 0 0 0 - ffparam6 -; +#X symbolatom 400 213 18 0 0 0 - ffparam7 -; +#X symbolatom 539 213 18 0 0 0 - ffparam8 -; +#X text 489 424 frei0r host for Pure Data Packet version 0.1; +#X text 491 439 by Lluis Gomez i Bigorda (lluis@artefacte.org); +#X text 510 452 & Yves Degoyon (ydegoyon@free.fr); +#X text 491 495 made at piksel yearly gathering : http://www.piksel.no +; +#X obj 155 423 print type; +#X text 491 467 using frei0r specification 1.1 by Georg Seidel , Phillip +Promesberger and Martin Bayer; +#X obj 261 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 404 304 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X symbolatom 261 283 18 0 0 0 - ffparam9 -; +#X symbolatom 400 283 18 0 0 0 - ffparam10 -; +#X msg 259 323 param 9 $1; +#X msg 401 323 param 10 $1; +#X obj 46 545 pdp_xv; +#N canvas 222 59 450 300 input1 0; +#X obj 49 181 pdp_qt; +#X msg 49 49 bang; +#X msg 110 111 loop 1; +#X obj 50 214 pdp_scale 320 240; +#X msg 167 111 open $1; +#X obj 167 89 openpanel; +#X text 98 49 Load a mov file; +#X obj 244 113 pdp_v4l; +#X msg 244 58 bang; +#X obj 49 250 outlet; +#X obj 49 5 inlet; +#X obj 251 7 inlet; +#X obj 247 33 route 0; +#X msg 298 59 stop; +#X obj 50 28 route 0; +#X msg 14 79 stop; +#X obj 49 111 metro 80; +#X obj 244 86 metro 80; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 1 0 5 0; +#X connect 1 0 16 0; +#X connect 2 0 0 0; +#X connect 3 0 9 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 7 0 3 0; +#X connect 8 0 17 0; +#X connect 10 0 14 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 12 1 8 0; +#X connect 13 0 17 0; +#X connect 14 0 15 0; +#X connect 14 1 1 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X connect 17 0 7 0; +#X restore 44 44 pd input1; +#X text 49 24 .mov; +#X text 115 24 cam; +#X obj 102 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X obj 44 10 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X text 85 89 .mov; +#X text 151 89 cam; +#X obj 138 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#X obj 80 75 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 +; +#N canvas 222 59 450 300 input2 0; +#X obj 49 181 pdp_qt; +#X msg 49 49 bang; +#X msg 110 111 loop 1; +#X obj 50 214 pdp_scale 320 240; +#X msg 167 111 open $1; +#X obj 167 89 openpanel; +#X text 98 49 Load a mov file; +#X obj 244 113 pdp_v4l; +#X msg 244 58 bang; +#X obj 49 250 outlet; +#X obj 49 5 inlet; +#X obj 251 7 inlet; +#X obj 247 33 route 0; +#X msg 298 59 stop; +#X obj 50 28 route 0; +#X msg 14 79 stop; +#X obj 49 111 metro 80; +#X obj 244 86 metro 80; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 1 0 5 0; +#X connect 1 0 16 0; +#X connect 2 0 0 0; +#X connect 3 0 9 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 7 0 3 0; +#X connect 8 0 17 0; +#X connect 10 0 14 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 12 1 8 0; +#X connect 13 0 17 0; +#X connect 14 0 15 0; +#X connect 14 1 1 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X connect 17 0 7 0; +#X restore 80 109 pd input2; +#X text 116 148 .mov; +#X text 182 148 cam; +#X obj 169 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 111 134 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#N canvas 222 59 450 300 input3 0; +#X obj 49 181 pdp_qt; +#X msg 49 49 bang; +#X msg 110 111 loop 1; +#X obj 50 214 pdp_scale 320 240; +#X msg 167 111 open $1; +#X obj 167 89 openpanel; +#X text 98 49 Load a mov file; +#X obj 244 113 pdp_v4l; +#X msg 244 58 bang; +#X obj 49 250 outlet; +#X obj 49 5 inlet; +#X obj 251 7 inlet; +#X obj 247 33 route 0; +#X msg 298 59 stop; +#X obj 50 28 route 0; +#X msg 14 79 stop; +#X obj 49 111 metro 80; +#X obj 244 86 metro 80; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 1 0 5 0; +#X connect 1 0 16 0; +#X connect 2 0 0 0; +#X connect 3 0 9 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 7 0 3 0; +#X connect 8 0 17 0; +#X connect 10 0 14 0; +#X connect 11 0 12 0; +#X connect 12 0 13 0; +#X connect 12 1 8 0; +#X connect 13 0 17 0; +#X connect 14 0 15 0; +#X connect 14 1 1 0; +#X connect 15 0 16 0; +#X connect 16 0 0 0; +#X connect 17 0 7 0; +#X restore 111 168 pd input3; +#X obj 43 202 pdp_scale 320 240; +#X obj 69 232 pdp_scale 320 240; +#X obj 93 262 pdp_scale 320 240; +#X obj 905 409 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 905 461 pdp_control; +#X msg 905 434 thread $1; +#X floatatom 905 522 5 0 0 0 - - -; +#X obj 905 493 route pdp_drop; +#X text 498 547 constructor : pdp_frei0r <index>; +#X obj 46 376 pdp_frei0r 16; +#X text 499 562 you can get the index from the list of loaded plugins +; +#X text 498 575 at startup ( check pd window ); +#X text 13 290 WARNING : sizes of inputs; +#X text 12 302 _must_ be the same; +#X msg 290 18 plugindir /usr/local/lib/frei0r; +#X connect 0 0 75 3; +#X connect 1 0 0 0; +#X connect 2 0 5 0; +#X connect 3 0 6 0; +#X connect 4 0 7 0; +#X connect 5 0 75 0; +#X connect 6 0 75 0; +#X connect 7 0 75 0; +#X connect 12 0 28 1; +#X connect 16 0 22 0; +#X connect 17 0 23 0; +#X connect 18 0 24 0; +#X connect 19 0 25 0; +#X connect 20 0 26 0; +#X connect 21 0 27 0; +#X connect 22 0 75 0; +#X connect 23 0 75 0; +#X connect 24 0 75 0; +#X connect 25 0 75 0; +#X connect 26 0 75 0; +#X connect 27 0 75 0; +#X connect 44 0 48 0; +#X connect 45 0 49 0; +#X connect 48 0 75 0; +#X connect 49 0 75 0; +#X connect 51 0 66 0; +#X connect 54 0 51 1; +#X connect 55 0 51 0; +#X connect 58 0 60 1; +#X connect 59 0 60 0; +#X connect 60 0 67 0; +#X connect 63 0 65 1; +#X connect 64 0 65 0; +#X connect 65 0 68 0; +#X connect 66 0 75 0; +#X connect 67 0 75 1; +#X connect 68 0 75 2; +#X connect 69 0 71 0; +#X connect 70 0 73 0; +#X connect 71 0 70 0; +#X connect 73 0 72 0; +#X connect 75 0 50 0; +#X connect 75 1 10 0; +#X connect 75 2 12 0; +#X connect 75 3 28 0; +#X connect 75 4 42 0; +#X connect 80 0 75 0;
Copied: trunk/externals/pdvjtools/pix_preview/pix_preview.cc (from rev 9891, trunk/externals/pdvjtools/pix_preview/pix_preview.cpp) =================================================================== --- trunk/externals/pdvjtools/pix_preview/pix_preview.cc (rev 0) +++ trunk/externals/pdvjtools/pix_preview/pix_preview.cc 2008-05-24 01:51:05 UTC (rev 9893) @@ -0,0 +1,538 @@ +//////////////////////////////////////////////////////// +// +// GEM - Graphics Environment for Multimedia +// +// zmoelnig@iem.kug.ac.at +// +// Implementation file +// +// Copyright (c) 1997-1998 Mark Danks. +// Copyright (c) G\xFCnther Geiger. +// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::f\xFCr::uml\xE4ute. IEM +// Copyright (c) 2002 James Tittle & Chris Clepper +// For information on usage and redistribution, and for a DISCLAIMER OF ALL +// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. +// +///////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////// +// +// pix_preview +// +// 0409:forum::f\xFCr::uml\xE4ute:2000 +// IOhannes m zmoelnig +// mailto:zmoelnig@iem.kug.ac.at +// +///////////////////////////////////////////////////////// + +#include <iostream> +#include <string> +#include <sstream> +using namespace std; +#include "stdio.h" + + +#include "m_pd.h" +#include "m_imp.h" +#include "g_canvas.h" +#include "t_tk.h" + +#include "pix_preview.h" + +int guidebug=0; + +#define COLORGRID_SYS_VGUI2(a,b) if (guidebug) \ + post(a,b);\ + sys_vgui(a,b) + +#define COLORGRID_SYS_VGUI3(a,b,c) if (guidebug) \ + post(a,b,c);\ + sys_vgui(a,b,c) + +#define COLORGRID_SYS_VGUI4(a,b,c,d) if (guidebug) \ + post(a,b,c,d);\ + sys_vgui(a,b,c,d) + +#define COLORGRID_SYS_VGUI5(a,b,c,d,e) if (guidebug) \ + post(a,b,c,d,e);\ + sys_vgui(a,b,c,d,e) + +#define COLORGRID_SYS_VGUI6(a,b,c,d,e,f) if (guidebug) \ + post(a,b,c,d,e,f);\ + sys_vgui(a,b,c,d,e,f) + +#define COLORGRID_SYS_VGUI7(a,b,c,d,e,f,g) if (guidebug) \ + post(a,b,c,d,e,f,g );\ + sys_vgui(a,b,c,d,e,f,g) + +#define COLORGRID_SYS_VGUI8(a,b,c,d,e,f,g,h) if (guidebug) \ + post(a,b,c,d,e,f,g,h );\ + sys_vgui(a,b,c,d,e,f,g,h) + +#define COLORGRID_SYS_VGUI9(a,b,c,d,e,f,g,h,i) if (guidebug) \ + post(a,b,c,d,e,f,g,h,i );\ + sys_vgui(a,b,c,d,e,f,g,h,i) + + + char *fdata="R0lGODlhHAAcAIABAAAAAP///ywAAAAAHAAcAAACGoSPqcvtD6OctNqLs968+w+G4kiW5omm6ooUADs="; + + +/* base64 conversion*/ + +static const std::string base64_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + +std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { + std::string ret; + int i = 0; + int j = 0; + unsigned char char_array_3[3]; + unsigned char char_array_4[4]; + + while (in_len--) { + char_array_3[i++] = *(bytes_to_encode++); + if (i == 3) { + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for(i = 0; (i <4) ; i++) + ret += base64_chars[char_array_4[i]]; + i = 0; + } + } + + if (i) + { + for(j = i; j < 3; j++) + char_array_3[j] = '\0'; + + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for (j = 0; (j < i + 1); j++) + ret += base64_chars[char_array_4[j]]; + + while((i++ < 3)) + ret += '='; + + } + + return ret; + +} + + + + + + + + + + + + + + + +CPPEXTERN_NEW_WITH_TWO_ARGS(pix_preview, t_floatarg, A_DEFFLOAT, t_floatarg, A_DEFFLOAT) + + + ///////////////////////////////////////////////////////// + // + // pix_preview + // + ///////////////////////////////////////////////////////// + // Constructor + // + ///////////////////////////////////////////////////////// + pix_preview :: pix_preview(t_floatarg fx, t_floatarg fy) +{ + #include "pix_preview.tk2c" + xsize = (int)fx; + ysize = (int)fy; + m_csize = 3; + + + image_widgetbehavior.w_getrectfn = image_getrect; + image_widgetbehavior.w_displacefn = image_displace; + image_widgetbehavior.w_selectfn = image_select; + image_widgetbehavior.w_activatefn = image_activate; + image_widgetbehavior.w_deletefn = image_delete; + image_widgetbehavior.w_visfn = image_vis; +#if (PD_VERSION_MINOR > 31) + image_widgetbehavior.w_clickfn = NULL; + image_widgetbehavior.w_propertiesfn = NULL; +#endif +#if PD_MINOR_VERSION < 37 + image_widgetbehavior.w_savefn = image_save; +#endif + + + class_setwidget(pix_preview_class,&image_widgetbehavior); + + if (xsize < 0) xsize = 0; + if (ysize < 0) ysize = 0; + + m_xsize = xsize; + m_ysize = ysize; + + oldimagex = xsize; + oldimagey = ysize; + + m_bufsize = m_xsize * m_ysize * m_csize; + + m_buffer = new t_atom[m_bufsize]; + + //m_dataOut = outlet_new(this->x_obj, &s_list); +} + +///////////////////////////////////////////////////////// +// Destructor +// +///////////////////////////////////////////////////////// +pix_preview :: ~pix_preview() +{ +} + +///////////////////////////////////////////////////////// +// processImage +// +///////////////////////////////////////////////////////// +void pix_preview :: processImage(imageStruct &image) +{ + int x = m_xsize, y = m_ysize, c = m_csize; + + if (image.xsize != oldimagex) { + oldimagex = image.xsize; + m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize; + } + if (image.ysize != oldimagey) { + oldimagey = image.ysize; + m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize; + } + + if (image.csize != m_csize) m_csize = image.csize; + + if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) { + // resize the image buffer + if(m_buffer)delete [] m_buffer; + m_bufsize = m_xsize * m_ysize * m_csize; + m_buffer = new t_atom[m_bufsize]; + + m_xstep = m_csize * ((float)image.xsize/(float)m_xsize); + m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize; + } + + m_data = image.data; +} + +///////////////////////////////////////////////////////// +// processYUVImage +// +///////////////////////////////////////////////////////// +void pix_preview :: processYUVImage(imageStruct &image) +{ + int x = m_xsize, y = m_ysize, c = m_csize; + + if (image.xsize != oldimagex) { + oldimagex = image.xsize; + m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize; + } + if (image.ysize != oldimagey) { + oldimagey = image.ysize; + m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize; + } + + if (image.csize != m_csize) m_csize = image.csize; + + if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) { + // resize the image buffer + if(m_buffer)delete [] m_buffer; + m_bufsize = m_xsize * m_ysize * m_csize; + m_buffer = new t_atom[m_bufsize]; + + m_xstep = m_csize * ((float)image.xsize/(float)m_xsize); + m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize; + } + + m_data = image.data; +} + +///////////////////////////////////////////////////////// +// trigger +// +///////////////////////////////////////////////////////// +void pix_preview :: trigger() +{ + if (!m_data) return; + + int n = m_ysize, m = 0; + int i = 0; + + unsigned char *data, *line; + stringstream sx,sy; + + fprintf (stderr,"%d %d %d %d %d %d \n",xsize, ysize,m_xsize, m_ysize,oldimagex,oldimagey); + + std::string pnm; + std::string pnm64; + pnm += "P6\n"; + sx << m_xsize; + pnm += sx.str(); + pnm += " "; + sy << m_ysize; + pnm += sy.str(); + pnm += "\n255\n"; + + //fprintf (stderr,"%s",pnm.c_str()); + + /*/escriu el contingut de data a un arxiu.*/ + char* ig_path = "/tmp/pixdump01.pnm"; + FILE * fp = fopen(ig_path, "w"); + fprintf (fp, "P6\n%d %d\n255\n", m_xsize, m_ysize); + data = line = m_data; + switch(m_csize){ + case 4: +/* + while (n > 0) { + while (m < m_xsize) { + int r, g, b, a; + r = (int)data[chRed]; + fprintf (fp, "%c", (char)r); + i++; + g = (int)data[chGreen]; + fprintf (fp, "%c", (char)g); + i++; + b = (int)data[chBlue]; + fprintf (fp, "%c", (char)b); + i++; + a = (int)data[chAlpha]; + i++; + m++; + data = line + (int)(m_xstep * (float)m); + } + m = 0; + n--; + line = m_data + (int)(m_ystep*n); + data = line; + } + fclose (fp); +*/ + while (n > 0) { + while (m < m_xsize) { + int r, g, b, a; + r = (int)data[chRed]; + pnm += (char)r; + fprintf (fp, "%c", (char)r); + i++; + g = (int)data[chGreen]; + pnm += (char)g; + fprintf (fp, "%c", (char)g); + i++; + b = (int)data[chBlue]; + pnm += (char)b; + fprintf (fp, "%c", (char)b); + i++; + a = (int)data[chAlpha]; + i++; + m++; + data = line + (int)(m_xstep * (float)m); + } + m = 0; + n--; + line = m_data + (int)(m_ystep*n); + data = line; + } + fclose (fp); + + + //std::cout << "NOT encoded: " << pnm << std::endl; + + //pnm64 = base64_encode(reinterpret_cast<const unsigned char*>(pnm.c_str()), pnm.length()); + //std::cout << "encoded: " << pnm64 << std::endl; + + + + //m_glist = (t_glist *) canvas_getcurrent(); + + + //sys_vgui("img%x put {%s}\n", this->x_obj, reinterpret_cast<const unsigned char*>(pnm64.c_str()) ); + image_drawme((pix_preview *)this->x_obj, (t_glist *) this->getCanvas(), 0, m_xsize, m_ysize); +// sys_vgui(".x%x.c coords %xS %d %d\n", +// this->getCanvas(), this->x_obj, +// text_xpix(this->x_obj, (t_glist *)this->getCanvas()) + (m_xsize/2), text_ypix(this->x_obj, (t_glist *)this->getCanvas()) + (m_ysize/2)); + //fprintf (stderr, "%x %x - %d %d\n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); + + break; + case 2: + while (n < m_ysize) { + while (m < m_xsize/2) { + float y,u,y1,v; + u = (float)data[0] / 255.f; + SETFLOAT(&m_buffer[i], u); + i++; + y = (float)data[1] / 255.f; + SETFLOAT(&m_buffer[i], y); + i++; + v = (float)data[2] / 255.f; + SETFLOAT(&m_buffer[i], v); + i++; + y1 = (float)data[3] / 255.f; + SETFLOAT(&m_buffer[i], y1); + i++; + m++; + data = line + (int)(m_xstep * (float)m); + } + m = 0; + n++; + line = m_data + (int)(m_ystep*n); + data = line; + } + case 1: default: + int datasize=m_xsize*m_ysize*m_csize/4; + while (datasize--) { + float v; + v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i], v); + v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+1], v); + v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+2], v); + v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+3], v); + i+=4; + } + } + //outlet_list(m_dataOut, gensym("list"), i, m_buffer); +} + +///////////////////////////////////////////////////////// +// static member function +// +///////////////////////////////////////////////////////// +void pix_preview :: obj_setupCallback(t_class *classPtr) +{ + class_addbang(classPtr, (t_method)&pix_preview::triggerMessCallback); +} + +void pix_preview :: triggerMessCallback(void *data) +{ + GetMyClass(data)->trigger(); +} + + + + +/* widget helper functions */ + + + + +void pix_preview :: image_drawme(pix_preview *x, t_glist *glist, int firsttime, int m_xsize, int m_ysize) +{ + char* ig_path = "/tmp/pixdump01.pnm"; + if (firsttime) { + + sys_vgui("image create photo img%x -data {%s}\n",x,fdata); + sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", + glist_getcanvas(glist),text_xpix((t_object*)x, glist)+14, text_ypix((t_object*)x, glist)+14,x,x); + //fprintf (stderr, "%x %x - %d %d \n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); + } + else { + sys_vgui(".x%x.c delete %xS\n", glist_getcanvas(glist), x); + sys_vgui(".x%x.c delete img%x\n", glist_getcanvas(glist), x); + sys_vgui("image create photo img%x -file %s\n",x,ig_path); + sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", + glist_getcanvas(glist),text_xpix((t_object*)x, glist)+(m_xsize/2), text_ypix((t_object*)x, glist)+(m_ysize/2),x,x); + //sys_vgui(".x%x.c coords %xS \ +%d %d\n", + // glist_getcanvas(glist), x, + // text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); + //fprintf (stderr, "%x %x - %d %d\n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); + } + +} + +void pix_preview :: image_erase(pix_preview* x,t_glist* glist) +{ + int n; + sys_vgui(".x%x.c delete %xS\n", + glist_getcanvas(glist), x); + +} + + +/* ------------------------ image widgetbehaviour----------------------------- */ + + +void pix_preview :: image_getrect(t_gobj *z, t_glist *glist, + int *xp1, int *yp1, int *xp2, int *yp2) +{ + int width, height; + pix_preview* x = (pix_preview*)z; + + + width = 250; + height = 50; + *xp1 = text_xpix((t_object*)x, glist); + *yp1 = text_ypix((t_object*)x, glist); + *xp2 = text_xpix((t_object*)x, glist) + width; + *yp2 = text_ypix((t_object*)x, glist) + height; +} + +void pix_preview :: image_displace(t_gobj *z, t_glist *glist, + int dx, int dy) +{ + t_object *x = (t_object *)z; + x->te_xpix += dx; + x->te_ypix += dy; + sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", + glist_getcanvas(glist), x, + text_xpix(x, glist), text_ypix(x, glist), + text_xpix(x, glist) + 25, text_ypix(x, glist) + 25); + + //image_drawme((pix_preview *)x, glist, 0); + canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); +} + +void pix_preview :: image_select(t_gobj *z, t_glist *glist, int state) +{ t_object *x = (t_object *)z; + if (state) { + sys_vgui(".x%x.c create rectangle \ +%d %d %d %d -tags %xSEL -outline blue\n", + glist_getcanvas(glist), + text_xpix(x, glist), text_ypix(x, glist), + text_xpix(x, glist) + 25, text_ypix(x, glist) + 25, + x); + } + else { + sys_vgui(".x%x.c delete %xSEL\n", + glist_getcanvas(glist), x); + } +} + + +void pix_preview :: image_activate(t_gobj *z, t_glist *glist, int state) +{ +} + +void pix_preview :: image_delete(t_gobj *z, t_glist *glist) +{ + + t_text *x = (t_text *)z; + pix_preview* s = (pix_preview*)z; + canvas_deletelinesfor(glist_getcanvas(glist), x); + image_erase(s, glist); +} + + +void pix_preview :: image_vis(t_gobj *z, t_glist *glist, int vis) +{ + pix_preview* s = (pix_preview*)z; + if (vis) + image_drawme(s, glist, 1, 28, 28); +} +
Deleted: trunk/externals/pdvjtools/pix_preview/pix_preview.cpp =================================================================== --- trunk/externals/pdvjtools/pix_preview/pix_preview.cpp 2008-05-24 01:44:50 UTC (rev 9892) +++ trunk/externals/pdvjtools/pix_preview/pix_preview.cpp 2008-05-24 01:51:05 UTC (rev 9893) @@ -1,538 +0,0 @@ -//////////////////////////////////////////////////////// -// -// GEM - Graphics Environment for Multimedia -// -// zmoelnig@iem.kug.ac.at -// -// Implementation file -// -// Copyright (c) 1997-1998 Mark Danks. -// Copyright (c) G\xFCnther Geiger. -// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::f\xFCr::uml\xE4ute. IEM -// Copyright (c) 2002 James Tittle & Chris Clepper -// For information on usage and redistribution, and for a DISCLAIMER OF ALL -// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. -// -///////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////// -// -// pix_preview -// -// 0409:forum::f\xFCr::uml\xE4ute:2000 -// IOhannes m zmoelnig -// mailto:zmoelnig@iem.kug.ac.at -// -///////////////////////////////////////////////////////// - -#include <iostream> -#include <string> -#include <sstream> -using namespace std; -#include "stdio.h" - - -#include "m_pd.h" -#include "m_imp.h" -#include "g_canvas.h" -#include "t_tk.h" - -#include "pix_preview.h" - -int guidebug=0; - -#define COLORGRID_SYS_VGUI2(a,b) if (guidebug) \ - post(a,b);\ - sys_vgui(a,b) - -#define COLORGRID_SYS_VGUI3(a,b,c) if (guidebug) \ - post(a,b,c);\ - sys_vgui(a,b,c) - -#define COLORGRID_SYS_VGUI4(a,b,c,d) if (guidebug) \ - post(a,b,c,d);\ - sys_vgui(a,b,c,d) - -#define COLORGRID_SYS_VGUI5(a,b,c,d,e) if (guidebug) \ - post(a,b,c,d,e);\ - sys_vgui(a,b,c,d,e) - -#define COLORGRID_SYS_VGUI6(a,b,c,d,e,f) if (guidebug) \ - post(a,b,c,d,e,f);\ - sys_vgui(a,b,c,d,e,f) - -#define COLORGRID_SYS_VGUI7(a,b,c,d,e,f,g) if (guidebug) \ - post(a,b,c,d,e,f,g );\ - sys_vgui(a,b,c,d,e,f,g) - -#define COLORGRID_SYS_VGUI8(a,b,c,d,e,f,g,h) if (guidebug) \ - post(a,b,c,d,e,f,g,h );\ - sys_vgui(a,b,c,d,e,f,g,h) - -#define COLORGRID_SYS_VGUI9(a,b,c,d,e,f,g,h,i) if (guidebug) \ - post(a,b,c,d,e,f,g,h,i );\ - sys_vgui(a,b,c,d,e,f,g,h,i) - - - char *fdata="R0lGODlhHAAcAIABAAAAAP///ywAAAAAHAAcAAACGoSPqcvtD6OctNqLs968+w+G4kiW5omm6ooUADs="; - - -/* base64 conversion*/ - -static const std::string base64_chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - -std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { - std::string ret; - int i = 0; - int j = 0; - unsigned char char_array_3[3]; - unsigned char char_array_4[4]; - - while (in_len--) { - char_array_3[i++] = *(bytes_to_encode++); - if (i == 3) { - char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for(i = 0; (i <4) ; i++) - ret += base64_chars[char_array_4[i]]; - i = 0; - } - } - - if (i) - { - for(j = i; j < 3; j++) - char_array_3[j] = '\0'; - - char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; - char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); - char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); - char_array_4[3] = char_array_3[2] & 0x3f; - - for (j = 0; (j < i + 1); j++) - ret += base64_chars[char_array_4[j]]; - - while((i++ < 3)) - ret += '='; - - } - - return ret; - -} - - - - - - - - - - - - - - - -CPPEXTERN_NEW_WITH_TWO_ARGS(pix_preview, t_floatarg, A_DEFFLOAT, t_floatarg, A_DEFFLOAT) - - - ///////////////////////////////////////////////////////// - // - // pix_preview - // - ///////////////////////////////////////////////////////// - // Constructor - // - ///////////////////////////////////////////////////////// - pix_preview :: pix_preview(t_floatarg fx, t_floatarg fy) -{ - #include "pix_preview.tk2c" - xsize = (int)fx; - ysize = (int)fy; - m_csize = 3; - - - image_widgetbehavior.w_getrectfn = image_getrect; - image_widgetbehavior.w_displacefn = image_displace; - image_widgetbehavior.w_selectfn = image_select; - image_widgetbehavior.w_activatefn = image_activate; - image_widgetbehavior.w_deletefn = image_delete; - image_widgetbehavior.w_visfn = image_vis; -#if (PD_VERSION_MINOR > 31) - image_widgetbehavior.w_clickfn = NULL; - image_widgetbehavior.w_propertiesfn = NULL; -#endif -#if PD_MINOR_VERSION < 37 - image_widgetbehavior.w_savefn = image_save; -#endif - - - class_setwidget(pix_preview_class,&image_widgetbehavior); - - if (xsize < 0) xsize = 0; - if (ysize < 0) ysize = 0; - - m_xsize = xsize; - m_ysize = ysize; - - oldimagex = xsize; - oldimagey = ysize; - - m_bufsize = m_xsize * m_ysize * m_csize; - - m_buffer = new t_atom[m_bufsize]; - - //m_dataOut = outlet_new(this->x_obj, &s_list); -} - -///////////////////////////////////////////////////////// -// Destructor -// -///////////////////////////////////////////////////////// -pix_preview :: ~pix_preview() -{ -} - -///////////////////////////////////////////////////////// -// processImage -// -///////////////////////////////////////////////////////// -void pix_preview :: processImage(imageStruct &image) -{ - int x = m_xsize, y = m_ysize, c = m_csize; - - if (image.xsize != oldimagex) { - oldimagex = image.xsize; - m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize; - } - if (image.ysize != oldimagey) { - oldimagey = image.ysize; - m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize; - } - - if (image.csize != m_csize) m_csize = image.csize; - - if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) { - // resize the image buffer - if(m_buffer)delete [] m_buffer; - m_bufsize = m_xsize * m_ysize * m_csize; - m_buffer = new t_atom[m_bufsize]; - - m_xstep = m_csize * ((float)image.xsize/(float)m_xsize); - m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize; - } - - m_data = image.data; -} - -///////////////////////////////////////////////////////// -// processYUVImage -// -///////////////////////////////////////////////////////// -void pix_preview :: processYUVImage(imageStruct &image) -{ - int x = m_xsize, y = m_ysize, c = m_csize; - - if (image.xsize != oldimagex) { - oldimagex = image.xsize; - m_xsize = ((!xsize) || (xsize > oldimagex))?oldimagex:xsize; - } - if (image.ysize != oldimagey) { - oldimagey = image.ysize; - m_ysize = ((!ysize) || (ysize > oldimagey))?oldimagey:ysize; - } - - if (image.csize != m_csize) m_csize = image.csize; - - if ( (m_xsize != x) || (m_ysize != y) || (m_csize != c) ) { - // resize the image buffer - if(m_buffer)delete [] m_buffer; - m_bufsize = m_xsize * m_ysize * m_csize; - m_buffer = new t_atom[m_bufsize]; - - m_xstep = m_csize * ((float)image.xsize/(float)m_xsize); - m_ystep = m_csize * ((float)image.ysize/(float)m_ysize) * image.xsize; - } - - m_data = image.data; -} - -///////////////////////////////////////////////////////// -// trigger -// -///////////////////////////////////////////////////////// -void pix_preview :: trigger() -{ - if (!m_data) return; - - int n = m_ysize, m = 0; - int i = 0; - - unsigned char *data, *line; - stringstream sx,sy; - - fprintf (stderr,"%d %d %d %d %d %d \n",xsize, ysize,m_xsize, m_ysize,oldimagex,oldimagey); - - std::string pnm; - std::string pnm64; - pnm += "P6\n"; - sx << m_xsize; - pnm += sx.str(); - pnm += " "; - sy << m_ysize; - pnm += sy.str(); - pnm += "\n255\n"; - - //fprintf (stderr,"%s",pnm.c_str()); - - /*/escriu el contingut de data a un arxiu.*/ - char* ig_path = "/tmp/pixdump01.pnm"; - FILE * fp = fopen(ig_path, "w"); - fprintf (fp, "P6\n%d %d\n255\n", m_xsize, m_ysize); - data = line = m_data; - switch(m_csize){ - case 4: -/* - while (n > 0) { - while (m < m_xsize) { - int r, g, b, a; - r = (int)data[chRed]; - fprintf (fp, "%c", (char)r); - i++; - g = (int)data[chGreen]; - fprintf (fp, "%c", (char)g); - i++; - b = (int)data[chBlue]; - fprintf (fp, "%c", (char)b); - i++; - a = (int)data[chAlpha]; - i++; - m++; - data = line + (int)(m_xstep * (float)m); - } - m = 0; - n--; - line = m_data + (int)(m_ystep*n); - data = line; - } - fclose (fp); -*/ - while (n > 0) { - while (m < m_xsize) { - int r, g, b, a; - r = (int)data[chRed]; - pnm += (char)r; - fprintf (fp, "%c", (char)r); - i++; - g = (int)data[chGreen]; - pnm += (char)g; - fprintf (fp, "%c", (char)g); - i++; - b = (int)data[chBlue]; - pnm += (char)b; - fprintf (fp, "%c", (char)b); - i++; - a = (int)data[chAlpha]; - i++; - m++; - data = line + (int)(m_xstep * (float)m); - } - m = 0; - n--; - line = m_data + (int)(m_ystep*n); - data = line; - } - fclose (fp); - - - //std::cout << "NOT encoded: " << pnm << std::endl; - - //pnm64 = base64_encode(reinterpret_cast<const unsigned char*>(pnm.c_str()), pnm.length()); - //std::cout << "encoded: " << pnm64 << std::endl; - - - - //m_glist = (t_glist *) canvas_getcurrent(); - - - //sys_vgui("img%x put {%s}\n", this->x_obj, reinterpret_cast<const unsigned char*>(pnm64.c_str()) ); - image_drawme((pix_preview *)this->x_obj, (t_glist *) this->getCanvas(), 0, m_xsize, m_ysize); -// sys_vgui(".x%x.c coords %xS %d %d\n", -// this->getCanvas(), this->x_obj, -// text_xpix(this->x_obj, (t_glist *)this->getCanvas()) + (m_xsize/2), text_ypix(this->x_obj, (t_glist *)this->getCanvas()) + (m_ysize/2)); - //fprintf (stderr, "%x %x - %d %d\n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); - - break; - case 2: - while (n < m_ysize) { - while (m < m_xsize/2) { - float y,u,y1,v; - u = (float)data[0] / 255.f; - SETFLOAT(&m_buffer[i], u); - i++; - y = (float)data[1] / 255.f; - SETFLOAT(&m_buffer[i], y); - i++; - v = (float)data[2] / 255.f; - SETFLOAT(&m_buffer[i], v); - i++; - y1 = (float)data[3] / 255.f; - SETFLOAT(&m_buffer[i], y1); - i++; - m++; - data = line + (int)(m_xstep * (float)m); - } - m = 0; - n++; - line = m_data + (int)(m_ystep*n); - data = line; - } - case 1: default: - int datasize=m_xsize*m_ysize*m_csize/4; - while (datasize--) { - float v; - v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i], v); - v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+1], v); - v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+2], v); - v = (float)(*data++) / 255.f; SETFLOAT(&m_buffer[i+3], v); - i+=4; - } - } - //outlet_list(m_dataOut, gensym("list"), i, m_buffer); -} - -///////////////////////////////////////////////////////// -// static member function -// -///////////////////////////////////////////////////////// -void pix_preview :: obj_setupCallback(t_class *classPtr) -{ - class_addbang(classPtr, (t_method)&pix_preview::triggerMessCallback); -} - -void pix_preview :: triggerMessCallback(void *data) -{ - GetMyClass(data)->trigger(); -} - - - - -/* widget helper functions */ - - - - -void pix_preview :: image_drawme(pix_preview *x, t_glist *glist, int firsttime, int m_xsize, int m_ysize) -{ - char* ig_path = "/tmp/pixdump01.pnm"; - if (firsttime) { - - sys_vgui("image create photo img%x -data {%s}\n",x,fdata); - sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", - glist_getcanvas(glist),text_xpix((t_object*)x, glist)+14, text_ypix((t_object*)x, glist)+14,x,x); - //fprintf (stderr, "%x %x - %d %d \n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); - } - else { - sys_vgui(".x%x.c delete %xS\n", glist_getcanvas(glist), x); - sys_vgui(".x%x.c delete img%x\n", glist_getcanvas(glist), x); - sys_vgui("image create photo img%x -file %s\n",x,ig_path); - sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", - glist_getcanvas(glist),text_xpix((t_object*)x, glist)+(m_xsize/2), text_ypix((t_object*)x, glist)+(m_ysize/2),x,x); - //sys_vgui(".x%x.c coords %xS \ -%d %d\n", - // glist_getcanvas(glist), x, - // text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); - //fprintf (stderr, "%x %x - %d %d\n",x,(t_object*)x, text_xpix((t_object*)x, glist), text_ypix((t_object*)x, glist)); - } - -} - -void pix_preview :: image_erase(pix_preview* x,t_glist* glist) -{ - int n; - sys_vgui(".x%x.c delete %xS\n", - glist_getcanvas(glist), x); - -} - - -/* ------------------------ image widgetbehaviour----------------------------- */ - - -void pix_preview :: image_getrect(t_gobj *z, t_glist *glist, - int *xp1, int *yp1, int *xp2, int *yp2) -{ - int width, height; - pix_preview* x = (pix_preview*)z; - - - width = 250; - height = 50; - *xp1 = text_xpix((t_object*)x, glist); - *yp1 = text_ypix((t_object*)x, glist); - *xp2 = text_xpix((t_object*)x, glist) + width; - *yp2 = text_ypix((t_object*)x, glist) + height; -} - -void pix_preview :: image_displace(t_gobj *z, t_glist *glist, - int dx, int dy) -{ - t_object *x = (t_object *)z; - x->te_xpix += dx; - x->te_ypix += dy; - sys_vgui(".x%x.c coords %xSEL %d %d %d %d\n", - glist_getcanvas(glist), x, - text_xpix(x, glist), text_ypix(x, glist), - text_xpix(x, glist) + 25, text_ypix(x, glist) + 25); - - //image_drawme((pix_preview *)x, glist, 0); - canvas_fixlinesfor(glist_getcanvas(glist),(t_text*) x); -} - -void pix_preview :: image_select(t_gobj *z, t_glist *glist, int state) -{ t_object *x = (t_object *)z; - if (state) { - sys_vgui(".x%x.c create rectangle \ -%d %d %d %d -tags %xSEL -outline blue\n", - glist_getcanvas(glist), - text_xpix(x, glist), text_ypix(x, glist), - text_xpix(x, glist) + 25, text_ypix(x, glist) + 25, - x); - } - else { - sys_vgui(".x%x.c delete %xSEL\n", - glist_getcanvas(glist), x); - } -} - - -void pix_preview :: image_activate(t_gobj *z, t_glist *glist, int state) -{ -} - -void pix_preview :: image_delete(t_gobj *z, t_glist *glist) -{ - - t_text *x = (t_text *)z; - pix_preview* s = (pix_preview*)z; - canvas_deletelinesfor(glist_getcanvas(glist), x); - image_erase(s, glist); -} - - -void pix_preview :: image_vis(t_gobj *z, t_glist *glist, int vis) -{ - pix_preview* s = (pix_preview*)z; - if (vis) - image_drawme(s, glist, 1, 28, 28); -} -
Modified: trunk/externals/pdvjtools/videogrid/videogrid.cpp =================================================================== --- trunk/externals/pdvjtools/videogrid/videogrid.cpp 2008-05-24 01:44:50 UTC (rev 9892) +++ trunk/externals/pdvjtools/videogrid/videogrid.cpp 2008-05-24 01:51:05 UTC (rev 9893) @@ -34,8 +34,8 @@ #include "pthread.h"
/*ffmpeg includes*/ -#include <avcodec.h> -#include <avformat.h> +#include <ffmpeg/avcodec.h> +#include <ffmpeg/avformat.h>
/*libquicktime includes*/ //#include <quicktime/lqt.h>
Added: trunk/externals/pdvjtools/videogrid/videogrid.libs =================================================================== --- trunk/externals/pdvjtools/videogrid/videogrid.libs (rev 0) +++ trunk/externals/pdvjtools/videogrid/videogrid.libs 2008-05-24 01:51:05 UTC (rev 9893) @@ -0,0 +1 @@ +-lavcodec -lavformat -lavutil -lquicktime
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.