b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

dat什么格式 从零开始实现一个APNG Decoder(Swift, iOS)(2)

电脑杂谈  发布时间:2018-10-29 01:03:41  来源:网络整理

func parseChunks() {
        var offset = 8
        var stop = false
        var firstHalfEnd = false
        while !stop {
            let chunkDataLength = UInt32.from(of: data, from: offset, to: offset + 4).bigToHost()
            let chunkLength = 4 + 4 + chunkDataLength + 4
            let chunkType = String.from(source: data, from: offset + 4, to: offset + 8)
            let chunk = BerryAPNGChunk(start: offset, end: offset + numericCast(chunkLength), length: chunkLength, type: chunkType)
            if chunk.type == "" {
                break
            }
            self.chunks.append(chunk)
            if chunk.type == "IEND" {
                stop = true
            }
            offset += numericCast(chunkLength)
            if !firstHalfEnd && chunk.type == "fcTL" {
                firstHalfEnd = true
            }
            if chunk.type != "fcTL" && chunk.type != "fdAT" && chunk.type != "IDAT", chunk.type != "acTL" {
                if !firstHalfEnd { common.appendFirstHalf(chunk) }
                else { common.appendSecondHalf(chunk) }
            }
            if chunk.type == "acTL" {
                self.actl = BerryAPNGACTL(with: data.subdata(in: (chunk.start + 8)..
<chunk end="" nbsp="" -="" 4="" if="" chunk="" type="" self="" ihdr="">
 <chunk end="" nbsp="" -="" 4="" for="" var="" i="" in="" 0="">
  <chunks count="" nbsp="" if="" chunks="" i="" type="" frames="" append="" berryapngframe="" idat:="" 1="" fctldata:="" self="" data="" subdata="" in:="" start="" 8="">
   <chunks i="" end="" nbsp=""></chunks>
  </chunks>
 </chunk>
</chunk>


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/shumachanpin/article-89756-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...