diff options
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r-- | core/fxcodec/codec/ccodec_tiffmodule.cpp | 12 | ||||
-rw-r--r-- | core/fxcodec/codec/fx_codec_progress.cpp | 34 |
2 files changed, 23 insertions, 23 deletions
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp index 0bf0045261..b5287ae9e4 100644 --- a/core/fxcodec/codec/ccodec_tiffmodule.cpp +++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp @@ -439,24 +439,24 @@ bool CTiffContext::Decode24bppRGB(const RetainPtr<CFX_DIBitmap>& pDIBitmap, } bool CTiffContext::Decode(const RetainPtr<CFX_DIBitmap>& pDIBitmap) { - uint32_t img_wid = pDIBitmap->GetWidth(); - uint32_t img_hei = pDIBitmap->GetHeight(); + uint32_t img_width = pDIBitmap->GetWidth(); + uint32_t img_height = pDIBitmap->GetHeight(); uint32_t width = 0; uint32_t height = 0; TIFFGetField(m_tif_ctx, TIFFTAG_IMAGEWIDTH, &width); TIFFGetField(m_tif_ctx, TIFFTAG_IMAGELENGTH, &height); - if (img_wid != width || img_hei != height) + if (img_width != width || img_height != height) return false; if (pDIBitmap->GetBPP() == 32) { uint16_t rotation = ORIENTATION_TOPLEFT; TIFFGetField(m_tif_ctx, TIFFTAG_ORIENTATION, &rotation); - if (TIFFReadRGBAImageOriented(m_tif_ctx, img_wid, img_hei, + if (TIFFReadRGBAImageOriented(m_tif_ctx, img_width, img_height, (uint32*)pDIBitmap->GetBuffer(), rotation, 1)) { - for (uint32_t row = 0; row < img_hei; row++) { + for (uint32_t row = 0; row < img_height; row++) { uint8_t* row_buf = (uint8_t*)pDIBitmap->GetScanline(row); - TiffBGRA2RGBA(row_buf, img_wid, 4); + TiffBGRA2RGBA(row_buf, img_width, 4); } return true; } diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index f202ed83bf..4588cd13f3 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -392,7 +392,7 @@ bool CCodec_ProgressiveDecoder::PngAskScanlineBuf(int line, uint8_t** pSrcBuf) { return false; } if (line >= m_clipBox.top && line < m_clipBox.bottom) { - double scale_y = (double)m_sizeY / (double)m_clipBox.Height(); + double scale_y = static_cast<double>(m_sizeY) / m_clipBox.Height(); int32_t row = (int32_t)((line - m_clipBox.top) * scale_y) + m_startY; uint8_t* src_scan = (uint8_t*)pDIBitmap->GetScanline(row); uint8_t* dest_scan = m_pDecodeBuf; @@ -542,13 +542,13 @@ void CCodec_ProgressiveDecoder::PngFillScanlineBufCompleted(int pass, int src_top = m_clipBox.top; int src_bottom = m_clipBox.bottom; int dest_top = m_startY; - int src_hei = m_clipBox.Height(); - int dest_hei = m_sizeY; + int src_height = m_clipBox.Height(); + int dest_height = m_sizeY; if (line >= src_top && line < src_bottom) { - double scale_y = (double)dest_hei / (double)src_hei; + double scale_y = static_cast<double>(dest_height) / src_height; int src_row = line - src_top; int dest_row = (int)(src_row * scale_y) + dest_top; - if (dest_row >= dest_top + dest_hei) { + if (dest_row >= dest_top + dest_height) { return; } PngOneOneMapResampleHorz(pDIBitmap, dest_row, m_pDecodeBuf, m_SrcFormat); @@ -720,15 +720,15 @@ void CCodec_ProgressiveDecoder::GifReadScanline(int32_t row_num, int src_top = m_clipBox.top; int src_bottom = m_clipBox.bottom; int dest_top = m_startY; - int src_hei = m_clipBox.Height(); - int dest_hei = m_sizeY; + int src_height = m_clipBox.Height(); + int dest_height = m_sizeY; if (line < src_top || line >= src_bottom) return; - double scale_y = (double)dest_hei / (double)src_hei; + double scale_y = static_cast<double>(dest_height) / src_height; int src_row = line - src_top; int dest_row = (int)(src_row * scale_y) + dest_top; - if (dest_row >= dest_top + dest_hei) + if (dest_row >= dest_top + dest_height) return; ReSampleScanline(pDIBitmap, dest_row, m_pDecodeBuf, m_SrcFormat); @@ -901,17 +901,17 @@ void CCodec_ProgressiveDecoder::BmpReadScanline( int src_top = m_clipBox.top; int src_bottom = m_clipBox.bottom; int dest_top = m_startY; - int src_hei = m_clipBox.Height(); - int dest_hei = m_sizeY; + int src_height = m_clipBox.Height(); + int dest_height = m_sizeY; if ((src_top >= 0 && row_num < static_cast<uint32_t>(src_top)) || src_bottom < 0 || row_num >= static_cast<uint32_t>(src_bottom)) { return; } - double scale_y = (double)dest_hei / (double)src_hei; + double scale_y = static_cast<double>(dest_height) / src_height; int src_row = row_num - src_top; int dest_row = (int)(src_row * scale_y) + dest_top; - if (dest_row >= dest_top + dest_hei) + if (dest_row >= dest_top + dest_height) return; ReSampleScanline(pDIBitmap, dest_row, m_pDecodeBuf, m_SrcFormat); @@ -1826,13 +1826,13 @@ void CCodec_ProgressiveDecoder::Resample( FXCodec_Format src_format) { int src_top = m_clipBox.top; int dest_top = m_startY; - int src_hei = m_clipBox.Height(); - int dest_hei = m_sizeY; + int src_height = m_clipBox.Height(); + int dest_height = m_sizeY; if (src_line >= src_top) { - double scale_y = (double)dest_hei / (double)src_hei; + double scale_y = static_cast<double>(dest_height) / src_height; int src_row = src_line - src_top; int dest_row = (int)(src_row * scale_y) + dest_top; - if (dest_row >= dest_top + dest_hei) { + if (dest_row >= dest_top + dest_height) { return; } ReSampleScanline(pDeviceBitmap, dest_row, m_pDecodeBuf, src_format); |