Commit a3d17b37 authored by Ryan LeFevre's avatar Ryan LeFevre

Fully parsed header

parent 75a95028
......@@ -14,6 +14,12 @@ module.exports = class File
UShort:
code: '>H'
length: 2
Float:
code: '>f'
length: 4
Double:
code: '>d'
length: 8
for own format, info of FORMATS then do (format, info) =>
@::["read#{format}"] = -> @readf(info.code, info.length)[0]
......
......@@ -15,4 +15,15 @@ module.exports = class Header
@sig = @file.readString(4)
@version = @file.readUShort()
@file.seek 6, true
@channels = @file.readUShort()
@rows = @file.readUInt()
@cols = @file.readUInt()
@depth = @file.readUShort()
@mode = @file.readUShort()
colorDataLen = @file.readUInt()
@file.seek colorDataLen, true
resolve(@)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment