Need some help with questions on columns and predictors
1: if the Columns is 4 then I need to add 1 to this and use 5 as a step value because the first byte is type?
2. if the Predictors is 12 which means Up, that means I add the value of current set of 5 with value of previous set of 5 with same index within the file.
so if i had data coming in like...
2 1 0 10 0 2 2 0 20 0 2 3 0 30 0 ...
they would pair up like
scanline 1 = 2 1 0 10 0
scanline 2 = 2 2 0 20 0
scanline 3 = 2 3 0 30 0
So i would leave "scanline 1" alone, because basically it would be added to 0? correct?
I would then look at each value on scan line 2 and add it to the value above it on scanline 1
(ignoring the first entry on each scanline, because that is type)
so,
output 1 = 2 1 0 10 0
output 2 = 2 3 0 30 0
output 3 = 2 5 0 50 0
Is the above correct?
3. also when I add the 2 values I need to modulus it with 256 so that is stays within one byte
ie. (($x + $b) % 256)
Im refering to http://www.w3.org/TR/PNG/#9-table91 for how to do predictors
I really need help on getting this resolved, thanks