(long offset, FileInfo fi)
| 157 | } |
| 158 | |
| 159 | void getColorMap(long offset, FileInfo fi) throws IOException { |
| 160 | byte[] colorTable16 = new byte[768*2]; |
| 161 | long saveLoc = in.getLongFilePointer(); |
| 162 | in.seek(offset); |
| 163 | in.readFully(colorTable16); |
| 164 | in.seek(saveLoc); |
| 165 | fi.lutSize = 256; |
| 166 | fi.reds = new byte[256]; |
| 167 | fi.greens = new byte[256]; |
| 168 | fi.blues = new byte[256]; |
| 169 | int j = 0; |
| 170 | if (littleEndian) j++; |
| 171 | int sum = 0; |
| 172 | for (int i=0; i<256; i++) { |
| 173 | fi.reds[i] = colorTable16[j]; |
| 174 | sum += fi.reds[i]; |
| 175 | fi.greens[i] = colorTable16[512+j]; |
| 176 | sum += fi.greens[i]; |
| 177 | fi.blues[i] = colorTable16[1024+j]; |
| 178 | sum += fi.blues[i]; |
| 179 | j += 2; |
| 180 | } |
| 181 | if (sum!=0 && fi.fileType==FileInfo.GRAY8) |
| 182 | fi.fileType = FileInfo.COLOR8; |
| 183 | } |
| 184 | |
| 185 | byte[] getString(int count, long offset) throws IOException { |
| 186 | count--; // skip null byte at end of string |
no test coverage detected