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

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

?? bmp.c

?? epson 13506 driver code
?? C
?? 第 1 頁 / 共 4 頁
字號:
         }
      }
   else
      seWriteRegByte(REG_DISPLAY_MODE, seReadRegByte(REG_DISPLAY_MODE) & ~ROTATE90_MODE_BIT);
   
   
   ShowBMP(fname, 0, 0);

   DisplayBlank(FALSE);
   
   seGetResolution(&nWidth, &nHeight);
   
   if (kbhit() && (getch() == ESC))
      exit(1);
   
   return SUCCEED;
}
   
/*---------------------------------------------GetBMPInfo( )------*/
void GetBMPInfo(char *fname, unsigned *width, unsigned *height, unsigned *BitsPerPixel)
{
   BITMAPFILEHEADER bfh;
   BITMAPINFOHEADER inf;
   int ff;
   
   if( (ff = open(fname,O_RDONLY | O_BINARY)) == -1 )
   {
      printf("\nERROR: Failed to open BMP file:'%s'\n", fname);
      PrintUsage();
      close(ff);
      exit(1);
   }
   
   read(ff,&bfh,sizeof(BITMAPFILEHEADER));
   if( bfh.bfType != BFT_BMAP )
   {
      printf("\nERROR: '%s' is not a valid bitmap file.\n",fname);
      close(ff);
      exit(1);
   }
   
   read(ff,&inf,sizeof(BITMAPINFOHEADER));
   
   *BitsPerPixel = inf.biBitCount;
   
   *width = (unsigned) inf.biWidth;
   *height = (unsigned) inf.biHeight;

   close(ff);
}

/*---------------------------------------------ShowBMP( )------*/
unsigned ShowBMP(char *fname, unsigned DstX, unsigned DstY)
{
   BITMAPFILEHEADER bfh;
   BITMAPINFOHEADER inf;
   RGBQUAD rgbQ;
   int ff, i;
   unsigned BitsPerPixel, DesiredBitsPerPixel;
   unsigned ImgWidth, ImgHeight;
   unsigned nWidth, nHeight;
   int tmp;
   unsigned BytesPerScanline;
   BYTE *pLut;
   unsigned VirtualWidth, VirtualHeight;
   
   BYTE LUT[256*3];
   
   
   if( (ff = open(fname,O_RDONLY | O_BINARY)) == -1 )
   {
      printf("\nERROR: Failed to open BMP file:'%s'\n", fname);
      PrintUsage();
      close(ff);
      return FAIL;
   }
   
   read(ff,&bfh,sizeof(BITMAPFILEHEADER));
   if( bfh.bfType != BFT_BMAP )
   {
      printf("\nERROR: '%s' is not a valid bitmap file.\n",fname);
      close(ff);
      return FAIL;
   }
   
   read(ff,&inf,sizeof(BITMAPINFOHEADER));
   
   BitsPerPixel = inf.biBitCount;
   
   ImgWidth = (unsigned) inf.biWidth;
   ImgHeight = (unsigned) inf.biHeight;
   
   if (inf.biCompression)
      gbImgCompress = TRUE;
   else
      gbImgCompress = FALSE;
   
   
   if (VerboseMode)
   {
      printf("Image Size:    %d x %d x %d bits-per-pixel\n",
         ImgWidth, ImgHeight, BitsPerPixel);
      
      printf("Compression:   ");
      
      if (gbImgCompress)
         printf("YES\n");
      else
         printf("NO\n");
   }
   
   
   /*
   ** Turn off display by blanking display
   */
   seDisplayBlank(TRUE);
   
   
   if (BitsPerPixel == 24)
      DesiredBitsPerPixel = 16;
   else
      DesiredBitsPerPixel = BitsPerPixel;
   
   seGetResolution( &nWidth, &nHeight );
   
   if (ImgHeight > nHeight)
      VirtualHeight = ImgHeight;
   else
      VirtualHeight = nHeight;

   seDisplayBlank(TRUE);
      
   seGetResolution(&VirtualWidth, &VirtualHeight);
   BytesPerScanline = seGetBytesPerScanline();
   
   if (BitsPerPixel >= 15)
      tmp = 16;
   else
      tmp = BitsPerPixel;
   
   VirtualWidth = (unsigned) (BytesPerScanline * 8L / tmp);

   if (BitsPerPixel <= 8)  /* no DAC for 16 Bpp */
   {
      /* Init LUT entries */
      
      pLut = &LUT[0];
      
      for ( i=0; i<pow(2,(double)BitsPerPixel); i++ )
      {
         read(ff,&rgbQ,sizeof(RGBQUAD));
         
         *pLut++ = rgbQ.rgbRed;
         *pLut++ = rgbQ.rgbGreen;
         *pLut++ = rgbQ.rgbBlue;
      }
   }
   
   if ( gbImgCompress == FALSE )
      ShowUncompressed( ff, DstX, DstY, ImgHeight, ImgWidth, VirtualWidth, VirtualHeight, nWidth, BitsPerPixel );
   else
      ShowCompressed( ff, DstX, DstY, ImgHeight, ImgWidth, VirtualWidth, VirtualHeight, nWidth, BitsPerPixel );
   
   
   if (BitsPerPixel <= 8)  /* no DAC for 16 Bpp */
      WriteLut( GetActiveSurfaceNumber(), LUT, (int) pow(2, (double) BitsPerPixel) );
   
   
   /*
   ** Turn on display by turning off display blanking
   */
   seDisplayBlank(FALSE);
   
   close(ff);
   
   return SUCCEED;
}
   
/*---------------------------------------------LineBlt( )------*/
//
// Because VirtualWidth is always 1024 in SwivelView 90/270 modes, it is necessary
// to determine how wide the display is with PhysicalWidth. PhysicalWidth, for a panel
// of 640x480 in SwivelView 90/270, is 480 pixels wide.
//
void LineBlt( BYTE far *pImgBuf, unsigned ImgWidth, unsigned DstX, unsigned DstY, unsigned VirtualWidth, unsigned PhysicalWidth, unsigned Bpp, DWORD DispLinearAddr )
{
   DWORD DstAddr;
   unsigned regDisplayMode;
   DWORD Count;
   DWORD Mask;
   DWORD val;
   DWORD *dwImgBuf;
   
   /* adjust ImgWidth */
   if ( ImgWidth > (PhysicalWidth-DstX) )
   {
      ImgWidth = PhysicalWidth-DstX;
   }
   
   regDisplayMode = seReadRegByte(REG_DISPLAY_MODE);

   
   DstAddr = DispLinearAddr - seGetLinearDisplayAddress();

   if (DstAddr > seGetInstalledMemorySize())
      DstAddr = 0;
   
   DstAddr += ((DWORD)DstY*(DWORD)VirtualWidth + DstX) * Bpp / 8;
   
   if (DstAddr < 0x200000)
      {
      dwImgBuf = (DWORD *) pImgBuf;

      Count = ImgWidth * Bpp;
      Mask = (1 << (Count & 31)) - 1;
      Count >>= 5;

      do
         {
         seWriteDisplayDwords(DstAddr, *dwImgBuf++, 1);
         DstAddr += sizeof (long);
         --Count;
         } while (Count);
   
      val = seReadDisplayDword(DstAddr);
      seWriteDisplayDwords(DstAddr, (*dwImgBuf & Mask) | (val & ~Mask), 1);
      }
}

/*---------------------------------------------seLineBlt( )------*/
   
void seLineBlt( BYTE far *pImgBuf, unsigned ImgWidth, unsigned DstX, unsigned DstY, unsigned VirtualWidth, unsigned PhysicalWidth, unsigned Bpp )
{
   switch (DisplaySurfaceCombination)
      {
      default:
      case SURFACE_LCD0:
         seSetLcdAsActiveSurface();
         LineBlt(pImgBuf, ImgWidth, DstX, DstY, VirtualWidth, PhysicalWidth, Bpp, seGetSurfaceLinearAddress());
         break;

      case SURFACE_CRTTV0:
         seSetCrtAsActiveSurface();
         LineBlt(pImgBuf, ImgWidth, DstX, DstY, VirtualWidth, PhysicalWidth, Bpp, seGetSurfaceLinearAddress());
         break;

      case SURFACE_LCD0_CRTTV1:
         if (GetActiveSurfaceNumber() == 0)
            seSetLcdAsActiveSurface();
         else if (GetActiveSurfaceNumber() == 1)
            seSetCrtAsActiveSurface();

         LineBlt(pImgBuf, ImgWidth, DstX, DstY, VirtualWidth, PhysicalWidth, Bpp, seGetSurfaceLinearAddress());
         break;
      }
}

/*-----------------------------------------------------------------------*/
/* we only support RLE_8 & RLE_4 format                                  */
/*-----------------------------------------------------------------------*/
unsigned ShowCompressed( int ff, unsigned DstX, unsigned DstY, unsigned ImgH, unsigned ImgW, unsigned VirtualW, unsigned VirtualH, unsigned PhysicalWidth, unsigned Bpp )
{
   unsigned LineCount=0;
   unsigned LineWidth=0;
   unsigned ColumnCount=0;
   unsigned Val, Y, tmp, tmp1, i;
   unsigned PreReadLine=0;
   BYTE far * pTmp;
   BYTE far *pImgBuf;
   unsigned DesiredBpp;
   int forever = TRUE;
   
#if defined(INTEL_W32) || defined(__GNUC__)
   pImgBuf = (BYTE far*) malloc( 256+ImgW*Bpp/8 );
#else
   pImgBuf = (BYTE far*) _fmalloc( 256+ImgW*Bpp/8 );
#endif
   /* pImgBuf = (BYTE far*) _fmalloc( 2048 ); */
   if( pImgBuf == NULL )
   {
      printf("\n no memory...");
      close(ff);
      free(pImgBuf);
      return FAIL;
   }
   
   /*printf("pImgBuf:%lx, ff:%d, DstX:%d, DstY:%d ImgH:%d, ImgW:%d\n",pImgBuf, ff, DstX, DstY, ImgH, ImgW);
   **printf("VW:%d, VH:%d, Bpp:%d\n",VirtualW, VirtualH, Bpp );
   **getch();
   */
   
   pTmp = pImgBuf;
   
   Y=ImgH+DstY-1; 
   
   /* adjust ImgH */
   if ( ImgH > (VirtualH-DstY) )
   {
      /* read from the image file, decode it if necessary, 
      ** forward file pointer by (DstY+VirtualH-ImgH) lines
      */
      PreReadLine = DstY+ImgH-VirtualH;
      ImgH = VirtualH-DstY;
   }
   
   
   DesiredBpp = Bpp;
   
   while (forever)
   {
      read( ff, &Val, 2 );    /* read in a word */
      /*    printf("Val:%04x\n",Val);*/
      switch ( Val )
      {
      case 0x0100:   /* end of bmp */
         if ( LineCount >= PreReadLine )
         {
            Translate( pImgBuf, LineWidth, Bpp );
            seLineBlt( pImgBuf, LineWidth, DstX+ColumnCount, Y-LineCount, VirtualW, PhysicalWidth, DesiredBpp );
         }
         free(pImgBuf);
         return SUCCEED;
         
      case 0x0000:   /* end of a line */
         if ( LineCount >= PreReadLine )
         {
            Translate( pImgBuf, LineWidth, Bpp );
            seLineBlt( pImgBuf, LineWidth, DstX+ColumnCount, Y-LineCount, VirtualW, PhysicalWidth, DesiredBpp );
         }
         LineCount++;
         LineWidth = 0;
         ColumnCount = 0;
         pTmp = pImgBuf;
         break;
         
      case 0x0200:   /* delta mode, jump right & down */
         if ( LineCount >= PreReadLine )
         {
            Translate( pImgBuf, LineWidth, Bpp );
            seLineBlt( pImgBuf, LineWidth, DstX+ColumnCount, Y-LineCount, VirtualW, PhysicalWidth, DesiredBpp );
         }
         read( ff, &tmp, 2 );    /* read in the next word */
         ColumnCount += (tmp&0xff) + LineWidth;
         LineCount += (tmp&0xff00)>>8;
         LineWidth = 0;
         pTmp = pImgBuf;
         break;
         
      default:
         if ( !(Val&0xff) )
         {
            /* absolute mode */
            tmp =  ( ((Val&0xff00)>>8) * Bpp +4 ) /8;
            read( ff, pTmp, (tmp+1)&0xfffe );      /* read in more bytes, WORD aligned */
            pTmp += tmp;
            LineWidth += tmp*8/Bpp;
         }
         else
         {
            /* encode mode */
            tmp = ((Val & 0xff) * Bpp +4)/8;    /* # of bytes to repeat */
            tmp1 = (Val& 0xff00)>>8;   /* value of the byte */
            for ( i=0; i<tmp; i++ )
            {
               *pTmp = (BYTE)tmp1;
               pTmp++;
            }
            LineWidth += tmp*8/Bpp;
         }
         break;
      }
   }

/*
** Avoid compiler warning in Win32: unreachable code
*/
#ifndef INTEL_W32
   return FAIL;
#endif
}
   
/*-----------------------------------------------------------------------*/
unsigned ShowUncompressed( int ff, unsigned DstX, unsigned DstY, unsigned ImgH, unsigned ImgW, unsigned VirtualW, unsigned VirtualH, unsigned PhysicalWidth, unsigned Bpp )
{
   unsigned Count, Y;
#ifdef INTEL_DOS
   BYTE far *pImgBuf;
#else
   BYTE *pImgBuf;
#endif
   unsigned DesiredBpp;
   
#if defined(INTEL_W32) || defined(__GNUC__)
   pImgBuf = (BYTE *) malloc( 256+ImgW*Bpp/8 );
#else
   pImgBuf = (BYTE far *) _fmalloc( 256+ImgW*Bpp/8 );
#endif
   if( pImgBuf == NULL )
   {
      printf("\n no memory...");
      close(ff);
      free(pImgBuf);
      return FAIL;
   }
   
   /* adjust ImgH */
   if ( ImgH > (VirtualH-DstY) )
   {
      /* 
      ** read from the image file, decode it if necessary, 
      ** forward file pointer by (DstY+VirtualH-ImgH) lines
      */
      
      for ( Y=DstY+ImgH-VirtualH; Y!=0; Y--)
         read ( ff, pImgBuf, (unsigned)((ImgW*Bpp/8+3)&0xfffc) );
      ImgH = VirtualH-DstY;
   }
   

   DesiredBpp = Bpp;
   
   if (DesiredBpp == 24)
      DesiredBpp = 16;
   
   
   for( Y=ImgH+DstY; Y!=DstY; Y-- )
   {
      /* Read a line from the image file, decode RLE if required to pImgBuf */
      /* line break if find word 0x0000 or 0x0200. */
      Count = (unsigned)((ImgW*Bpp/8+3)&0xfffc); 
      read ( ff, pImgBuf, Count);
      Translate( pImgBuf, Count, Bpp );

      /* Blt a line to the virtual screen */
      seLineBlt( pImgBuf, ImgW, DstX, Y-1, VirtualW, PhysicalWidth, DesiredBpp );
   }
   
   free(pImgBuf);
   return SUCCEED;
}


/*--------------------------------------------------------------------
* Function:
* Translate 24 Bpp image to 16 bpp image.
*--------------------------------------------------------------------*/
void Translate( BYTE far *pImgBuf, unsigned LineWidth, unsigned Bpp )
{
   BYTE far *pTmp1;
   WORD far *pTmp2;
   unsigned b, g, r, i;
   
   if ( Bpp==24 )
   {
   /*
   ** Truncate the 24bpp color to 16bpp color.
   ** Only the most significant bits of the colors are saved.
   */
      pTmp1 = pImgBuf;
      pTmp2 = (WORD *)pImgBuf;
      for ( i=0; i<LineWidth/3; i++ )
      {
         b = (*pTmp1++) >>3;
         g = (*pTmp1++) <<3 & 0x07e0;
         r = (*pTmp1++) <<8 & 0xf800;
         *pTmp2++ = (WORD) (b|g|r);
      }
   }
}

/*------------------------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av一区二区三区黑人| 91精品国产欧美一区二区| 91官网在线免费观看| 欧美电影免费观看高清完整版在线 | 国产真实乱对白精彩久久| 成人国产精品免费观看视频| 在线播放91灌醉迷j高跟美女 | 国产91在线看| 69久久夜色精品国产69蝌蚪网| 欧美国产日韩在线观看| 老司机精品视频在线| 欧美色图天堂网| 国产欧美精品一区二区三区四区 | 欧美va日韩va| 亚洲国产精品一区二区久久恐怖片 | 国产精品电影一区二区| 蜜臀av在线播放一区二区三区| 色综合天天天天做夜夜夜夜做| 久久久亚洲精品一区二区三区| 午夜精品aaa| 欧美性一二三区| 亚洲三级在线看| 成人av影院在线| 国产欧美精品一区aⅴ影院| 国产在线视频不卡二| 日韩一区二区视频在线观看| 午夜影视日本亚洲欧洲精品| 一本一本大道香蕉久在线精品 | 在线观看一区二区精品视频| 亚洲天堂成人在线观看| 成人av免费网站| 国产精品精品国产色婷婷| 国产麻豆精品95视频| 久久亚洲捆绑美女| 国产一区二区调教| 久久久综合视频| 国产电影精品久久禁18| 国产午夜亚洲精品午夜鲁丝片 | 国产精品久久国产精麻豆99网站| 国产一区二区三区视频在线播放| 久久夜色精品一区| 丁香啪啪综合成人亚洲小说 | 日韩成人免费看| 日韩三级免费观看| 精品在线免费观看| 久久精品视频在线免费观看| 国产成人福利片| 亚洲少妇中出一区| 欧美日韩免费观看一区二区三区| 午夜精品福利在线| 欧美成人一级视频| 国产mv日韩mv欧美| 一区二区三区四区亚洲| 91.com在线观看| 国产一区二区三区高清播放| 国产精品久久久久桃色tv| 日本精品一区二区三区四区的功能| 亚洲精品国产第一综合99久久 | 久久中文娱乐网| 成人av高清在线| 亚洲精品v日韩精品| 欧美丰满美乳xxx高潮www| 国产一区二区三区观看| 曰韩精品一区二区| 欧美不卡在线视频| 91亚洲国产成人精品一区二三| 亚洲福利一二三区| 久久久久久免费网| 91国偷自产一区二区三区观看| 毛片av一区二区| 亚洲女子a中天字幕| 欧美刺激午夜性久久久久久久| 国产99久久久久久免费看农村| 亚洲成人av一区二区| 久久美女高清视频| 在线亚洲免费视频| 国产经典欧美精品| 丝袜亚洲另类丝袜在线| 中文字幕欧美日本乱码一线二线| 欧美日韩一区二区在线视频| 国产成人综合网站| 五月天亚洲婷婷| 亚洲日本在线天堂| 精品久久久久久久人人人人传媒 | 欧美午夜一区二区三区| 国产精品资源网站| 日韩综合在线视频| 亚洲乱码国产乱码精品精小说| 精品国产乱码久久| 欧美一级二级三级蜜桃| 91福利国产成人精品照片| 国产一本一道久久香蕉| 日韩高清不卡在线| 一区二区久久久| 依依成人精品视频| 中文字幕制服丝袜一区二区三区| 欧美成人a∨高清免费观看| 欧美日韩另类国产亚洲欧美一级| 91丨国产丨九色丨pron| 国产成人精品aa毛片| 韩国欧美国产一区| 老司机午夜精品99久久| 日本中文字幕一区二区视频| 亚洲妇熟xx妇色黄| 亚洲一区二区高清| 亚洲女人****多毛耸耸8| 欧美极品美女视频| 国产精品青草综合久久久久99| 欧美精品一区视频| 精品国产电影一区二区| 欧美成人女星排名| 精品少妇一区二区三区日产乱码 | 久久国产精品区| 日韩vs国产vs欧美| 日本人妖一区二区| 日本特黄久久久高潮| 蜜臀av一区二区| 激情综合五月天| 激情深爱一区二区| 国产一区二区三区美女| 高清在线观看日韩| av电影一区二区| 一本久道中文字幕精品亚洲嫩| 色综合一个色综合| 欧美片网站yy| 日韩精品中文字幕一区| 日韩精品一区二区三区在线| 久久久久久久久久久黄色| 国产精品视频九色porn| 亚洲人成小说网站色在线| 亚洲欧美aⅴ...| 日韩国产在线一| 韩国成人精品a∨在线观看| 国产91精品入口| 色哟哟欧美精品| 欧美绝品在线观看成人午夜影视| 777久久久精品| 2020日本不卡一区二区视频| 欧美国产日韩a欧美在线观看| 中文字幕永久在线不卡| 亚洲国产中文字幕| 欧美a级理论片| 国产成人在线色| 91成人在线观看喷潮| 51久久夜色精品国产麻豆| 精品国产一区久久| 亚洲男人天堂av网| 免费一区二区视频| 成人手机电影网| 欧美日韩一区二区在线观看| 精品理论电影在线| 亚洲乱码国产乱码精品精可以看| 天天影视网天天综合色在线播放| 国产成人精品www牛牛影视| 欧美日韩综合一区| 2024国产精品视频| 一区二区三区在线播| 国产一区二区三区四区五区美女| 日本高清不卡一区| 久久麻豆一区二区| 日韩激情视频网站| 91一区二区在线| 久久天天做天天爱综合色| 亚洲久本草在线中文字幕| 激情图区综合网| 欧美日韩高清一区| 国产精品免费aⅴ片在线观看| 日韩精品一区第一页| av午夜一区麻豆| 精品日韩欧美在线| 亚洲国产wwwccc36天堂| 成人一区二区三区| 精品欧美黑人一区二区三区| 亚洲综合丝袜美腿| 成人黄动漫网站免费app| 精品国产一区久久| 日本亚洲视频在线| 欧美中文字幕一区| 亚洲精品乱码久久久久久日本蜜臀| 狠狠色丁香久久婷婷综合_中| 欧美剧情片在线观看| 亚洲一区电影777| 成人av网址在线观看| 久久精品日产第一区二区三区高清版| 亚洲大尺度视频在线观看| 91啪九色porn原创视频在线观看| 久久综合国产精品| 精品在线你懂的| 日韩亚洲欧美在线| 秋霞电影网一区二区| 欧美久久一二区| 一区二区欧美在线观看| 色综合天天综合网天天狠天天 | 精品国产污网站| 日韩高清中文字幕一区| 欧美美女直播网站| 亚洲成国产人片在线观看| 欧美体内she精高潮| 亚洲妇熟xx妇色黄| 欧美精品免费视频|