Package com.sun.media.jai.codecimpl.util

Examples of com.sun.media.jai.codecimpl.util.ImagingException


/*  188 */     this.inflater.setInput(deflated);
/*      */     try {
/*  190 */       this.inflater.inflate(inflated);
/*      */     } catch (DataFormatException dfe) {
/*  192 */       String message = JaiI18N.getString("TIFFImage17");
/*  193 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, dfe), this, false);
/*      */     }
/*      */
/*  199 */     this.inflater.reset();
/*      */   }
View Full Code Here


/*  989 */           Method getDataMethod = buffer.getClass().getMethod("getData", null);
/*      */
/*  991 */           fdata = (float[])getDataMethod.invoke(buffer, null);
/*      */         } catch (Exception e) {
/*  993 */           String message = JaiI18N.getString("TIFFImage18");
/*  994 */           ImagingListenerProxy.errorOccurred(message, new ImagingException(message, e), this, false);
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 1002 */     WritableRaster tile = RasterFactory.createWritableRaster(this.sampleModel, buffer, new Point(tileXToX(tileX), tileYToY(tileY)));
/*      */
/* 1009 */     long save_offset = 0L;
/*      */     try {
/* 1011 */       save_offset = this.stream.getFilePointer();
/* 1012 */       this.stream.seek(this.tileOffsets[(tileY * this.tilesX + tileX)]);
/*      */     } catch (IOException ioe) {
/* 1014 */       String message = JaiI18N.getString("TIFFImage13");
/* 1015 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */     }
/*      */
/* 1022 */     int byteCount = (int)this.tileByteCounts[(tileY * this.tilesX + tileX)];
/*      */
/* 1028 */     Rectangle tileRect = new Rectangle(tileXToX(tileX), tileYToY(tileY), this.tileWidth, this.tileHeight);
/*      */
/* 1030 */     Rectangle newRect = this.isTiled ? tileRect : tileRect.intersection(getBounds());
/*      */
/* 1032 */     int unitsInThisTile = newRect.width * newRect.height * this.numBands;
/*      */
/* 1035 */     byte[] data = (this.compression != 1) || (this.imageType == 4) ? new byte[byteCount] : null;
/*      */
/* 1040 */     if (this.imageType == 0) {
/*      */       try {
/* 1042 */         if (this.compression == 32773) {
/* 1043 */           this.stream.readFully(data, 0, byteCount);
/*      */           int bytesInThisTile;
/*      */           int bytesInThisTile;
/* 1048 */           if (newRect.width % 8 == 0)
/* 1049 */             bytesInThisTile = newRect.width / 8 * newRect.height;
/*      */           else {
/* 1051 */             bytesInThisTile = (newRect.width / 8 + 1) * newRect.height;
/*      */           }
/*      */
/* 1054 */           decodePackbits(data, bytesInThisTile, bdata);
/* 1055 */         } else if (this.compression == 5) {
/* 1056 */           this.stream.readFully(data, 0, byteCount);
/* 1057 */           this.lzwDecoder.decode(data, bdata, newRect.height);
/* 1058 */         } else if (this.compression == 2) {
/* 1059 */           this.stream.readFully(data, 0, byteCount);
/* 1060 */           this.decoder.decode1D(bdata, data, 0, newRect.height);
/* 1061 */         } else if (this.compression == 3) {
/* 1062 */           this.stream.readFully(data, 0, byteCount);
/* 1063 */           this.decoder.decode2D(bdata, data, 0, newRect.height, this.tiffT4Options);
/*      */         }
/* 1065 */         else if (this.compression == 4) {
/* 1066 */           this.stream.readFully(data, 0, byteCount);
/* 1067 */           this.decoder.decodeT6(bdata, data, 0, newRect.height, this.tiffT6Options);
/*      */         }
/* 1069 */         else if (this.compression == 32946) {
/* 1070 */           this.stream.readFully(data, 0, byteCount);
/* 1071 */           inflate(data, bdata);
/* 1072 */         } else if (this.compression == 1) {
/* 1073 */           this.stream.readFully(bdata, 0, byteCount);
/*      */         }
/*      */
/* 1076 */         this.stream.seek(save_offset);
/*      */       } catch (IOException ioe) {
/* 1078 */         String message = JaiI18N.getString("TIFFImage13");
/* 1079 */         ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */       }
/*      */
/*      */     }
/* 1084 */     else if (this.imageType == 4) {
/* 1085 */       if (this.sampleSize == 16)
/*      */       {
/* 1087 */         if (this.decodePaletteAsShorts)
/*      */         {
/* 1089 */           short[] tempData = null;
/*      */
/* 1095 */           int unitsBeforeLookup = unitsInThisTile / 3;
/*      */
/* 1101 */           int entries = unitsBeforeLookup * 2;
/*      */           try
/*      */           {
/* 1106 */             if (this.compression == 32773)
/*      */             {
/* 1108 */               this.stream.readFully(data, 0, byteCount);
/*      */
/* 1110 */               byte[] byteArray = new byte[entries];
/* 1111 */               decodePackbits(data, entries, byteArray);
/* 1112 */               tempData = new short[unitsBeforeLookup];
/* 1113 */               interpretBytesAsShorts(byteArray, tempData, unitsBeforeLookup);
/*      */             }
/* 1116 */             else if (this.compression == 5)
/*      */             {
/* 1119 */               this.stream.readFully(data, 0, byteCount);
/*      */
/* 1121 */               byte[] byteArray = new byte[entries];
/* 1122 */               this.lzwDecoder.decode(data, byteArray, newRect.height);
/* 1123 */               tempData = new short[unitsBeforeLookup];
/* 1124 */               interpretBytesAsShorts(byteArray, tempData, unitsBeforeLookup);
/*      */             }
/* 1127 */             else if (this.compression == 32946)
/*      */             {
/* 1129 */               this.stream.readFully(data, 0, byteCount);
/* 1130 */               byte[] byteArray = new byte[entries];
/* 1131 */               inflate(data, byteArray);
/* 1132 */               tempData = new short[unitsBeforeLookup];
/* 1133 */               interpretBytesAsShorts(byteArray, tempData, unitsBeforeLookup);
/*      */             }
/* 1136 */             else if (this.compression == 1)
/*      */             {
/* 1142 */               tempData = new short[byteCount / 2];
/* 1143 */               readShorts(byteCount / 2, tempData);
/*      */             }
/*      */
/* 1146 */             this.stream.seek(save_offset);
/*      */           }
/*      */           catch (IOException ioe) {
/* 1149 */             String message = JaiI18N.getString("TIFFImage13");
/* 1150 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/* 1157 */           if (dataType == 1)
/*      */           {
/* 1162 */             int count = 0; int len = this.colormap.length / 3;
/* 1163 */             int len2 = len * 2;
/* 1164 */             for (int i = 0; i < unitsBeforeLookup; i++)
/*      */             {
/* 1166 */               int lookup = tempData[i] & 0xFFFF;
/*      */
/* 1168 */               int cmapValue = this.colormap[(lookup + len2)];
/* 1169 */               sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */
/* 1171 */               cmapValue = this.colormap[(lookup + len)];
/* 1172 */               sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */
/* 1174 */               cmapValue = this.colormap[lookup];
/* 1175 */               sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */             }
/*      */           }
/* 1178 */           else if (dataType == 2)
/*      */           {
/* 1183 */             int count = 0; int len = this.colormap.length / 3;
/* 1184 */             int len2 = len * 2;
/* 1185 */             for (int i = 0; i < unitsBeforeLookup; i++)
/*      */             {
/* 1187 */               int lookup = tempData[i] & 0xFFFF;
/*      */
/* 1189 */               int cmapValue = this.colormap[(lookup + len2)];
/* 1190 */               sdata[(count++)] = ((short)cmapValue);
/*      */
/* 1192 */               cmapValue = this.colormap[(lookup + len)];
/* 1193 */               sdata[(count++)] = ((short)cmapValue);
/*      */
/* 1195 */               cmapValue = this.colormap[lookup];
/* 1196 */               sdata[(count++)] = ((short)cmapValue);
/*      */             }
/*      */
/*      */           }
/*      */
/*      */         }
/*      */         else
/*      */         {
/*      */           try
/*      */           {
/* 1207 */             if (this.compression == 32773)
/*      */             {
/* 1209 */               this.stream.readFully(data, 0, byteCount);
/*      */
/* 1216 */               int bytesInThisTile = unitsInThisTile * 2;
/*      */
/* 1218 */               byte[] byteArray = new byte[bytesInThisTile];
/* 1219 */               decodePackbits(data, bytesInThisTile, byteArray);
/* 1220 */               interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */             }
/* 1223 */             else if (this.compression == 5)
/*      */             {
/* 1225 */               this.stream.readFully(data, 0, byteCount);
/*      */
/* 1232 */               byte[] byteArray = new byte[unitsInThisTile * 2];
/* 1233 */               this.lzwDecoder.decode(data, byteArray, newRect.height);
/* 1234 */               interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */             }
/* 1237 */             else if (this.compression == 32946)
/*      */             {
/* 1239 */               this.stream.readFully(data, 0, byteCount);
/* 1240 */               byte[] byteArray = new byte[unitsInThisTile * 2];
/* 1241 */               inflate(data, byteArray);
/* 1242 */               interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */             }
/* 1245 */             else if (this.compression == 1)
/*      */             {
/* 1247 */               readShorts(byteCount / 2, sdata);
/*      */             }
/*      */
/* 1250 */             this.stream.seek(save_offset);
/*      */           }
/*      */           catch (IOException ioe) {
/* 1253 */             String message = JaiI18N.getString("TIFFImage13");
/* 1254 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/* 1262 */       else if (this.sampleSize == 8)
/*      */       {
/* 1264 */         if (this.decodePaletteAsShorts)
/*      */         {
/* 1266 */           byte[] tempData = null;
/*      */
/* 1272 */           int unitsBeforeLookup = unitsInThisTile / 3;
/*      */           try
/*      */           {
/* 1277 */             if (this.compression == 32773)
/*      */             {
/* 1279 */               this.stream.readFully(data, 0, byteCount);
/* 1280 */               tempData = new byte[unitsBeforeLookup];
/* 1281 */               decodePackbits(data, unitsBeforeLookup, tempData);
/*      */             }
/* 1283 */             else if (this.compression == 5)
/*      */             {
/* 1285 */               this.stream.readFully(data, 0, byteCount);
/* 1286 */               tempData = new byte[unitsBeforeLookup];
/* 1287 */               this.lzwDecoder.decode(data, tempData, newRect.height);
/*      */             }
/* 1289 */             else if (this.compression == 7)
/*      */             {
/* 1291 */               this.stream.readFully(data, 0, byteCount);
/* 1292 */               Raster tempTile = decodeJPEG(data, this.decodeParam, this.colorConvertJPEG, tile.getMinX(), tile.getMinY());
/*      */
/* 1297 */               int[] tempPixels = new int[unitsBeforeLookup];
/* 1298 */               tempTile.getPixels(tile.getMinX(), tile.getMinY(), tile.getWidth(), tile.getHeight(), tempPixels);
/*      */
/* 1303 */               tempData = new byte[unitsBeforeLookup];
/* 1304 */               for (int i = 0; i < unitsBeforeLookup; i++) {
/* 1305 */                 tempData[i] = ((byte)tempPixels[i]);
/*      */               }
/*      */             }
/* 1308 */             else if (this.compression == 32946)
/*      */             {
/* 1310 */               this.stream.readFully(data, 0, byteCount);
/* 1311 */               tempData = new byte[unitsBeforeLookup];
/* 1312 */               inflate(data, tempData);
/*      */             }
/* 1314 */             else if (this.compression == 1)
/*      */             {
/* 1316 */               tempData = new byte[byteCount];
/* 1317 */               this.stream.readFully(tempData, 0, byteCount);
/*      */             }
/*      */
/* 1320 */             this.stream.seek(save_offset);
/*      */           }
/*      */           catch (IOException ioe) {
/* 1323 */             String message = JaiI18N.getString("TIFFImage13");
/* 1324 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/* 1334 */           int count = 0; int len = this.colormap.length / 3;
/* 1335 */           int len2 = len * 2;
/* 1336 */           for (int i = 0; i < unitsBeforeLookup; i++)
/*      */           {
/* 1338 */             int lookup = tempData[i] & 0xFF;
/*      */
/* 1340 */             int cmapValue = this.colormap[(lookup + len2)];
/* 1341 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */
/* 1343 */             cmapValue = this.colormap[(lookup + len)];
/* 1344 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */
/* 1346 */             cmapValue = this.colormap[lookup];
/* 1347 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */           }
/*      */
/*      */         }
/*      */         else
/*      */         {
/*      */           try
/*      */           {
/* 1356 */             if (this.compression == 32773)
/*      */             {
/* 1358 */               this.stream.readFully(data, 0, byteCount);
/* 1359 */               decodePackbits(data, unitsInThisTile, bdata);
/*      */             }
/* 1361 */             else if (this.compression == 5)
/*      */             {
/* 1363 */               this.stream.readFully(data, 0, byteCount);
/* 1364 */               this.lzwDecoder.decode(data, bdata, newRect.height);
/*      */             }
/* 1366 */             else if (this.compression == 7)
/*      */             {
/* 1368 */               this.stream.readFully(data, 0, byteCount);
/* 1369 */               tile.setRect(decodeJPEG(data, this.decodeParam, this.colorConvertJPEG, tile.getMinX(), tile.getMinY()));
/*      */             }
/* 1375 */             else if (this.compression == 32946)
/*      */             {
/* 1377 */               this.stream.readFully(data, 0, byteCount);
/* 1378 */               inflate(data, bdata);
/*      */             }
/* 1380 */             else if (this.compression == 1)
/*      */             {
/* 1382 */               this.stream.readFully(bdata, 0, byteCount);
/*      */             }
/*      */
/* 1385 */             this.stream.seek(save_offset);
/*      */           }
/*      */           catch (IOException ioe) {
/* 1388 */             String message = JaiI18N.getString("TIFFImage13");
/* 1389 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/* 1397 */       else if (this.sampleSize == 4)
/*      */       {
/* 1399 */         int padding = newRect.width % 2 == 0 ? 0 : 1;
/* 1400 */         int bytesPostDecoding = (newRect.width / 2 + padding) * newRect.height;
/*      */
/* 1404 */         if (this.decodePaletteAsShorts)
/*      */         {
/* 1406 */           byte[] tempData = null;
/*      */           try
/*      */           {
/* 1409 */             this.stream.readFully(data, 0, byteCount);
/* 1410 */             this.stream.seek(save_offset);
/*      */           } catch (IOException ioe) {
/* 1412 */             String message = JaiI18N.getString("TIFFImage13");
/* 1413 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/* 1421 */           if (this.compression == 32773)
/*      */           {
/* 1423 */             tempData = new byte[bytesPostDecoding];
/* 1424 */             decodePackbits(data, bytesPostDecoding, tempData);
/*      */           }
/* 1426 */           else if (this.compression == 5)
/*      */           {
/* 1428 */             tempData = new byte[bytesPostDecoding];
/* 1429 */             this.lzwDecoder.decode(data, tempData, newRect.height);
/*      */           }
/* 1431 */           else if (this.compression == 32946)
/*      */           {
/* 1433 */             tempData = new byte[bytesPostDecoding];
/* 1434 */             inflate(data, tempData);
/*      */           }
/* 1436 */           else if (this.compression == 1)
/*      */           {
/* 1438 */             tempData = data;
/*      */           }
/*      */
/* 1441 */           int bytes = unitsInThisTile / 3;
/*      */
/* 1444 */           data = new byte[bytes];
/*      */
/* 1446 */           int srcCount = 0; int dstCount = 0;
/* 1447 */           for (int j = 0; j < newRect.height; j++) {
/* 1448 */             for (int i = 0; i < newRect.width / 2; i++) {
/* 1449 */               data[(dstCount++)] = ((byte)((tempData[srcCount] & 0xF0) >> 4));
/*      */
/* 1451 */               data[(dstCount++)] = ((byte)(tempData[(srcCount++)] & 0xF));
/*      */             }
/*      */
/* 1455 */             if (padding == 1) {
/* 1456 */               data[(dstCount++)] = ((byte)((tempData[(srcCount++)] & 0xF0) >> 4));
/*      */             }
/*      */
/*      */           }
/*      */
/* 1461 */           int len = this.colormap.length / 3;
/* 1462 */           int len2 = len * 2;
/*      */
/* 1464 */           int count = 0;
/* 1465 */           for (int i = 0; i < bytes; i++) {
/* 1466 */             int lookup = data[i] & 0xFF;
/* 1467 */             int cmapValue = this.colormap[(lookup + len2)];
/* 1468 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/* 1469 */             cmapValue = this.colormap[(lookup + len)];
/* 1470 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/* 1471 */             cmapValue = this.colormap[lookup];
/* 1472 */             sdata[(count++)] = ((short)(cmapValue & 0xFFFF));
/*      */           }
/*      */
/*      */         }
/*      */         else
/*      */         {
/*      */           try
/*      */           {
/* 1480 */             if (this.compression == 32773)
/*      */             {
/* 1482 */               this.stream.readFully(data, 0, byteCount);
/* 1483 */               decodePackbits(data, bytesPostDecoding, bdata);
/*      */             }
/* 1485 */             else if (this.compression == 5)
/*      */             {
/* 1487 */               this.stream.readFully(data, 0, byteCount);
/* 1488 */               this.lzwDecoder.decode(data, bdata, newRect.height);
/*      */             }
/* 1490 */             else if (this.compression == 32946)
/*      */             {
/* 1492 */               this.stream.readFully(data, 0, byteCount);
/* 1493 */               inflate(data, bdata);
/*      */             }
/* 1495 */             else if (this.compression == 1)
/*      */             {
/* 1497 */               this.stream.readFully(bdata, 0, byteCount);
/*      */             }
/*      */
/* 1500 */             this.stream.seek(save_offset);
/*      */           }
/*      */           catch (IOException ioe) {
/* 1503 */             String message = JaiI18N.getString("TIFFImage13");
/* 1504 */             ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/* 1512 */     else if (this.imageType == 1) {
/*      */       try {
/* 1514 */         if (this.compression == 32773)
/*      */         {
/* 1516 */           this.stream.readFully(data, 0, byteCount);
/*      */           int bytesInThisTile;
/*      */           int bytesInThisTile;
/* 1521 */           if (newRect.width % 8 == 0)
/* 1522 */             bytesInThisTile = newRect.width / 2 * newRect.height;
/*      */           else {
/* 1524 */             bytesInThisTile = (newRect.width / 2 + 1) * newRect.height;
/*      */           }
/*      */
/* 1528 */           decodePackbits(data, bytesInThisTile, bdata);
/*      */         }
/* 1530 */         else if (this.compression == 5)
/*      */         {
/* 1532 */           this.stream.readFully(data, 0, byteCount);
/* 1533 */           this.lzwDecoder.decode(data, bdata, newRect.height);
/*      */         }
/* 1535 */         else if (this.compression == 32946)
/*      */         {
/* 1537 */           this.stream.readFully(data, 0, byteCount);
/* 1538 */           inflate(data, bdata);
/*      */         }
/*      */         else
/*      */         {
/* 1542 */           this.stream.readFully(bdata, 0, byteCount);
/*      */         }
/*      */
/* 1545 */         this.stream.seek(save_offset);
/*      */       } catch (IOException ioe) {
/* 1547 */         String message = JaiI18N.getString("TIFFImage13");
/* 1548 */         ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */       }
/*      */
/*      */     }
/*      */     else
/*      */     {
/*      */       try
/*      */       {
/* 1556 */         if (this.sampleSize == 8)
/*      */         {
/* 1558 */           if (this.compression == 1)
/*      */           {
/* 1560 */             this.stream.readFully(bdata, 0, byteCount);
/*      */           }
/* 1562 */           else if (this.compression == 5)
/*      */           {
/* 1564 */             this.stream.readFully(data, 0, byteCount);
/* 1565 */             this.lzwDecoder.decode(data, bdata, newRect.height);
/*      */           }
/* 1567 */           else if (this.compression == 32773)
/*      */           {
/* 1569 */             this.stream.readFully(data, 0, byteCount);
/* 1570 */             decodePackbits(data, unitsInThisTile, bdata);
/*      */           }
/* 1572 */           else if (this.compression == 7)
/*      */           {
/* 1574 */             this.stream.readFully(data, 0, byteCount);
/* 1575 */             tile.setRect(decodeJPEG(data, this.decodeParam, this.colorConvertJPEG, tile.getMinX(), tile.getMinY()));
/*      */           }
/* 1580 */           else if (this.compression == 32946)
/*      */           {
/* 1582 */             this.stream.readFully(data, 0, byteCount);
/* 1583 */             inflate(data, bdata);
/*      */           }
/*      */         }
/* 1586 */         else if (this.sampleSize == 16)
/*      */         {
/* 1588 */           if (this.compression == 1)
/*      */           {
/* 1590 */             readShorts(byteCount / 2, sdata);
/*      */           }
/* 1592 */           else if (this.compression == 5)
/*      */           {
/* 1594 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1601 */             byte[] byteArray = new byte[unitsInThisTile * 2];
/* 1602 */             this.lzwDecoder.decode(data, byteArray, newRect.height);
/* 1603 */             interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */           }
/* 1606 */           else if (this.compression == 32773)
/*      */           {
/* 1608 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1615 */             int bytesInThisTile = unitsInThisTile * 2;
/*      */
/* 1617 */             byte[] byteArray = new byte[bytesInThisTile];
/* 1618 */             decodePackbits(data, bytesInThisTile, byteArray);
/* 1619 */             interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */           }
/* 1621 */           else if (this.compression == 32946)
/*      */           {
/* 1623 */             this.stream.readFully(data, 0, byteCount);
/* 1624 */             byte[] byteArray = new byte[unitsInThisTile * 2];
/* 1625 */             inflate(data, byteArray);
/* 1626 */             interpretBytesAsShorts(byteArray, sdata, unitsInThisTile);
/*      */           }
/*      */
/*      */         }
/* 1630 */         else if ((this.sampleSize == 32) && (dataType == 3))
/*      */         {
/* 1632 */           if (this.compression == 1)
/*      */           {
/* 1634 */             readInts(byteCount / 4, idata);
/*      */           }
/* 1636 */           else if (this.compression == 5)
/*      */           {
/* 1638 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1645 */             byte[] byteArray = new byte[unitsInThisTile * 4];
/* 1646 */             this.lzwDecoder.decode(data, byteArray, newRect.height);
/* 1647 */             interpretBytesAsInts(byteArray, idata, unitsInThisTile);
/*      */           }
/* 1650 */           else if (this.compression == 32773)
/*      */           {
/* 1652 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1659 */             int bytesInThisTile = unitsInThisTile * 4;
/*      */
/* 1661 */             byte[] byteArray = new byte[bytesInThisTile];
/* 1662 */             decodePackbits(data, bytesInThisTile, byteArray);
/* 1663 */             interpretBytesAsInts(byteArray, idata, unitsInThisTile);
/*      */           }
/* 1665 */           else if (this.compression == 32946)
/*      */           {
/* 1667 */             this.stream.readFully(data, 0, byteCount);
/* 1668 */             byte[] byteArray = new byte[unitsInThisTile * 4];
/* 1669 */             inflate(data, byteArray);
/* 1670 */             interpretBytesAsInts(byteArray, idata, unitsInThisTile);
/*      */           }
/*      */
/*      */         }
/* 1674 */         else if ((this.sampleSize == 32) && (dataType == 4))
/*      */         {
/* 1676 */           if (this.compression == 1)
/*      */           {
/* 1678 */             readFloats(byteCount / 4, fdata);
/*      */           }
/* 1680 */           else if (this.compression == 5)
/*      */           {
/* 1682 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1689 */             byte[] byteArray = new byte[unitsInThisTile * 4];
/* 1690 */             this.lzwDecoder.decode(data, byteArray, newRect.height);
/* 1691 */             interpretBytesAsFloats(byteArray, fdata, unitsInThisTile);
/*      */           }
/* 1694 */           else if (this.compression == 32773)
/*      */           {
/* 1696 */             this.stream.readFully(data, 0, byteCount);
/*      */
/* 1703 */             int bytesInThisTile = unitsInThisTile * 4;
/*      */
/* 1705 */             byte[] byteArray = new byte[bytesInThisTile];
/* 1706 */             decodePackbits(data, bytesInThisTile, byteArray);
/* 1707 */             interpretBytesAsFloats(byteArray, fdata, unitsInThisTile);
/*      */           }
/* 1709 */           else if (this.compression == 32946)
/*      */           {
/* 1711 */             this.stream.readFully(data, 0, byteCount);
/* 1712 */             byte[] byteArray = new byte[unitsInThisTile * 4];
/* 1713 */             inflate(data, byteArray);
/* 1714 */             interpretBytesAsFloats(byteArray, fdata, unitsInThisTile);
/*      */           }
/*      */
/*      */         }
/*      */
/* 1720 */         this.stream.seek(save_offset);
/*      */       }
/*      */       catch (IOException ioe) {
/* 1723 */         String message = JaiI18N.getString("TIFFImage13");
/* 1724 */         ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */       }
/*      */
/* 1731 */       switch (this.imageType) {
/*      */       case 2:
/*      */       case 3:
View Full Code Here

/*      */     try
/*      */     {
/* 1817 */       this.stream.readFully(byteArray, 0, byteCount);
/*      */     } catch (IOException ioe) {
/* 1819 */       String message = JaiI18N.getString("TIFFImage13");
/* 1820 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */     }
/*      */
/* 1826 */     interpretBytesAsShorts(byteArray, shortArray, shortCount);
/*      */   }
View Full Code Here

/*      */     try
/*      */     {
/* 1837 */       this.stream.readFully(byteArray, 0, byteCount);
/*      */     } catch (IOException ioe) {
/* 1839 */       String message = JaiI18N.getString("TIFFImage13");
/* 1840 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */     }
/*      */
/* 1846 */     interpretBytesAsInts(byteArray, intArray, intCount);
/*      */   }
View Full Code Here

/*      */     try
/*      */     {
/* 1857 */       this.stream.readFully(byteArray, 0, byteCount);
/*      */     } catch (IOException ioe) {
/* 1859 */       String message = JaiI18N.getString("TIFFImage13");
/* 1860 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ioe), this, false);
/*      */     }
/*      */
/* 1866 */     interpretBytesAsFloats(byteArray, floatArray, floatCount);
/*      */   }
View Full Code Here

/* 1989 */           srcCount++;
/*      */         }
/*      */       }
/*      */     } catch (ArrayIndexOutOfBoundsException ae) {
/* 1993 */       String message = JaiI18N.getString("TIFFImage14");
/* 1994 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, ae), this, false);
/*      */     }
/*      */
/* 2000 */     return dst;
/*      */   }
View Full Code Here

/*     */     try
/*     */     {
/* 215 */       encoder.encode(bi);
/*     */     } catch (IOException e) {
/* 217 */       String message = JaiI18N.getString("JPEGImageEncoder2");
/* 218 */       ImagingListenerProxy.errorOccurred(message, new ImagingException(message, e), this, false);
/*     */     }
/*     */   }
View Full Code Here

/* 63 */       Boolean result = (Boolean)errorOccurred.invoke(listener, new Object[] { message, thrown, where, new Boolean(isRetryable) });
/*    */
/* 68 */       return result.booleanValue();
/*    */     } catch (InvocationTargetException e) {
/* 70 */       Throwable te = e.getTargetException();
/* 71 */       throw new ImagingException(te); } catch (Throwable e) {
/*    */     }
/* 73 */     return defaultImpl(message, thrown, where, isRetryable);
/*    */   }
View Full Code Here

TOP

Related Classes of com.sun.media.jai.codecimpl.util.ImagingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.