netpbm.cpp

来自「PIXIL is a small footprint operating env」· C++ 代码 · 共 69 行

CPP
69
字号
//////////////////////////////////////////////////////// Transparent support for several files formats in Qt Pixmaps,// using the NetPBM tools.//// Dirk Schoenberger, Jul 1997.//#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include <qimage.h>#define CMDBUFLEN     4096//////// the real filter.//void import_graphic (char *filter, QImageIO *image){  char * tmpFileName;  QImage myimage;  char cmdBuf [CMDBUFLEN];  tmpFileName = tmpnam(NULL);  sprintf (cmdBuf, "%s %s > %s", filter, image->fileName(), tmpFileName);//  printf (cmdBuf);//  fflush (stdout);  system (cmdBuf);  myimage.load (tmpFileName);  unlink (tmpFileName);  image->setImage (myimage);  image->setStatus (0);}//////// PCX IO handlers for QImage.//void read_pcx (QImageIO *image){  import_graphic ("pcxtoppm", image);}//////// IFF IO handlers for QImage.//void read_ilbm (QImageIO *image){  import_graphic ("ilbmtoppm", image);}//////// TGA IO handlers for QImage.//void read_tga (QImageIO *image){  import_graphic ("tgatoppm", image);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?