X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fanalogtv.h;h=01dca14d95f130ad097447a7e670f73e83c93aa4;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hp=2a76db0fa500032bc431e96ddfe7a0bab72cd32f;hpb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;p=xscreensaver diff --git a/hacks/analogtv.h b/hacks/analogtv.h index 2a76db0f..01dca14d 100644 --- a/hacks/analogtv.h +++ b/hacks/analogtv.h @@ -1,4 +1,4 @@ -/* analogtv, Copyright (c) 2003 Trevor Blackwell +/* analogtv, Copyright (c) 2003, 2004 Trevor Blackwell * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -65,11 +65,16 @@ enum { ANALOGTV_SIGNAL_LEN=ANALOGTV_V*ANALOGTV_H, /* The number of intensity levels we deal with for gamma correction &c */ - ANALOGTV_CV_MAX=1024 + ANALOGTV_CV_MAX=1024, + + /* MAX_LINEHEIGHT corresponds to 2400 vertical pixels, beyond which + it interpolates extra black lines. */ + ANALOGTV_MAX_LINEHEIGHT=12 + }; typedef struct analogtv_input_s { - char signal[ANALOGTV_V+1][ANALOGTV_H]; + signed char signal[ANALOGTV_V+1][ANALOGTV_H]; int do_teletext; @@ -152,9 +157,10 @@ typedef struct analogtv_s { XShmSegmentInfo shm_info; #endif int visdepth,visclass,visbits; - int red_invprec,red_shift,red_mask; - int green_invprec,green_shift,green_mask; - int blue_invprec,blue_shift,blue_mask; + int red_invprec, red_shift; + int green_invprec, green_shift; + int blue_invprec, blue_shift; + unsigned int red_mask, green_mask, blue_mask; Colormap colormap; int usewidth,useheight,xrepl,subwidth; @@ -162,10 +168,6 @@ typedef struct analogtv_s { GC gc; int screen_xo,screen_yo; /* centers image in window */ - void (*event_handler)(Display *dpy, XEvent *event); - int (*key_handler)(Display *dpy, XEvent *event,void *key_data); - void *key_data; - int flutter_horiz_desync; int flutter_tint; @@ -212,6 +214,11 @@ typedef struct analogtv_s { double rx_signal_level; double rx_signal[ANALOGTV_SIGNAL_LEN + 2*ANALOGTV_H]; + struct { + int index; + double value; + } leveltable[ANALOGTV_MAX_LINEHEIGHT+1][ANALOGTV_MAX_LINEHEIGHT+1]; + } analogtv; @@ -275,18 +282,31 @@ int analogtv_handle_events (analogtv *it); #define ANALOGTV_DEFAULTS_SHM #endif +#ifndef USE_IPHONE +# define ANALOGTV_DEF_BRIGHTNESS "2" +# define ANALOGTV_DEF_CONTRAST "150" +#else + /* Need to really crank this up for it to look good on the iPhone screen. */ +# define ANALOGTV_DEF_BRIGHTNESS "3" +# define ANALOGTV_DEF_CONTRAST "1000" +#endif + #define ANALOGTV_DEFAULTS \ "*TVColor: 70", \ "*TVTint: 5", \ - "*TVBrightness: 2", \ - "*TVContrast: 150",\ + "*TVBrightness: " ANALOGTV_DEF_BRIGHTNESS, \ + "*TVContrast: " ANALOGTV_DEF_CONTRAST, \ "*Background: Black", \ "*use_cmap: 0", \ "*geometry: 800x600", \ + "*fpsSolid: True", \ ANALOGTV_DEFAULTS_SHM #define ANALOGTV_OPTIONS \ - { "-use-cmap", ".use_cmap", XrmoptionSepArg, 0 }, - + { "-use-cmap", ".use_cmap", XrmoptionSepArg, 0 }, \ + { "-tv-color", ".TVColor", XrmoptionSepArg, 0 }, \ + { "-tv-tint", ".TVTint", XrmoptionSepArg, 0 }, \ + { "-tv-brightness", ".TVBrightness", XrmoptionSepArg, 0 }, \ + { "-tv-contrast", ".TVContrast", XrmoptionSepArg, 0 }, #endif /* _XSCREENSAVER_ANALOGTV_H */