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

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

?? gifencoder.java

?? 在java中處理gif文件的編碼例子
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
            this.bitsLeft = 8;
            } // ends if

         if ( numbits <= this.bitsLeft )
            {
            this.buffer[this.indexIntoOutputStream] |= ( bits & ( ( 1 << numbits ) - 1 ) ) << ( 8 - this.bitsLeft );
            bitsWritten += numbits;
            this.bitsLeft -= numbits;
            numbits = 0;
            } // ends if

         else
            {
            this.buffer[this.indexIntoOutputStream] |= ( bits & ( ( 1 << this.bitsLeft ) - 1 ) ) << ( 8 - this.bitsLeft );
            bitsWritten += this.bitsLeft;
            bits >>= this.bitsLeft;
            numbits -= this.bitsLeft;
            this.buffer[++this.indexIntoOutputStream] = 0;
            this.bitsLeft = 8;
            } // ends else

         } while ( numbits != 0 );

   } // ends writeBits( int, int )

   } // ends class BitFile

/**
 * Used to compress the image by looking for repeating
 * elements.
 */
class LZWStringTable extends Object
   {
   private final static int RES_CODES = 2;
   private final static short HASH_FREE = (short ) 0xFFFF;
   private final static short NEXT_FIRST = (short ) 0xFFFF;
   private final static int MAXBITS = 12;
   private final static int MAXSTR = ( 1 << MAXBITS );
   private final static short HASHSIZE = 9973;
   private final static short HASHSTEP = 2039;

   byte strChr_[];
   short strNxt_[];
   short strHsh_[];
   short numStrings_;

   public LZWStringTable( )
      {
      strChr_ = new byte[MAXSTR];
      strNxt_ = new short[MAXSTR];
      strHsh_ = new short[HASHSIZE];
      } // ends constructor LZWStringTable( void )

   public int addCharString( short index, byte b )
      {
      int hshidx;
      if ( numStrings_ >= MAXSTR )
         return 0xFFFF;

      hshidx = Hash( index, b );
      while ( strHsh_[hshidx] != HASH_FREE )
         hshidx = ( hshidx + HASHSTEP ) % HASHSIZE;

      strHsh_[hshidx] = numStrings_;
      strChr_[numStrings_] = b;
      strNxt_[numStrings_] = ( index != HASH_FREE ) ? index : NEXT_FIRST;

      return numStrings_++;
      } // ends addCharString( short, byte )

   public short findCharString( short index, byte b )
      {
      int hshidx, nxtidx;

      if ( index == HASH_FREE )
         return b;

      hshidx = Hash( index, b );
      while ( ( nxtidx = strHsh_[hshidx] ) != HASH_FREE )
         {
         if ( strNxt_[nxtidx] == index && strChr_[nxtidx] == b )
            return(short ) nxtidx;
         hshidx = ( hshidx + HASHSTEP ) % HASHSIZE;
         } // ends while

      return(short ) 0xFFFF;
      } // ends findCharString( short, byte )

   public void ClearTable( int codesize )
      {
      numStrings_ = 0;

      for ( int q = 0; q < HASHSIZE; q++ )
         strHsh_[q] = HASH_FREE;

      int w = ( 1 << codesize ) + RES_CODES;
      for ( int q = 0; q < w; q++ )
         this.addCharString( (short ) 0xFFFF, (byte)q );
      } // ends ClearTable(int)

   public static int Hash( short index, byte lastbyte )
      {
      return( (int)( (short ) ( lastbyte << 8 ) ^ index ) & 0xFFFF ) %
      HASHSIZE;
      }

   } // ends class LZWStringTable

/**
 * Used to compress the image by looking for repeated
 * elements.
 */
class LZWCompressor extends Object
   {
   public static void LZWCompress( OutputStream output, int codesize, byte
                                   toCompress[] )
   throws IOException
   {
      byte c;
      short index;
      int clearcode, endofinfo, numbits, limit, errcode;
      short prefix = (short ) 0xFFFF;

      BitFile bitFile = new BitFile( output );
      LZWStringTable strings = new LZWStringTable( );

      clearcode = 1 << codesize;
      endofinfo = clearcode + 1;

      numbits = codesize + 1;
      limit = ( 1 << numbits ) - 1;

      strings.ClearTable( codesize );
      bitFile.writeBits( clearcode, numbits );

      for ( int loop = 0; loop < toCompress.length; loop++ )
         {
         c = toCompress[loop];
         if ( ( index = strings.findCharString( prefix, c ) ) != -1 )
            prefix = index;
         else
            {
            bitFile.writeBits( prefix, numbits );
            if ( strings.addCharString( prefix, c ) > limit )
               {
               if ( ++numbits > 12 )
                  {
                  bitFile.writeBits( clearcode, numbits - 1 );
                  strings.ClearTable( codesize );
                  numbits = codesize + 1;
                  } // ends if

               limit = ( 1 << numbits ) - 1;
               } // ends if

            prefix = (short ) ( (short ) c & 0xFF );
            } // ends else

         } // ends for

      if ( prefix != -1 )
         bitFile.writeBits( prefix, numbits );

      bitFile.writeBits( endofinfo, numbits );
      bitFile.flush( );
   } // ends LZWCompress( OutputStream, int, byte[] )

   } // ends class LWZCompressor

/**
 */
class ScreenDescriptor extends Object
   {
   public short localScreenWidth, localScreenHeight;
   private byte currentByte;
   public byte backgroundColorIndex, pixelAspectRatio;

   /**
    * tool for dumping current screen image??
    *
    * @param width
    * @param height
    * @param numColors
    */
   public ScreenDescriptor( short width, short height, int numColors )
      {
      this.localScreenWidth = width;
      this.localScreenHeight = height;
      SetGlobalColorTableSize( (byte)( BitUtils.BitsNeeded( numColors ) -
                                         1 ) );
      SetGlobalColorTableFlag( (byte)1 );
      SetSortFlag( (byte)0 );
      SetColorResolution( (byte)7 );
      this.backgroundColorIndex = 0;
      this.pixelAspectRatio = 0;
      } // ends constructor ScreenDescriptor( short, short, int )

   public void write(OutputStream output )
   throws IOException
   {
      BitUtils.writeWord( output, this.localScreenWidth );
      BitUtils.writeWord( output, this.localScreenHeight );
      output.write( this.currentByte );
      output.write( this.backgroundColorIndex );
      output.write( this.pixelAspectRatio );
   } // ends write( OutputStream )

   public void SetGlobalColorTableSize( byte num )
      {
      this.currentByte |= ( num & 7 );
      }

   public void SetSortFlag( byte num )
      {
      this.currentByte |= ( num & 1 ) << 3;
      }

   public void SetColorResolution( byte num )
      {
      this.currentByte |= ( num & 7 ) << 4;
      }

   public void SetGlobalColorTableFlag( byte num )
      {
      this.currentByte |= ( num & 1 ) << 7;
      }

   } // ends class ScreenDescriptor

/**
 */
class ImageDescriptor extends Object
   {
   public byte separator_;
   public short leftPosition, topPosition, imageWidth, imageHeight;
   private byte currentByte;

   /**
    * ???
    *
    * @param width
    * @param height
    * @param separator
    */
   public ImageDescriptor( short width, short height, char separator )
      {
      separator_ = (byte)separator;
      this.leftPosition = 0;
      this.topPosition = 0;
      this.imageWidth = width;
      this.imageHeight = height;
      SetLocalColorTableSize( (byte)0 );
      SetReserved( (byte)0 );
      SetSortFlag( (byte)0 );
      SetInterlaceFlag( (byte)0 );
      SetLocalColorTableFlag( (byte)0 );
      } // ends constructor ImageDescriptor( short, short, char )

   public void write( OutputStream output )
   throws IOException
   {
      output.write( separator_ );
      BitUtils.writeWord( output, this.leftPosition );
      BitUtils.writeWord( output, this.topPosition );
      BitUtils.writeWord( output, this.imageWidth );
      BitUtils.writeWord( output, this.imageHeight );
      output.write( this.currentByte );
   } // ends write( OutputStream )

   public void SetLocalColorTableSize( byte num )
      {
      this.currentByte |= ( num & 7 );
      }

   public void SetReserved( byte num )
      {
      this.currentByte |= ( num & 3 ) << 3;
      }

   public void SetSortFlag( byte num )
      {
      this.currentByte |= ( num & 1 ) << 5;
      }

   public void SetInterlaceFlag( byte num )
      {
      this.currentByte |= ( num & 1 ) << 6;
      }

   public void SetLocalColorTableFlag( byte num )
      {
      this.currentByte |= ( num & 1 ) << 7;
      }

   } // ends class ImageDescriptor

class BitUtils extends Object
   {
   /**
    * Bits needed no represent the number n???
    */
   public static byte BitsNeeded( int n )
      {
      byte ret = 1;

      if ( n-- == 0 )
         return 0;

      while ( ( n >>= 1 ) != 0 )
         ret++;

      return ret;
      } // ends BitsNeeded(int)

   public static void writeWord( OutputStream output, short w ) throws IOException
   {
      output.write( w & 0xFF );
      output.write( ( w >> 8 ) & 0xFF );
   } // ends writeWord( OutputStream, short )

   static void writeString( OutputStream output, String string ) throws IOException
   {
      for ( int loop = 0; loop < string.length(); loop++ )
         {
         output.write( (byte)( string.charAt( loop ) ) );
         }
   } // ends writeString( OutputStream, String )

   } // ends class BitUtils

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜av影视| 同产精品九九九| 欧美电影精品一区二区| 欧美乱妇一区二区三区不卡视频| 色诱亚洲精品久久久久久| thepron国产精品| 中文字幕乱码久久午夜不卡| 韩国毛片一区二区三区| 男女男精品视频| 石原莉奈在线亚洲二区| 婷婷国产v国产偷v亚洲高清| 亚洲国产成人精品视频| 婷婷久久综合九色综合伊人色| 一区二区三区四区视频精品免费 | 国产精品国产成人国产三级| 久久久亚洲午夜电影| 欧美极品aⅴ影院| 亚洲手机成人高清视频| 亚洲成人免费在线观看| 久久99精品久久久久久国产越南| 国产一区三区三区| 成人动漫精品一区二区| 欧美午夜片在线看| 日韩欧美在线网站| 国产精品色一区二区三区| 亚洲伊人伊色伊影伊综合网| 国产1区2区3区精品美女| 亚洲另类中文字| 日韩电影在线观看网站| 国产一区二区视频在线播放| 不卡视频在线看| 欧美日韩国产精品自在自线| 久久久久综合网| 免费在线观看成人| av不卡免费电影| 欧美一级电影网站| 亚洲日本电影在线| 麻豆精品新av中文字幕| 一本久久a久久免费精品不卡| 欧美一级黄色片| 亚洲人精品午夜| 国产在线看一区| 欧美午夜视频网站| 国产精品激情偷乱一区二区∴| 日韩电影免费在线| 欧洲国产伦久久久久久久| 一级女性全黄久久生活片免费| 久久精品视频网| 一区二区三区成人在线视频| 美国一区二区三区在线播放| 色综合久久久久综合| 久久综合999| 日日夜夜免费精品| 91国模大尺度私拍在线视频| 久久精品一区二区| 奇米影视一区二区三区小说| 欧美在线观看18| 亚洲视频免费观看| 国产91色综合久久免费分享| 日韩免费看的电影| 亚洲成av人影院| 欧美视频三区在线播放| 亚洲欧美激情小说另类| av午夜一区麻豆| 日韩va欧美va亚洲va久久| 99久久综合狠狠综合久久| 国产免费成人在线视频| 精品一二线国产| 日韩精品在线网站| 免费日韩伦理电影| 日韩一区二区三区视频在线观看| 亚洲一区二区影院| 在线观看视频欧美| 亚洲最新在线观看| 精品视频色一区| 亚洲成a人片综合在线| 欧美日韩在线播| 亚洲va中文字幕| 欧美蜜桃一区二区三区| 免费一级片91| 精品国产乱码久久| 国产成人福利片| 综合中文字幕亚洲| 日本高清成人免费播放| 亚洲国产精品一区二区www| 欧美日韩一区中文字幕| 成人av资源站| ww久久中文字幕| 国产成人综合亚洲网站| 欧美韩日一区二区三区四区| 成人激情av网| 久久成人久久爱| 久久午夜老司机| 成人av午夜电影| 亚洲制服丝袜在线| 欧美一区二区三区四区久久| 精品一区二区国语对白| 中文字幕av不卡| 色8久久人人97超碰香蕉987| 日韩激情中文字幕| 欧美精品一区二| 99久久国产综合色|国产精品| 一区二区三区在线观看网站| 欧美一区二区三区视频免费播放| 国产美女视频91| 亚洲美女屁股眼交| 91精品国产黑色紧身裤美女| 国产麻豆精品theporn| 一区二区视频免费在线观看| 7777女厕盗摄久久久| 国产成人综合在线观看| 亚洲成人黄色小说| 久久久久99精品一区| 欧美日韩成人在线| 成人福利视频在线看| 男男gaygay亚洲| 亚洲精品高清视频在线观看| 日韩免费看网站| 欧美少妇bbb| 成人国产亚洲欧美成人综合网| 图片区小说区区亚洲影院| 国产女人18水真多18精品一级做| 欧美日产在线观看| 99国产精品一区| 国产精品一区二区久久不卡 | 美女久久久精品| 亚洲成人tv网| **欧美大码日韩| 欧美一级高清大全免费观看| 99在线视频精品| 国产一区二区三区视频在线播放| 亚洲成年人影院| 日韩毛片视频在线看| 视频在线观看一区| 亚洲欧美日韩一区二区| 欧美国产日韩a欧美在线观看| 欧美一个色资源| 欧美日韩精品电影| 色婷婷综合久久久| www.欧美精品一二区| 国产一区二区三区黄视频 | 亚洲444eee在线观看| 亚洲欧洲中文日韩久久av乱码| 成年人国产精品| 九一九一国产精品| 亚洲.国产.中文慕字在线| 国产精品乱码久久久久久| 日韩欧美视频一区| 日韩一级免费观看| 欧美一区二区在线不卡| 欧美精品久久一区| 在线成人av网站| 777亚洲妇女| 91精品国产综合久久久蜜臀粉嫩| 91福利在线免费观看| 欧美午夜精品电影| 中文字幕免费一区| 国产精品国产三级国产普通话三级| 国产欧美综合在线观看第十页 | 日韩成人免费看| 天堂在线亚洲视频| 午夜不卡av免费| 日本在线播放一区二区三区| 精品国产99国产精品| 精品欧美乱码久久久久久1区2区| 6080亚洲精品一区二区| 日韩欧美的一区| 久久久久97国产精华液好用吗 | 国产精品综合二区| 国产成人午夜精品5599| jvid福利写真一区二区三区| 色国产综合视频| 欧美日韩一区二区三区在线看| 欧美精品 国产精品| 久久青草欧美一区二区三区| 中文字幕av在线一区二区三区| 亚洲欧美激情插 | 国内精品嫩模私拍在线| 国产ts人妖一区二区| 色悠悠久久综合| 日韩欧美一区中文| 中文字幕精品—区二区四季| 亚洲人xxxx| 蜜臀久久久99精品久久久久久| 粉嫩av一区二区三区粉嫩| 日韩欧美亚洲国产另类| 欧美精品v日韩精品v韩国精品v| 欧美大胆人体bbbb| 亚洲婷婷国产精品电影人久久| 亚洲成人一区二区| 国产成人免费视频网站| 欧美午夜在线观看| 国产欧美日韩在线| 国产激情偷乱视频一区二区三区| av不卡在线观看| 日韩精品一区二区三区视频在线观看 | 欧美日韩国产综合草草| 久久伊人蜜桃av一区二区| 亚洲女厕所小便bbb| 韩国av一区二区三区四区|