亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? display.c

?? h.263解碼器 視頻會議 圖像采集 圖像壓縮
?? C
字號:
#ifdef DISPLAY#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include "config.h"#include "tmndec.h"#include "global.h"/* private prototypes */static void display_image _ANSI_ARGS_((XImage *ximage, unsigned char *dithered_image));/* display related data */unsigned long wpixel[3];static unsigned char *dithered_image;/* X11 related variables */static Display *display;static Window window;static GC gc;static int dpy_depth;XImage *ximage;unsigned char pixel[256];#ifdef SH_MEM#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/XShm.h>extern int XShmQueryExtension _ANSI_ARGS_((Display *dpy));extern int XShmGetEventBase _ANSI_ARGS_((Display *dpy));static int HandleXError _ANSI_ARGS_((Display *dpy, XErrorEvent *event));static void InstallXErrorHandler _ANSI_ARGS_((void));static void DeInstallXErrorHandler _ANSI_ARGS_((void));static int shmem_flag;static XShmSegmentInfo shminfo1, shminfo2;static int gXErrorFlag;static int CompletionType = -1;static int HandleXError(dpy, event)Display *dpy;XErrorEvent *event;{  gXErrorFlag = 1;  return 0;}static void InstallXErrorHandler(){  XSetErrorHandler(HandleXError);  XFlush(display);}static void DeInstallXErrorHandler(){  XSetErrorHandler(NULL);  XFlush(display);}#endif/* connect to server, create and map window, * allocate colors and (shared) memory */void init_display(name)char *name;{  int crv, cbu, cgu, cgv;  int y, u, v, r, g, b;  int i;  char dummy;  int screen;  Visual *visual;  int dpy_class;  Colormap cmap;  int private;  XColor xcolor;  unsigned int fg, bg;  char *hello = "H.263 Display";  XSizeHints hint;  XEvent xev;  XSetWindowAttributes xswa;  unsigned long tmp_pixel;  unsigned int mask;  display = XOpenDisplay(name);  if (display == NULL)    error("Can not open display\n");  screen = DefaultScreen(display);  visual = DefaultVisual (display, screen);  dpy_depth = DefaultDepth (display, screen);  dpy_class = visual->class;  if (!((dpy_class == TrueColor && dpy_depth == 32)        || (dpy_class == TrueColor && dpy_depth == 24)        || (dpy_class == TrueColor && dpy_depth == 16)        || (dpy_class == PseudoColor && dpy_depth == 8)))    error ("requires 8 bit PseudoColor or 16/24/32 bit TrueColor display\n");  if (dpy_class == TrueColor && dpy_depth == 32)    printf("TrueColor : 32 bit colordepth\n");  if (dpy_class == TrueColor && dpy_depth == 24)    printf("TrueColor : 24 bit colordepth\n");  if (dpy_class == TrueColor && dpy_depth == 16)    printf("TrueColor : 16 bit colordepth\n");  if (dpy_class == PseudoColor && dpy_depth == 8)    printf("PseudoColor : 8 bit colordepth, 4x4 ordered dither\n");  /* width and height of the display window */  if (expand) {    hint.min_width = hint.max_width = hint.width = 2*horizontal_size;    hint.min_height = hint.max_height = hint.height = 2*vertical_size;  }  else {    hint.min_width = hint.max_width = hint.width = horizontal_size;    hint.min_height = hint.max_height = hint.height = vertical_size;  }  hint.flags = PSize | PMinSize | PMaxSize;  /* Get some colors */  bg = WhitePixel (display, screen);  fg = BlackPixel (display, screen);  /* Make the window */  mask = CWBackPixel | CWBorderPixel;  if (dpy_depth == 32 || dpy_depth == 24 || dpy_depth == 16) {    mask |= CWColormap;    xswa.colormap = XCreateColormap (display, DefaultRootWindow (display),             visual, AllocNone);  }  xswa.background_pixel = bg;  xswa.border_pixel = fg;  window = XCreateWindow (display, DefaultRootWindow (display),          hint.x, hint.y, hint.width, hint.height,          1, dpy_depth, InputOutput, visual, mask, &xswa);  XSelectInput(display, window, StructureNotifyMask);  /* Tell other applications about this window */  XSetStandardProperties (display, window, hello, hello, None, NULL, 0, &hint);  /* Map window. */  XMapWindow(display, window);  /* Wait for map. */  do  {    XNextEvent(display, &xev);  }  while (xev.type != MapNotify || xev.xmap.event != window);  XSelectInput(display, window, NoEventMask);  /* allocate colors */  gc = DefaultGC(display, screen);  if (dpy_depth == 8) {    XWindowAttributes xwa;    cmap = DefaultColormap(display, screen);    private = 0;    /* matrix coefficients */    crv = convmat[matrix_coefficients][0];    cbu = convmat[matrix_coefficients][1];    cgu = convmat[matrix_coefficients][2];    cgv = convmat[matrix_coefficients][3];    /* color allocation:     * i is the (internal) 8 bit color number, it consists of separate     * bit fields for Y, U and V: i = (yyyyuuvv), we don't use yyyy=0000     * yyyy=0001 and yyyy=1111, this leaves 48 colors for other applications     *     * the allocated colors correspond to the following Y, U and V values:     * Y:   40, 56, 72, 88, 104, 120, 136, 152, 168, 184, 200, 216, 232     * U,V: -48, -16, 16, 48     *     * U and V values span only about half the color space; this gives     * usually much better quality, although highly saturated colors can     * not be displayed properly     *     * translation to R,G,B is implicitly done by the color look-up table     */    for (i=32; i<240; i++) {      /* color space conversion */      y = 16*((i>>4)&15) + 8;      u = 32*((i>>2)&3)  - 48;      v = 32*(i&3)       - 48;      y = 76309 * (y - 16); /* (255/219)*65536 */            r = clp[(y + crv*v + 32768)>>16];      g = clp[(y - cgu*u -cgv*v + 32768)>>16];      b = clp[(y + cbu*u + 32786)>>16];      /* X11 colors are 16 bit */      xcolor.red   = r << 8;      xcolor.green = g << 8;      xcolor.blue  = b << 8;      if (XAllocColor(display, cmap, &xcolor) != 0)        pixel[i] = xcolor.pixel;      else {        /* allocation failed, have to use a private colormap */        if (private)          error("Couldn't allocate private colormap");        private = 1;        if (!quiet)          fprintf(stderr, "Using private colormap (%d colors were "          "available).\n", i-32);        /* Free colors. */        while (--i >= 32)        {          tmp_pixel = pixel[i]; /* because XFreeColors expects unsigned long */          XFreeColors(display, cmap, &tmp_pixel, 1, 0);        }        /* i is now 31, this restarts the outer loop */        /* create private colormap */        XGetWindowAttributes(display, window, &xwa);        cmap = XCreateColormap(display, window, xwa.visual, AllocNone);        XSetWindowColormap(display, window, cmap);      }    }  }#ifdef SH_MEM  if (XShmQueryExtension(display))    shmem_flag = 1;  else  {    shmem_flag = 0;    if (!quiet)      fprintf(stderr, "Shared memory not supported\nReverting to normal "              "Xlib\n");  }  if (shmem_flag)    CompletionType = XShmGetEventBase(display) + ShmCompletion;  InstallXErrorHandler();  if (shmem_flag)  {    if (expand)      ximage = XShmCreateImage(display, visual, dpy_depth, ZPixmap, NULL,               &shminfo1,               2*coded_picture_width, 2*coded_picture_height);    else      ximage = XShmCreateImage(display, visual, dpy_depth, ZPixmap, NULL,               &shminfo1,               coded_picture_width, coded_picture_height);        /* If no go, then revert to normal Xlib calls. */    if (ximage==NULL)    {      if (ximage!=NULL)        XDestroyImage(ximage);      if (!quiet)        fprintf(stderr, "Shared memory error, disabling (Ximage error)\n");      goto shmemerror;    }    /* Success here, continue. */    shminfo1.shmid = shmget(IPC_PRIVATE,                             ximage->bytes_per_line * ximage->height,                            IPC_CREAT | 0777);    if (shminfo1.shmid<0)    {      XDestroyImage(ximage);      if (!quiet)        fprintf(stderr, "Shared memory error, disabling (seg id error)\n");      goto shmemerror;    }    shminfo1.shmaddr = (char *) shmat(shminfo1.shmid, 0, 0);    shminfo2.shmaddr = (char *) shmat(shminfo2.shmid, 0, 0);    if (shminfo1.shmaddr==((char *) -1))    {      XDestroyImage(ximage);      if (shminfo1.shmaddr!=((char *) -1))        shmdt(shminfo1.shmaddr);      if (!quiet)      {        fprintf(stderr, "Shared memory error, disabling (address error)\n");      }      goto shmemerror;    }    ximage->data = shminfo1.shmaddr;    dithered_image = (unsigned char *)ximage->data;    shminfo1.readOnly = False;    XShmAttach(display, &shminfo1);    XSync(display, False);    if (gXErrorFlag)    {      /* Ultimate failure here. */      XDestroyImage(ximage);      shmdt(shminfo1.shmaddr);      if (!quiet)        fprintf(stderr, "Shared memory error, disabling.\n");      gXErrorFlag = 0;      goto shmemerror;    }    else    {      shmctl(shminfo1.shmid, IPC_RMID, 0);    }    if (!quiet)    {      fprintf(stderr, "Sharing memory.\n");    }  }  else  {shmemerror:    shmem_flag = 0;#endif    if (expand) {      ximage = XCreateImage(display,visual,dpy_depth,ZPixmap,0,&dummy,            2*coded_picture_width,2*coded_picture_height,8,0);      if (!(dithered_image =            (unsigned char *)malloc(coded_picture_width*coded_picture_height*            (dpy_depth > 8 ? sizeof (int)*4 :              sizeof (unsigned char))*4)))        error("malloc failed");    }    else {      ximage = XCreateImage(display,visual,dpy_depth,ZPixmap,0,&dummy,            coded_picture_width,coded_picture_height,8,0);      if (!(dithered_image =            (unsigned char *)malloc(coded_picture_width*coded_picture_height*            (dpy_depth > 8 ? sizeof (int) :              sizeof (unsigned char)))))        error("malloc failed");    }#ifdef SH_MEM  }  DeInstallXErrorHandler();#endif  if (dpy_depth == 32 || dpy_depth == 24 || dpy_depth == 16) {    XWindowAttributes xwa;    XGetWindowAttributes(display, window, &xwa);    wpixel[0] = xwa.visual->red_mask;    wpixel[1] = xwa.visual->green_mask;    wpixel[2] = xwa.visual->blue_mask;    /* If the colors in 16/24/32-bit mode are wrong, try this instead       of the above three lines */    /*    wpixel[2] = xwa.visual->red_mask;    wpixel[1] = xwa.visual->green_mask;    wpixel[0] = xwa.visual->blue_mask;    */    InitColorDither(dpy_depth == 24 || dpy_depth == 32);  }  else {    ord4x4_dither_init ();  }}void exit_display(){#ifdef SH_MEM  if (shmem_flag)  {    XShmDetach(display, &shminfo1);    XDestroyImage(ximage);    shmdt(shminfo1.shmaddr);  }#endif}static void display_image(ximage,dithered_image)XImage *ximage;unsigned char *dithered_image;{  int t = 1; /* Always work in native bit and byte order. This tells Xlib to    reverse bit and byte order if necessary when crossing a    network. Frankly, this part of XImages is somewhat    underdocumented, so this may not be exactly correct.  */  if (*(char *)&t == 1) {    ximage->byte_order = LSBFirst;    ximage->bitmap_bit_order = LSBFirst;  }  else {    ximage->byte_order = MSBFirst;    ximage->bitmap_bit_order = MSBFirst;  }      /* display dithered image */#ifdef SH_MEM  if (shmem_flag)  {    XShmPutImage(display, window, gc, ximage,                  0, 0, 0, 0, ximage->width, ximage->height, True);    XFlush(display);          while (1)    {      XEvent xev;              XNextEvent(display, &xev);      if (xev.type == CompletionType)        break;    }  }  else #endif  {    ximage->data = (char *) dithered_image;     XPutImage(display, window, gc, ximage, 0, 0, 0, 0, ximage->width, ximage->height);  }}void dither(src)unsigned char *src[];{  if (dpy_depth == 24 || dpy_depth == 32) {    if (ximage->bits_per_pixel == 24)      ConvertYUVtoRGB(src[0],src[1],src[2], dithered_image,		      coded_picture_width,		      coded_picture_height);    else      Color32DitherImage(src, dithered_image);  }    else if (dpy_depth == 16) {    Color16DitherImage(src, dithered_image);  }  else {    ord4x4_dither_frame (src, dithered_image);  }  display_image (ximage, dithered_image);}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产精品厨房| 色综合久久天天| 99精品视频在线观看免费| 91视频你懂的| 8x福利精品第一导航| 久久在线观看免费| 亚洲日本在线观看| 麻豆视频观看网址久久| 国产成人午夜电影网| 日本精品一区二区三区高清 | 中文字幕一区在线| 亚洲一二三级电影| 国产一区二区三区香蕉| 欧美在线播放高清精品| 久久这里只有精品6| 亚洲曰韩产成在线| 国产激情一区二区三区| 欧美色图激情小说| 国产精品视频免费看| 五月天激情综合| 成人福利视频在线| 日韩欧美在线影院| 亚洲精品高清在线观看| 国内精品国产成人国产三级粉色| 99riav久久精品riav| 精品国产人成亚洲区| 亚洲精品国产无套在线观| 久久精品国产精品亚洲精品| 99re成人在线| 欧美精品一区二区三区一线天视频| 一区二区不卡在线视频 午夜欧美不卡在| 日本网站在线观看一区二区三区| 91丝袜高跟美女视频| 精品成人一区二区| 亚洲一区二区三区四区中文字幕| 丁香六月综合激情| 精品国精品国产| 亚洲成人av福利| 91啪九色porn原创视频在线观看| 久久久久久久综合色一本| 爽爽淫人综合网网站| 99国产精品久| 中国色在线观看另类| 精品一区精品二区高清| 欧美日韩情趣电影| 亚洲精品伦理在线| 风间由美一区二区av101| 日韩一区二区高清| 亚洲第一在线综合网站| 99re成人在线| 成人免费在线播放视频| 国产91色综合久久免费分享| 精品国产乱码久久| 日本亚洲视频在线| 欧美伦理电影网| 亚洲伊人色欲综合网| av一二三不卡影片| 国产精品私人影院| 国产91精品精华液一区二区三区| 亚洲精品一区二区三区蜜桃下载| 美女脱光内衣内裤视频久久影院| 欧美群妇大交群中文字幕| 亚洲精品成人精品456| 91理论电影在线观看| 国产精品久久夜| aaa欧美大片| 18欧美乱大交hd1984| proumb性欧美在线观看| 国产精品天干天干在线综合| 国产91在线看| 中文字幕中文字幕中文字幕亚洲无线| 丁香六月久久综合狠狠色| 国产亚洲午夜高清国产拍精品| 久久91精品国产91久久小草| 日韩欧美的一区| 久久精品久久99精品久久| 日韩三级免费观看| 黄色精品一二区| 久久亚洲综合色| 国产sm精品调教视频网站| 国产精品色一区二区三区| 播五月开心婷婷综合| 中文字幕视频一区| 91浏览器入口在线观看| 一区二区三区在线不卡| 欧美日韩精品高清| 奇米四色…亚洲| 精品国产一区a| 成人av影院在线| 亚洲综合色在线| 欧美军同video69gay| 麻豆精品在线视频| 国产亚洲精品7777| 99国产精品国产精品毛片| 亚洲一区二区三区激情| 欧美精品粉嫩高潮一区二区| 久久成人久久爱| 欧美韩国日本不卡| 色婷婷亚洲一区二区三区| 日韩电影免费一区| 久久久噜噜噜久噜久久综合| av在线不卡免费看| 午夜精品福利在线| 久久只精品国产| 99久久精品99国产精品| 天堂蜜桃一区二区三区 | 久久国产乱子精品免费女| 久久综合成人精品亚洲另类欧美 | 成人欧美一区二区三区视频网页| 色婷婷久久久久swag精品| 日本vs亚洲vs韩国一区三区二区| 久久精品欧美一区二区三区麻豆 | 亚洲韩国精品一区| 日韩欧美国产成人一区二区| 成人免费看的视频| 爽好多水快深点欧美视频| 久久麻豆一区二区| 在线亚洲欧美专区二区| 久久国内精品视频| 亚洲区小说区图片区qvod| 91精品国产免费久久综合| 成人毛片在线观看| 亚洲r级在线视频| 国产亚洲欧美激情| 欧美在线观看视频一区二区三区| 久久精品二区亚洲w码| 亚洲精品日韩一| www国产精品av| 欧美日韩免费观看一区三区| 国产精品影视在线| 午夜精品123| 国产精品国产三级国产普通话99 | 麻豆精品在线播放| 亚洲男人的天堂一区二区| 欧美成人精品福利| 91黄色免费看| 国产99久久久久| 青青草伊人久久| 亚洲精品中文在线| 欧美激情中文不卡| 日韩免费观看2025年上映的电影| 91浏览器入口在线观看| 国产精品一区二区在线播放| 三级影片在线观看欧美日韩一区二区| 国产精品午夜电影| 久久一区二区三区四区| 91精品国产高清一区二区三区蜜臀| 99精品视频在线观看| 国产精品一区二区三区四区| 日韩国产高清在线| 亚洲一区二区中文在线| 中文字幕欧美一区| 国产欧美精品一区二区三区四区| 欧美一区二区三区免费视频| 色婷婷亚洲综合| jiyouzz国产精品久久| 国内成+人亚洲+欧美+综合在线 | 欧美精品黑人性xxxx| 91丨国产丨九色丨pron| 国产福利一区二区三区视频在线 | 欧美日韩一区不卡| 99久久国产免费看| 国产福利一区在线观看| 精品一区二区三区在线观看国产| 香蕉影视欧美成人| 亚洲在线观看免费| 夜夜揉揉日日人人青青一国产精品| 国产精品无码永久免费888| 久久精品人人做| 久久久综合网站| 久久久精品综合| 久久久久久一二三区| 欧美精品一区二区不卡 | 国产又黄又大久久| 久久99精品久久久久久国产越南 | 久久色.com| 2021中文字幕一区亚洲| 欧美成人综合网站| 精品国产91洋老外米糕| 制服丝袜国产精品| 欧美一区二区三区性视频| 欧美日韩美少妇| 欧美女孩性生活视频| 欧美区在线观看| 欧美一区午夜精品| 日韩一级黄色大片| 欧美r级电影在线观看| 久久美女高清视频 | 色综合色综合色综合| 色综合天天综合网国产成人综合天| 成人av网站免费| 色综合网色综合| 欧美伊人久久久久久久久影院 | 偷拍日韩校园综合在线| 亚洲成国产人片在线观看| 日韩成人一区二区三区在线观看| 免费欧美在线视频| 激情综合色播五月| 国产福利精品一区二区| 91亚洲永久精品|