rdesktop和gocr之间的接口

时间:2017-03-13 19:20:42

标签: ocr

我正在尝试将gocr集成到rdesktop。 为此,我正在考虑将代码添加到ui_memblt例程中。我有两种方法:

a)使用gocr将屏幕更改(rects)复制到由“守护程序”处理的共享内存中。我的问题是,我不知道Pixmap的格式,将其字节复制到共享内存区域。

b)使用XShm例程:

if(ximage==NULL)
 {               
  ximage=XShmCreateImage(g_display, visual, 1, /* g_depth, */ XYPixmap, NULL, &shminfo, g_width, g_height);
  shminfo.shmid=shmget(IPC_PRIVATE,ximage->bytes_per_line*ximage->height, IPC_CREAT|0777);
  shminfo.shmaddr=ximage->data=shmat(shminfo.shmid,0,0);
  shminfo.readOnly=True;
  XShmAttach(g_display,&shminfo);
  printf("MIT-SHM: Shared memory KID=%d, at=%p\n",shminfo.shmid,shminfo.shmaddr);
}               
XShmPutImage(g_display, g_wnd, g_gc, ximage, 0, 0, x, y, cx, cy, False);

当我执行此代码时,我收到了:

MIT-SHM: Shared memory KID=71827465, at=0xb6c25000
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request:  130 (MIT-SHM)
Minor opcode of failed request:  3 (X_ShmPutImage)
Serial number of failed request:  78
Current serial number in output stream:  78

有什么想法吗? 我正在尝试在rdesktop和gocr“守护进程”之间进行快速复制(或共享)。

0 个答案:

没有答案
相关问题