Esempio 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;
 }
 @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;
 }
Esempio n. 3
0
 @Override
 protected QualityInfo getQualityInfo() {
   return mProgressiveJpegConfig.getQualityInfo(mProgressiveJpegParser.getBestScanNumber());
 }
 @Override
 protected QualityInfo getQualityInfo(CloseableReference<PooledByteBuffer> imageBytesRef) {
   return mProgressiveJpegConfig.getQualityInfo(mProgressiveJpegParser.getBestScanNumber());
 }