Ejemplo n.º 1
0
 @Override
 protected synchronized boolean updateDecodeJob(EncodedImage encodedImage, boolean isLast) {
   boolean ret = super.updateDecodeJob(encodedImage, isLast);
   if (!isLast && EncodedImage.isValid(encodedImage)) {
     if (!mProgressiveJpegParser.parseMoreData(encodedImage)) {
       return false;
     }
     int scanNum = mProgressiveJpegParser.getBestScanNumber();
     if (scanNum <= mLastScheduledScanNumber
         || scanNum
             < mProgressiveJpegConfig.getNextScanNumberToDecode(mLastScheduledScanNumber)) {
       return false;
     }
     mLastScheduledScanNumber = scanNum;
   }
   return ret;
 }
Ejemplo n.º 2
0
 @Override
 protected synchronized boolean updateDecodeJob(
     CloseableReference<PooledByteBuffer> imageBytesRef, boolean isLast) {
   boolean ret = super.updateDecodeJob(imageBytesRef, isLast);
   if (!isLast && CloseableReference.isValid(imageBytesRef)) {
     if (!mProgressiveJpegParser.parseMoreData(imageBytesRef)) {
       return false;
     }
     int scanNum = mProgressiveJpegParser.getBestScanNumber();
     if (scanNum <= mLastScheduledScanNumber
         || scanNum
             < mProgressiveJpegConfig.getNextScanNumberToDecode(mLastScheduledScanNumber)) {
       return false;
     }
     mLastScheduledScanNumber = scanNum;
   }
   return ret;
 }
Ejemplo n.º 3
0
 @Override
 protected QualityInfo getQualityInfo() {
   return mProgressiveJpegConfig.getQualityInfo(mProgressiveJpegParser.getBestScanNumber());
 }
Ejemplo n.º 4
0
 @Override
 protected int getIntermediateImageEndOffset(EncodedImage encodedImage) {
   return mProgressiveJpegParser.getBestScanEndOffset();
 }
Ejemplo n.º 5
0
 @Override
 protected QualityInfo getQualityInfo(CloseableReference<PooledByteBuffer> imageBytesRef) {
   return mProgressiveJpegConfig.getQualityInfo(mProgressiveJpegParser.getBestScanNumber());
 }
Ejemplo n.º 6
0
 @Override
 protected int getIntermediateImageEndOffset(
     CloseableReference<PooledByteBuffer> imageBytesRef) {
   return mProgressiveJpegParser.getBestScanEndOffset();
 }
Ejemplo n.º 7
0
 @Override
 @Nullable
 protected ImageFormat getImageFormat(CloseableReference<PooledByteBuffer> imageBytesRef) {
   return mProgressiveJpegParser.isJpeg() ? ImageFormat.JPEG : ImageFormat.UNKNOWN;
 }