yuv colorspace/range + prefs, ffmpeg colorrange probe, x11 direct force colormodel...
[goodguy/history.git] / cinelerra-5.1 / guicast / test4.C
index 6e9d27f72261b62ce374af58dd43e8434dcad708..79b8623e94696dd58a1f05e07da7104c7ab1bcae 100644 (file)
@@ -1,5 +1,5 @@
 
-//c++ -g -I../guicast testwindow.C ../guicast/x86_64/libguicast.a \
+//c++ -g -I../guicast test4.C ../guicast/x86_64/libguicast.a \
 // -DHAVE_GL -DHAVE_XFT -I/usr/include/freetype2 -lGL -lX11 -lXext \
 // -lXinerama -lXv -lpng  -lfontconfig -lfreetype -lXft -pthread
 
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include "bcwindowbase.h"
 #include "bcwindow.h"
 #include "bcsignals.h"
-#include "colors.h"
+#include "bccolors.h"
 #include "fonts.h"
 #include "thread.h"
 #include "vframe.h"
@@ -81,7 +82,7 @@ const char *cmdl[] = {
  "yuv422p", "rgb888", "rgba8888", "rgb161616", "rgba16161616", "yuv888", "yuva8888", "yuv161616",
  "yuva16161616", "yuv411p", "uvy422", "yuv422", "argb8888", "abgr8888", "a8", "a16",
  "yuv101010", "vyu888", "uyva8888", "yuv444p", "yuv410p", "rgb_float", "rgba_float", "a_float",
- "rgb_floatp", "rgba_floatp",
+ "rgb_floatp", "rgba_floatp", "yuv420pi", "ayuv16161616", "grey8", "grey16",
 };
 
 void write_pgm(uint8_t *tp, int w, int h, const char *fmt, ...)
@@ -119,21 +120,22 @@ int main(int ac, char **av)
        struct stat st;  fstat(fd,&st);
        unsigned char *dat = new unsigned char[st.st_size];
        read(fd, dat, st.st_size);
-       VFrame ifrm(dat, st.st_size);
+       VFramePng ifrm(dat, st.st_size);
        delete [] dat;
        close(fd);
        int w = ifrm.get_w(), h = ifrm.get_h();
        TestWindow test_window(100, 100, w, h);
-       for( int fr_cmdl=1; fr_cmdl<=32; ++fr_cmdl ) {
+       for( int fr_cmdl=1; fr_cmdl<=37; ++fr_cmdl ) {
                if( fr_cmdl == BC_TRANSPARENCY || fr_cmdl == BC_COMPRESSED ) continue;
                if( fr_cmdl == BC_A8 || fr_cmdl == BC_A16 ) continue;
                if( fr_cmdl == BC_A_FLOAT || fr_cmdl == 8 ) continue;
                VFrame afrm(w, h, fr_cmdl, -1);
                afrm.transfer_from(&ifrm, 0);
-               for( int to_cmdl=1; to_cmdl<=32; ++to_cmdl ) {
+               for( int to_cmdl=1; to_cmdl<=37; ++to_cmdl ) {
                        if( to_cmdl == BC_TRANSPARENCY || to_cmdl == BC_COMPRESSED ) continue;
                        if( to_cmdl == BC_A8 || to_cmdl == BC_A16 ) continue;
                        if( to_cmdl == BC_A_FLOAT || to_cmdl == 8 ) continue;
+                       printf("xfer_%s_to_%s\n", cmdl[fr_cmdl],cmdl[to_cmdl]);
                        VFrame bfrm(w, h, to_cmdl, -1);
                        bfrm.transfer_from(&afrm, 0);
                        test_window.draw(&bfrm);
@@ -141,9 +143,9 @@ int main(int ac, char **av)
                        cfrm.transfer_from(&bfrm, 0);
                        printf("xfer_%s_to_%s\n",cmdl[fr_cmdl],cmdl[to_cmdl]);
                        test_window.show_text(50,50, "xfer_%s_to_%s",cmdl[fr_cmdl],cmdl[to_cmdl]);
-                       write_pgm(cfrm.get_data(), w,h, "/tmp/test/xfer_%s_to_%s.pgm",
-                               cmdl[fr_cmdl],cmdl[to_cmdl]);
-                       //usleep(100000);
+//                     write_ppm(cfrm.get_data(), w,h, "/tmp/test/xfer_%s_to_%s.pgm",
+//                             cmdl[fr_cmdl],cmdl[to_cmdl]);
+//                     usleep(100000);
                }
        }
        test_window.close_window();