OLD | NEW |
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 enum { | 109 enum { |
110 kMaxDictionaryEntryBits = 12, | 110 kMaxDictionaryEntryBits = 12, |
111 // 2^kMaxDictionaryEntryBits | 111 // 2^kMaxDictionaryEntryBits |
112 kMaxDictionaryEntries = 4096, | 112 kMaxDictionaryEntries = 4096, |
113 }; | 113 }; |
114 | 114 |
115 // LZW decoding states and output states. | 115 // LZW decoding states and output states. |
116 int codesize; | 116 int codesize; |
117 int codemask; | 117 int codemask; |
118 int clear_code; // Codeword used to trigger dictionary reset. | 118 int clear_code; // Codeword used to trigger dictionary reset. |
119 int avail; // Index of next available slot in dictionary. | 119 int avail; // Index of next available slot in dictionary. |
120 int oldcode; | 120 int oldcode; |
121 unsigned char firstchar; | 121 unsigned char firstchar; |
122 int bits; // Number of unread bits in "datum". | 122 int bits; // Number of unread bits in "datum". |
123 int datum; // 32-bit input buffer. | 123 int datum; // 32-bit input buffer. |
124 int ipass; // Interlace pass; Ranges 1-4 if interlaced. | 124 int ipass; // Interlace pass; Ranges 1-4 if interlaced. |
125 size_t irow; // Current output row, starting at zero. | 125 size_t irow; // Current output row, starting at zero. |
126 size_t rows_remaining; // Rows remaining to be output. | 126 size_t rows_remaining; // Rows remaining to be output. |
127 | 127 |
128 unsigned short prefix[kMaxDictionaryEntries]; | 128 unsigned short prefix[kMaxDictionaryEntries]; |
129 unsigned char suffix[kMaxDictionaryEntries]; | 129 unsigned char suffix[kMaxDictionaryEntries]; |
130 unsigned short suffix_length[kMaxDictionaryEntries]; | 130 unsigned short suffix_length[kMaxDictionaryEntries]; |
131 GIFRow row_buffer; // Single scanline temporary buffer. | 131 GIFRow row_buffer; // Single scanline temporary buffer. |
132 GIFRow::iterator row_iter; | 132 GIFRow::iterator row_iter; |
133 | 133 |
134 // Initialized during construction and read-only. | 134 // Initialized during construction and read-only. |
135 blink::GIFImageDecoder* client_; | 135 blink::GIFImageDecoder* client_; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 Vector<std::unique_ptr<GIFFrameContext>> frames_; | 362 Vector<std::unique_ptr<GIFFrameContext>> frames_; |
363 | 363 |
364 RefPtr<blink::SegmentReader> data_; | 364 RefPtr<blink::SegmentReader> data_; |
365 bool parse_completed_; | 365 bool parse_completed_; |
366 }; | 366 }; |
367 | 367 |
368 } // namespace blink | 368 } // namespace blink |
369 | 369 |
370 #endif | 370 #endif |
OLD | NEW |