diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-10 14:33:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-10 14:33:37 -0700 |
commit | d7e5cc754a937605d1f73db5e7967c58ddd80742 (patch) | |
tree | ed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fxge/dib/fx_dib_transform.cpp | |
parent | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff) | |
download | pdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz |
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fxge/dib/fx_dib_transform.cpp')
-rw-r--r-- | core/src/fxge/dib/fx_dib_transform.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index 7d91cdba4b..b8109756e7 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -74,7 +74,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC } pTransBitmap->CopyPalette(m_pPalette); int dest_pitch = pTransBitmap->GetPitch(); - FX_LPBYTE dest_buf = pTransBitmap->GetBuffer(); + uint8_t* dest_buf = pTransBitmap->GetBuffer(); int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left; int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right; int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top; @@ -82,9 +82,9 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC if (GetBPP() == 1) { FXSYS_memset8(dest_buf, 0xff, dest_pitch * result_height); for (int row = row_start; row < row_end; row ++) { - FX_LPCBYTE src_scan = GetScanline(row); + const uint8_t* src_scan = GetScanline(row); int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left; - FX_LPBYTE dest_scan = dest_buf; + uint8_t* dest_scan = dest_buf; if (bYFlip) { dest_scan += (result_height - 1) * dest_pitch; } @@ -104,7 +104,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC } for (int row = row_start; row < row_end; row ++) { int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left; - FX_LPBYTE dest_scan = dest_buf + dest_col * nBytes; + uint8_t* dest_scan = dest_buf + dest_col * nBytes; if (bYFlip) { dest_scan += (result_height - 1) * dest_pitch; } @@ -115,7 +115,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC dest_scan += dest_step; } } else { - FX_LPCBYTE src_scan = GetScanline(row) + col_start * nBytes; + const uint8_t* src_scan = GetScanline(row) + col_start * nBytes; if (nBytes == 1) for (int col = col_start; col < col_end; col ++) { *dest_scan = *src_scan++; @@ -137,11 +137,11 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC int dest_step = bYFlip ? -dest_pitch : dest_pitch; for (int row = row_start; row < row_end; row ++) { int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left; - FX_LPBYTE dest_scan = dest_buf + dest_col; + uint8_t* dest_scan = dest_buf + dest_col; if (bYFlip) { dest_scan += (result_height - 1) * dest_pitch; } - FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row) + col_start; + const uint8_t* src_scan = m_pAlphaMask->GetScanline(row) + col_start; for (int col = col_start; col < col_end; col ++) { *dest_scan = *src_scan++; dest_scan += dest_step; @@ -259,24 +259,24 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineM m_Status = 3; return TRUE; } -uint8_t _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r, +uint8_t _bilinear_interpol(const uint8_t* buf, int row_offset_l, int row_offset_r, int src_col_l, int src_col_r, int res_x, int res_y, int bpp, int c_offset) { int i_resx = 255 - res_x; int col_bpp_l = src_col_l * bpp; int col_bpp_r = src_col_r * bpp; - FX_LPCBYTE buf_u = buf + row_offset_l + c_offset; - FX_LPCBYTE buf_d = buf + row_offset_r + c_offset; - FX_LPCBYTE src_pos0 = buf_u + col_bpp_l; - FX_LPCBYTE src_pos1 = buf_u + col_bpp_r; - FX_LPCBYTE src_pos2 = buf_d + col_bpp_l; - FX_LPCBYTE src_pos3 = buf_d + col_bpp_r; + const uint8_t* buf_u = buf + row_offset_l + c_offset; + const uint8_t* buf_d = buf + row_offset_r + c_offset; + const uint8_t* src_pos0 = buf_u + col_bpp_l; + const uint8_t* src_pos1 = buf_u + col_bpp_r; + const uint8_t* src_pos2 = buf_d + col_bpp_l; + const uint8_t* src_pos3 = buf_d + col_bpp_r; uint8_t r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8; uint8_t r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8; return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8; } -uint8_t _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y, +uint8_t _bicubic_interpol(const uint8_t* buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y, int bpp, int c_offset) { int s_result = 0; @@ -361,8 +361,8 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (m_Storer.GetBitmap() == NULL) { return FALSE; } - FX_LPCBYTE stretch_buf = m_Storer.GetBitmap()->GetBuffer(); - FX_LPCBYTE stretch_buf_mask = NULL; + const uint8_t* stretch_buf = m_Storer.GetBitmap()->GetBuffer(); + const uint8_t* stretch_buf_mask = NULL; if (m_Storer.GetBitmap()->m_pAlphaMask) { stretch_buf_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetBuffer(); } @@ -463,7 +463,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row); + uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -492,7 +492,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else if (m_Flags & FXDIB_BICUBIC_INTERPOL) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row); + uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col_l, src_row_l, res_x, res_y; result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y); @@ -514,7 +514,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) } else { CPDF_FixedMatrix result2stretch_fix(result2stretch, 8); for (int row = 0; row < m_ResultHeight; row ++) { - FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row); + uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row); for (int col = 0; col < m_ResultWidth; col ++) { int src_col, src_row; result2stretch_fix.Transform(col, row, src_col, src_row); @@ -525,7 +525,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (src_row == stretch_height) { src_row --; } - FX_LPCBYTE src_pixel = stretch_buf + stretch_pitch * src_row + src_col; + const uint8_t* src_pixel = stretch_buf + stretch_pitch * src_row + src_col; *dest_scan = *src_pixel; } dest_scan ++; @@ -762,7 +762,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) if (src_row == stretch_height) { src_row --; } - FX_LPCBYTE src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp; + const uint8_t* src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp; if (bHasAlpha) { if (transformF != FXDIB_Argb) { if (transformF == FXDIB_Rgba) { |