summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/ccodec_progressivedecoder.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-01-17 21:44:06 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-17 21:44:06 +0000
commit1602344571ce77e2b2f21376a2294907e24671bf (patch)
tree3677fc5940a0edd1aa0bff879bcee57d17299938 /core/fxcodec/codec/ccodec_progressivedecoder.h
parentc5017d722a4f66a6410298001e08ded30e8a1c0b (diff)
downloadpdfium-1602344571ce77e2b2f21376a2294907e24671bf.tar.xz
Move format specific elements out of DetectImageType
Refactoring the big image format switch in DetectImageType to call separate methods for each image format, instead of having one giant switch block. This should have no functional changes. BUG=pdfium:976 Change-Id: I52cc83879da20b33d471420016f6b1eb53993f0b Reviewed-on: https://pdfium-review.googlesource.com/23130 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h')
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 7c780ff027..83ccce2f6c 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -155,17 +155,23 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
FXCODEC_STATUS& err_status);
bool GifReadMoreData(CCodec_GifModule* pGifModule,
FXCODEC_STATUS& err_status);
- void GifDoubleLineResampleVert(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
- double scale_y,
- int des_row);
+ bool JpegReadMoreData(CCodec_JpegModule* pJpegModule,
+ FXCODEC_STATUS& err_status);
void PngOneOneMapResampleHorz(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
int32_t des_line,
uint8_t* src_scan,
FXCodec_Format src_format);
bool DetectImageType(FXCODEC_IMAGE_TYPE imageType,
CFX_DIBAttribute* pAttribute);
+ bool BmpDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
+ bool JpegDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
+ bool PngDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
+ bool GifDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
+ bool TifDetectImageType(CFX_DIBAttribute* pAttribute, uint32_t size);
+
void GetDownScale(int& down_scale);
void GetTransMethod(FXDIB_Format des_format, FXCodec_Format src_format);
+
void ReSampleScanline(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
int32_t des_line,
uint8_t* src_scan,
@@ -177,11 +183,12 @@ class CCodec_ProgressiveDecoder : public CCodec_BmpModule::Delegate,
void ResampleVert(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
double scale_y,
int des_row);
- bool JpegReadMoreData(CCodec_JpegModule* pJpegModule,
- FXCODEC_STATUS& err_status);
void ResampleVertBT(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
double scale_y,
int des_row);
+ void GifDoubleLineResampleVert(const RetainPtr<CFX_DIBitmap>& pDeviceBitmap,
+ double scale_y,
+ int des_row);
RetainPtr<IFX_SeekableReadStream> m_pFile;
RetainPtr<CFX_DIBitmap> m_pDeviceBitmap;