def unpacked_bytes
bitmap_length=(picture_width/8)*picture_height
colour_length=(bitmap_length)/8
if @unpacked_bytes.nil? then
@unpacked_bytes=Array.new(bitmap_length+colour_length)
in_p=3
out_p=0
while (in_p<contents.length) do
count=contents[in_p]
in_p+=1
case count
when 00..127 then
repeat=count
b=contents[in_p]
in_p+=1
repeat.times do
@unpacked_bytes[out_p]=b
out_p+=1
end
when 128..220 then
repeat=count-128
repeat.times do
b=contents[in_p]
in_p+=1
@unpacked_bytes[out_p]=b
out_p+=1
end
when 221..225 then
raise "BIGCOUNT not implemented yet"
end
end
end
return [@unpacked_bytes[0,bitmap_length],@unpacked_bytes[bitmap_length,colour_length]]
end