diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-27 12:08:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-27 12:08:12 -0700 |
commit | 8d2aae7ee320da3a8ffe01c57e38b3f98443257d (patch) | |
tree | e694c6f82ec72fa46e6172b4475996b30d3f6a3a /core/src/fxge/dib | |
parent | ff46aaf499edcf153ee2f57c7016587aa96dcfa0 (diff) | |
download | pdfium-8d2aae7ee320da3a8ffe01c57e38b3f98443257d.tar.xz |
Revert "FX Bool considered harmful, part 3"
This reverts commit ff46aaf499edcf153ee2f57c7016587aa96dcfa0.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255293002 .
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r-- | core/src/fxge/dib/dib_int.h | 6 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_composite.cpp | 142 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_convert.cpp | 116 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_engine.cpp | 72 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 246 | ||||
-rw-r--r-- | core/src/fxge/dib/fx_dib_transform.cpp | 32 |
6 files changed, 307 insertions, 307 deletions
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h index a6834fd641..825cabe1d1 100644 --- a/core/src/fxge/dib/dib_int.h +++ b/core/src/fxge/dib/dib_int.h @@ -63,7 +63,7 @@ public: int dest_width, int dest_height, const FX_RECT& clip_rect, const CFX_DIBSource* pSrcBitmap, int flags); ~CStretchEngine(); - bool Continue(IFX_Pause* pPause); + FX_BOOL Continue(IFX_Pause* pPause); public: FXDIB_Format m_DestFormat; int m_DestBpp, m_SrcBpp, m_bHasAlpha; @@ -84,8 +84,8 @@ public: int m_Flags; CWeightTable m_WeightTable; int m_CurRow; - bool StartStretchHorz(); - bool ContinueStretchHorz(IFX_Pause* pPause); + FX_BOOL StartStretchHorz(); + FX_BOOL ContinueStretchHorz(IFX_Pause* pPause); void StretchVert(); int m_State; }; diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp index 9f454cc31d..cb99a37ff4 100644 --- a/core/src/fxge/dib/fx_dib_composite.cpp +++ b/core/src/fxge/dib/fx_dib_composite.cpp @@ -272,7 +272,7 @@ void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int p pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; if (src_alpha_scan) { for (int col = 0; col < pixel_count; col ++) { @@ -467,7 +467,7 @@ inline void _CompositeRow_Argb2Gray(uint8_t* dest_scan, const uint8_t* src_scan, pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; if (src_alpha_scan) { for (int col = 0; col < pixel_count; col ++) { @@ -558,7 +558,7 @@ inline void _CompositeRow_Rgb2Gray(uint8_t* dest_scan, const uint8_t* src_scan, pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); } if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { if (pIccTransform) { @@ -605,7 +605,7 @@ void _CompositeRow_Rgb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int sr } if (blend_type) { int blended_color; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < pixel_count; col ++) { int back_alpha = *dest_alpha_scan; if (back_alpha == 0) { @@ -689,7 +689,7 @@ void _CompositeRow_Argb2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int pi uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; if (dest_alpha_scan == NULL) { if (src_alpha_scan == NULL) { uint8_t back_alpha = 0; @@ -896,7 +896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_ uint8_t* dest_alpha_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; if (dest_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { @@ -957,7 +957,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(uint8_t* dest_scan, const uint8_t* uint8_t* dest_alpha_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; if (dest_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { @@ -1121,7 +1121,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(uint8_t* dest_scan, const uint8_t* src_ const uint8_t* src_alpha_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int dest_gap = dest_Bpp - 3; if (src_alpha_scan == NULL) { for (int col = 0; col < width; col ++) { @@ -1243,7 +1243,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* sr inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int dest_gap = dest_Bpp - 3; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { @@ -1266,7 +1266,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t inline void _CompositeRow_Rgb2Rgb_Blend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int dest_gap = dest_Bpp - 3; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { @@ -1357,7 +1357,7 @@ void _CompositeRow_Argb2Argb_Transform(uint8_t* dest_scan, const uint8_t* src_sc } } else { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < pixel_count; col ++) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1); uint8_t back_alpha = *dest_alpha_scan; @@ -1487,7 +1487,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(uint8_t* dest_scan, const uin pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width); } else { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int dest_gap = dest_Bpp - 3; for (int col = 0; col < width; col ++) { pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1); @@ -1630,7 +1630,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc { if (src_alpha_scan) { if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = pPalette[*src_scan]; @@ -1668,7 +1668,7 @@ inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc } } else { if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = pPalette[*src_scan]; @@ -1704,7 +1704,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s { if (src_alpha_scan) { if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = pPalette[*src_scan]; @@ -1778,7 +1778,7 @@ inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s } } else { if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = pPalette[*src_scan]; @@ -1836,7 +1836,7 @@ inline void _CompositeRow_1bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_sc int reset_gray = pPalette[0]; int set_gray = pPalette[1]; if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; @@ -1870,7 +1870,7 @@ inline void _CompositeRow_1bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_s int reset_gray = pPalette[0]; int set_gray = pPalette[1]; if (blend_type) { - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int blended_color; for (int col = 0; col < pixel_count; col ++) { uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray; @@ -2787,7 +2787,7 @@ void _CompositeRow_BitMask2Graya(uint8_t* dest_scan, const uint8_t* src_scan, in void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < pixel_count; col ++) { uint8_t back_alpha = dest_scan[3]; if (back_alpha == 0) { @@ -2844,7 +2844,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { uint8_t back_alpha = dest_scan[3]; @@ -2881,7 +2881,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; for (int col = 0; col < width; col ++) { uint8_t src_alpha; if (clip_scan) { @@ -2928,7 +2928,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_sca inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { if (bNonseparableBlend) { @@ -2995,7 +2995,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { int src_alpha = *clip_scan ++; @@ -3039,7 +3039,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, c inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan) { int blended_colors[3]; - bool bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; + FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE; int src_gap = src_Bpp - 3; for (int col = 0; col < width; col ++) { uint8_t src_alpha = *clip_scan ++; @@ -3495,7 +3495,7 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* s dest_scan += Bpp; } } -inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha, +inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alpha_flag, FX_DWORD mask_color, int& mask_alpha, int& mask_red, int& mask_green, int& mask_blue, int& mask_black, void* icc_module, void* pIccTransform) { @@ -3513,7 +3513,7 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp mask_blue = FXARGB_B(mask_color); } if (dest_format == FXDIB_8bppMask) { - return true; + return TRUE; } if ((dest_format & 0xff) == 8) { if (pIccTransform) { @@ -3550,15 +3550,15 @@ inline bool _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int alp mask_blue = mask_color_p[0]; } } - return true; + return TRUE; } inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB_Format dest_format, FX_DWORD*& pDestPalette, FX_DWORD* pSrcPalette, void* icc_module, void* pIccTransform) { ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module; - bool isSrcCmyk = src_format & 0x0400 ? true : false; - bool isDstCmyk = dest_format & 0x0400 ? true : false; + FX_BOOL isSrcCmyk = src_format & 0x0400 ? TRUE : FALSE; + FX_BOOL isDstCmyk = dest_format & 0x0400 ? TRUE : FALSE; pDestPalette = NULL; if (pIccTransform) { if (pSrcPalette) { @@ -3679,7 +3679,7 @@ CFX_ScanlineCompositor::CFX_ScanlineCompositor() m_pSrcPalette = NULL; m_pCacheScanline = NULL; m_CacheSize = 0; - m_bRgbByteOrder = false; + m_bRgbByteOrder = FALSE; m_BlendType = FXDIB_BLEND_NORMAL; } CFX_ScanlineCompositor::~CFX_ScanlineCompositor() @@ -3691,8 +3691,8 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor() FX_Free(m_pCacheScanline); } } -bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, - FX_DWORD mask_color, int blend_type, bool bClip, bool bRgbByteOrder, int alpha_flag, void* pIccTransform) +FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette, + FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform) { m_SrcFormat = src_format; m_DestFormat = dest_format; @@ -3707,7 +3707,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for } m_pIccTransform = pIccTransform; if ((dest_format & 0xff) == 1) { - return false; + return FALSE; } if (m_SrcFormat == FXDIB_1bppMask || m_SrcFormat == FXDIB_8bppMask) { return _ScanlineCompositor_InitSourceMask(dest_format, alpha_flag, mask_color, @@ -3715,11 +3715,11 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for pIccModule, pIccTransform); } if (pIccTransform == NULL && (~src_format & 0x0400) && (dest_format & 0x0400)) { - return false; + return FALSE; } if ((m_SrcFormat & 0xff) <= 8) { if (dest_format == FXDIB_8bppMask) { - return true; + return TRUE; } _ScanlineCompositor_InitSourcePalette(src_format, dest_format, m_pSrcPalette, pSrcPalette, pIccModule, pIccTransform); @@ -3727,7 +3727,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for + (dest_format & 0x0200 ? 2 : 0) + (dest_format & 0x0400 ? 4 : 0) + ((src_format & 0xff) == 1 ? 8 : 0); - return true; + return TRUE; } m_Transparency = (src_format & 0x0200 ? 0 : 1) + (dest_format & 0x0200 ? 0 : 2) @@ -3736,7 +3736,7 @@ bool CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_for + (src_format & 0x0400 ? 16 : 0) + (dest_format & 0x0400 ? 32 : 0) + (pIccTransform ? 64 : 0); - return true; + return TRUE; } void CFX_ScanlineCompositor::CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan, const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha) @@ -4059,22 +4059,22 @@ void CFX_ScanlineCompositor::CompositeBitMaskLine(uint8_t* dest_scan, const uint _CompositeRow_BitMask2Rgb(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, src_left, width, m_BlendType, (m_DestFormat & 0xff) >> 3, clip_scan); } -bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height, +FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, - int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, void* pIccTransform) + int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } ASSERT(!pSrcBitmap->IsAlphaMask()); ASSERT(m_bpp >= 8); if (pSrcBitmap->IsAlphaMask() || m_bpp < 8) { - return false; + return FALSE; } GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, pClipRgn); if (width == 0 || height == 0) { - return true; + return TRUE; } const CFX_DIBitmap* pClipMask = NULL; FX_RECT clip_box; @@ -4086,11 +4086,11 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h CFX_ScanlineCompositor compositor; if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, pSrcBitmap->GetPalette(), 0, blend_type, pClipMask != NULL, bRgbByteOrder, 0, pIccTransform)) { - return false; + return FALSE; } int dest_Bpp = m_bpp / 8; int src_Bpp = pSrcBitmap->GetBPP() / 8; - bool bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage(); + FX_BOOL bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage(); CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask; for (int row = 0; row < height; row ++) { uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp; @@ -4107,27 +4107,27 @@ bool CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, int h compositor.CompositePalBitmapLine(dest_scan, src_scan, src_left, width, clip_scan, src_scan_extra_alpha, dst_scan_extra_alpha); } } - return true; + return TRUE; } -bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height, +FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, - int blend_type, const CFX_ClipRgn* pClipRgn, bool bRgbByteOrder, int alpha_flag, void* pIccTransform) + int blend_type, const CFX_ClipRgn* pClipRgn, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } ASSERT(pMask->IsAlphaMask()); ASSERT(m_bpp >= 8); if (!pMask->IsAlphaMask() || m_bpp < 8) { - return false; + return FALSE; } GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, pClipRgn); if (width == 0 || height == 0) { - return true; + return TRUE; } int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color); if (src_alpha == 0) { - return true; + return TRUE; } const CFX_DIBitmap* pClipMask = NULL; FX_RECT clip_box; @@ -4140,7 +4140,7 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei int Bpp = GetBPP() / 8; CFX_ScanlineCompositor compositor; if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, NULL, color, blend_type, pClipMask != NULL, bRgbByteOrder, alpha_flag, pIccTransform)) { - return false; + return FALSE; } for (int row = 0; row < height; row ++) { uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp; @@ -4156,21 +4156,21 @@ bool CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int hei compositor.CompositeByteMaskLine(dest_scan, src_scan + src_left, width, clip_scan, dst_scan_extra_alpha); } } - return true; + return TRUE; } -bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform) +FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DWORD color, int alpha_flag, void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } int src_alpha = (alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color); if (src_alpha == 0) { - return true; + return TRUE; } FX_RECT rect(left, top, left + width, top + height); rect.Intersect(0, 0, m_Width, m_Height); if (rect.IsEmpty()) { - return true; + return TRUE; } width = rect.Width(); FX_DWORD dst_color; @@ -4210,7 +4210,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW dest_scan ++; } } - return true; + return TRUE; } if (m_bpp == 1) { ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0); @@ -4248,11 +4248,11 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW } } } - return true; + return TRUE; } ASSERT(m_bpp >= 24); if (m_bpp < 24) { - return false; + return FALSE; } if (pIccTransform && CFX_GEModule::Get()->GetCodecModule()) { ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); @@ -4262,15 +4262,15 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), color_p[2], color_p[1], color_p[0]); else if (!(alpha_flag >> 8) && IsCmykImage()) { - return false; + return FALSE; } } if(!IsCmykImage()) { color_p[3] = (uint8_t)src_alpha; } int Bpp = m_bpp / 8; - bool bAlpha = HasAlpha(); - bool bArgb = GetFormat() == FXDIB_Argb ? true : false; + FX_BOOL bAlpha = HasAlpha(); + FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE; if (src_alpha == 255) { for (int row = rect.top; row < rect.bottom; row ++) { uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp; @@ -4291,7 +4291,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW } } } - return true; + return TRUE; } for (int row = rect.top; row < rect.bottom; row ++) { uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp; @@ -4346,7 +4346,7 @@ bool CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX_DW } } } - return true; + return TRUE; } CFX_BitmapComposer::CFX_BitmapComposer() { @@ -4354,7 +4354,7 @@ CFX_BitmapComposer::CFX_BitmapComposer() m_pScanlineAlphaV = NULL; m_pClipScanV = NULL; m_pAddClipScan = NULL; - m_bRgbByteOrder = false; + m_bRgbByteOrder = FALSE; m_BlendType = FXDIB_BLEND_NORMAL; } CFX_BitmapComposer::~CFX_BitmapComposer() @@ -4373,8 +4373,8 @@ CFX_BitmapComposer::~CFX_BitmapComposer() } } void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRgn, int bitmap_alpha, - FX_DWORD mask_color, FX_RECT& dest_rect, bool bVertical, - bool bFlipX, bool bFlipY, bool bRgbByteOrder, + FX_DWORD mask_color, FX_RECT& dest_rect, FX_BOOL bVertical, + FX_BOOL bFlipX, FX_BOOL bFlipY, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform, int blend_type) { m_pBitmap = pDest; @@ -4397,12 +4397,12 @@ void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest, const CFX_ClipRgn* pClipRg m_bRgbByteOrder = bRgbByteOrder; m_BlendType = blend_type; } -bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) +FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) { m_SrcFormat = src_format; if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette, m_MaskColor, FXDIB_BLEND_NORMAL, m_pClipMask != NULL || (m_BitmapAlpha < 255), m_bRgbByteOrder, m_AlphaFlag, m_pIccTransform)) { - return false; + return FALSE; } if (m_bVertical) { m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4); @@ -4414,7 +4414,7 @@ bool CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_format, if (m_BitmapAlpha < 255) { m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth()); } - return true; + return TRUE; } void CFX_BitmapComposer::DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, int dest_width, const uint8_t* clip_scan, const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha) diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp index 7e5a0341a2..d7860aee19 100644 --- a/core/src/fxge/dib/fx_dib_convert.cpp +++ b/core/src/fxge/dib/fx_dib_convert.cpp @@ -103,7 +103,7 @@ public: CFX_Palette(); ~CFX_Palette(); public: - bool BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType); + FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap, int dwPaletteType); FX_DWORD* GetPalette() const { return m_pPalette; @@ -227,10 +227,10 @@ CFX_Palette::~CFX_Palette() } m_lut = 0; } -bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type) +FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type) { if (pBitmap == NULL) { - return false; + return FALSE; } if (m_pPalette != NULL) { FX_Free(m_pPalette); @@ -277,9 +277,9 @@ bool CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type) win_mac_pal = (FX_DWORD*)g_dwMacPalette; } _Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut); - return true; + return TRUE; } -bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { uint8_t set_gray, reset_gray; @@ -296,9 +296,9 @@ bool _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, dest_scan ++; } } - return true; + return TRUE; } -bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { for (int row = 0; row < height; row ++) { @@ -306,9 +306,9 @@ bool _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left; FXSYS_memcpy(dest_scan, src_scan, width); } - return true; + return TRUE; } -bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { FX_DWORD* src_plt = pSrcBitmap->GetPalette(); @@ -359,9 +359,9 @@ bool _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i dest_scan ++; } } - return true; + return TRUE; } -bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { FX_DWORD* src_plt = pSrcBitmap->GetPalette(); @@ -402,9 +402,9 @@ bool _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, i *dest_scan++ = gray[*src_scan++]; } } - return true; + return TRUE; } -bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { int Bpp = pSrcBitmap->GetBPP() / 8; @@ -451,7 +451,7 @@ bool _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, } } } - return true; + return TRUE; } inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) @@ -476,7 +476,7 @@ inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int widt } } } -bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform) { _ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top); @@ -515,9 +515,9 @@ bool _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in FXSYS_memcpy(dst_plt, src_plt, plt_size * 4); } } - return true; + return TRUE; } -inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height, +inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt) { int bpp = pSrcBitmap->GetBPP() / 8; @@ -527,7 +527,7 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p FX_DWORD* cLut = palette.GetColorLut(); FX_DWORD* aLut = palette.GetAmountLut(); if (cLut == NULL || aLut == NULL) { - return false; + return FALSE; } int lut = palette.Getlut(); FX_DWORD* pPalette = palette.GetPalette(); @@ -571,12 +571,12 @@ inline bool _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_p } } FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256); - return true; + return TRUE; } -bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform) { - bool ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt); + FX_BOOL ret = _ConvertBuffer_Rgb2PltRgb8_NoTransform(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, dst_plt); if (ret && pIccTransform) { ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule(); for (int i = 0; i < 256; i++) { @@ -588,7 +588,7 @@ bool _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, in } return ret; } -bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -611,9 +611,9 @@ bool _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_scan += comps; } } - return true; + return TRUE; } -bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top) { int comps = (dst_format & 0xff) / 8; @@ -629,9 +629,9 @@ bool _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_scan += comps - 2; } } - return true; + return TRUE; } -bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { int comps = (dst_format & 0xff) / 8; @@ -676,9 +676,9 @@ bool _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_scan += comps - 2; } } - return true; + return TRUE; } -bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { int comps = (dst_format & 0xff) / 8; @@ -722,9 +722,9 @@ bool _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_scan += comps - 2; } } - return true; + return TRUE; } -bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { if (pIccTransform) { @@ -741,9 +741,9 @@ bool _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, FXSYS_memcpy(dest_scan, src_scan, width * 3); } } - return true; + return TRUE; } -bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { for (int row = 0; row < height; row ++) { @@ -763,9 +763,9 @@ bool _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width); } } - return true; + return TRUE; } -bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { int comps = pSrcBitmap->GetBPP() / 8; @@ -793,9 +793,9 @@ bool _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int } } } - return true; + return TRUE; } -bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { if (pIccTransform) { @@ -821,9 +821,9 @@ bool _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width } } } - return true; + return TRUE; } -bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform) { FXDIB_Format src_format = pSrcBitmap->GetFormat(); @@ -835,8 +835,8 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, case FXDIB_1bppCmyk: case FXDIB_1bppMask: case FXDIB_1bppRgb: - ASSERT(false); - return false; + ASSERT(FALSE); + return FALSE; case FXDIB_8bppMask: { if ((src_format & 0xff) == 1) { if (pSrcBitmap->GetPalette()) { @@ -853,7 +853,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, if ((src_format & 0xff) >= 24) { return _ConvertBuffer_RgbOrCmyk2Gray(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform); } - return false; + return FALSE; } case FXDIB_8bppRgb: case FXDIB_8bppRgba: { @@ -867,7 +867,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, if ((src_format & 0xff) >= 24) { return _ConvertBuffer_Rgb2PltRgb8(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, d_pal, pIccTransform); } - return false; + return FALSE; } case FXDIB_Rgb: case FXDIB_Rgba: { @@ -889,7 +889,7 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, if ((src_format & 0xff) == 32) { return _ConvertBuffer_32bppRgb2Rgb24(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform); } - return false; + return FALSE; } case FXDIB_Argb: case FXDIB_Rgb32: { @@ -911,12 +911,12 @@ bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, } return _ConvertBuffer_Rgb2Rgb32(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top, pIccTransform); } - return false; + return FALSE; } default: - return false; + return FALSE; } - return false; + return FALSE; } CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_RECT* pClip, void* pIccTransform) const { @@ -939,7 +939,7 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC delete pClone; return NULL; } - bool ret = true; + FX_BOOL ret = TRUE; CFX_DIBitmap* pSrcAlpha = NULL; if (m_AlphaFlag & 2) { pSrcAlpha = (GetFormat() == FXDIB_Argb) ? GetAlphaMask() : m_pAlphaMask; @@ -981,15 +981,15 @@ CFX_DIBitmap* CFX_DIBSource::CloneConvert(FXDIB_Format dest_format, const FX_REC } return pClone; } -bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) +FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) { FXDIB_Format src_format = GetFormat(); if (dest_format == src_format && pIccTransform == NULL) { - return true; + return TRUE; } if (dest_format == FXDIB_8bppMask && src_format == FXDIB_8bppRgb && m_pPalette == NULL) { m_AlphaFlag = 1; - return true; + return TRUE; } if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) { m_AlphaFlag = 2; @@ -1000,13 +1000,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) scanline += 4; } } - return true; + return TRUE; } int dest_bpp = dest_format & 0xff; int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4; uint8_t* dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4); if (dest_buf == NULL) { - return false; + return FALSE; } CFX_DIBitmap* pAlphaMask = NULL; if (dest_format == FXDIB_Argb) { @@ -1026,13 +1026,13 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) pAlphaMask = GetAlphaMask(); if (pAlphaMask == NULL) { FX_Free(dest_buf); - return false; + return FALSE; } } else { if (m_pAlphaMask == NULL) { if (!BuildAlphaMask()) { FX_Free(dest_buf); - return false; + return FALSE; } pAlphaMask = m_pAlphaMask; m_pAlphaMask = NULL; @@ -1041,7 +1041,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) } } } - bool ret = false; + FX_BOOL ret = FALSE; FX_DWORD* pal_8bpp = NULL; ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform); if (!ret) { @@ -1054,7 +1054,7 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) if (dest_buf) { FX_Free(dest_buf); } - return false; + return FALSE; } if (m_pAlphaMask && pAlphaMask != m_pAlphaMask) { delete m_pAlphaMask; @@ -1067,10 +1067,10 @@ bool CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransform) if (!m_bExtBuf) { FX_Free(m_pBuffer); } - m_bExtBuf = false; + m_bExtBuf = FALSE; m_pBuffer = dest_buf; m_bpp = (uint8_t)dest_format; m_AlphaFlag = (uint8_t)(dest_format >> 8); m_Pitch = dest_pitch; - return true; + return TRUE; } diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index f143ac3ae2..7390c431d9 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -217,7 +217,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d m_SrcHeight = pSrcBitmap->GetHeight(); m_SrcPitch = (m_SrcWidth * m_SrcBpp + 31) / 32 * 4; if ((flags & FXDIB_NOSMOOTH) == 0) { - bool bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL; + FX_BOOL bInterpol = flags & FXDIB_INTERPOL || flags & FXDIB_BICUBIC_INTERPOL; if (!bInterpol && FXSYS_abs(dest_width) != 0 && FXSYS_abs(dest_height) < m_SrcWidth * m_SrcHeight * 8 / FXSYS_abs(dest_width)) { flags = FXDIB_INTERPOL; } @@ -280,16 +280,16 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d } } } -bool CStretchEngine::Continue(IFX_Pause* pPause) +FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause) { while (m_State == 1) { if (ContinueStretchHorz(pPause)) { - return true; + return TRUE; } m_State = 2; StretchVert(); } - return false; + return FALSE; } CStretchEngine::~CStretchEngine() { @@ -306,46 +306,46 @@ CStretchEngine::~CStretchEngine() FX_Free(m_pDestMaskScanline); } } -bool CStretchEngine::StartStretchHorz() +FX_BOOL CStretchEngine::StartStretchHorz() { if (m_DestWidth == 0 || m_pDestScanline == NULL || m_SrcClip.Height() > (int)((1U << 29) / m_InterPitch) || m_SrcClip.Height() == 0) { - return false; + return FALSE; } m_pInterBuf = FX_TryAlloc(unsigned char, m_SrcClip.Height() * m_InterPitch); if (m_pInterBuf == NULL) { - return false; + return FALSE; } if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) { m_pExtraAlphaBuf = FX_Alloc2D(unsigned char, m_SrcClip.Height(), m_ExtraMaskPitch); FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4; m_pDestMaskScanline = FX_TryAlloc(unsigned char, size); if (!m_pDestMaskScanline) { - return false; + return FALSE; } } m_WeightTable.Calc(m_DestWidth, m_DestClip.left, m_DestClip.right, m_SrcWidth, m_SrcClip.left, m_SrcClip.right, m_Flags); if (m_WeightTable.m_pWeightTables == NULL) { - return false; + return FALSE; } m_CurRow = m_SrcClip.top; m_State = 1; - return true; + return TRUE; } #define FX_STRECH_PAUSE_ROWS 10 -bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) +FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) { if (!m_DestWidth) { return 0; } if (m_pSource->SkipToScanline(m_CurRow, pPause)) { - return true; + return TRUE; } int Bpp = m_DestBpp / 8; int rows_to_go = FX_STRECH_PAUSE_ROWS; for (; m_CurRow < m_SrcClip.bottom; m_CurRow ++) { if (rows_to_go == 0) { if (pPause && pPause->NeedToPauseNow()) { - return true; + return TRUE; } rows_to_go = FX_STRECH_PAUSE_ROWS; } @@ -532,7 +532,7 @@ bool CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause) } rows_to_go --; } - return false; + return FALSE; } void CStretchEngine::StretchVert() { @@ -697,7 +697,7 @@ FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc) } return format; } -bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest, +FX_BOOL CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest, const CFX_DIBSource* pSource, int dest_width, int dest_height, const FX_RECT& rect, FX_DWORD flags) { @@ -722,7 +722,7 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest, pal[i] = ArgbEncode(a, r, g, b); } if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) { - return false; + return FALSE; } } else if (pSource->GetFormat() == FXDIB_1bppCmyk && pSource->GetPalette()) { FX_CMYK pal[256]; @@ -737,17 +737,17 @@ bool CFX_ImageStretcher::Start(IFX_ScanlineComposer* pDest, pal[i] = CmykEncode(c, m, y, k); } if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, pal)) { - return false; + return FALSE; } } else if (!pDest->SetInfo(rect.Width(), rect.Height(), m_DestFormat, NULL)) { - return false; + return FALSE; } if (flags & FXDIB_DOWNSAMPLE) { return StartQuickStretch(); } return StartStretch(); } -bool CFX_ImageStretcher::Continue(IFX_Pause* pPause) +FX_BOOL CFX_ImageStretcher::Continue(IFX_Pause* pPause) { if (m_Flags & FXDIB_DOWNSAMPLE) { return ContinueQuickStretch(pPause); @@ -755,39 +755,39 @@ bool CFX_ImageStretcher::Continue(IFX_Pause* pPause) return ContinueStretch(pPause); } #define MAX_PROGRESSIVE_STRETCH_PIXELS 1000000 -bool CFX_ImageStretcher::StartStretch() +FX_BOOL CFX_ImageStretcher::StartStretch() { m_pStretchEngine = new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags); m_pStretchEngine->StartStretchHorz(); if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) { m_pStretchEngine->Continue(NULL); - return false; + return FALSE; } - return true; + return TRUE; } -bool CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) +FX_BOOL CFX_ImageStretcher::ContinueStretch(IFX_Pause* pPause) { if (m_pStretchEngine == NULL) { - return false; + return FALSE; } return m_pStretchEngine->Continue(pPause); } -bool CFX_ImageStretcher::StartQuickStretch() +FX_BOOL CFX_ImageStretcher::StartQuickStretch() { - m_bFlipX = false; - m_bFlipY = false; + m_bFlipX = FALSE; + m_bFlipY = FALSE; if (m_DestWidth < 0) { - m_bFlipX = true; + m_bFlipX = TRUE; m_DestWidth = -m_DestWidth; } if (m_DestHeight < 0) { - m_bFlipY = true; + m_bFlipY = TRUE; m_DestHeight = -m_DestHeight; } m_LineIndex = 0; FX_DWORD size = m_ClipRect.Width(); if (size && m_DestBPP > (int)(INT_MAX / size)) { - return false; + return FALSE; } size *= m_DestBPP; m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4); @@ -796,14 +796,14 @@ bool CFX_ImageStretcher::StartQuickStretch() } if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) { ContinueQuickStretch(NULL); - return false; + return FALSE; } - return true; + return TRUE; } -bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) +FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) { if (m_pScanline == NULL) { - return false; + return FALSE; } int result_width = m_ClipRect.Width(), result_height = m_ClipRect.Height(); int src_height = m_pSource->GetHeight(); @@ -823,7 +823,7 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) src_y = 0; } if (m_pSource->SkipToScanline(src_y, pPause)) { - return true; + return TRUE; } m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); if (m_pMaskScanline) { @@ -831,5 +831,5 @@ bool CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) } m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); } - return false; + return FALSE; } diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index efd886e2b7..8a864f10a1 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -9,7 +9,7 @@ #include "../../../include/fxcodec/fx_codec.h" #include "dib_int.h" #include <limits.h> -bool ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, +FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform); void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k) { @@ -52,39 +52,39 @@ CFX_DIBSource::~CFX_DIBSource() } CFX_DIBitmap::CFX_DIBitmap() { - m_bExtBuf = false; + m_bExtBuf = FALSE; m_pBuffer = NULL; m_pPalette = NULL; } #define _MAX_OOM_LIMIT_ 12000000 -bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch) +FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch) { m_pBuffer = NULL; m_bpp = (uint8_t)format; m_AlphaFlag = (uint8_t)(format >> 8); m_Width = m_Height = m_Pitch = 0; if (width <= 0 || height <= 0 || pitch < 0) { - return false; + return FALSE; } if ((INT_MAX - 31) / width < (format & 0xff)) { - return false; + return FALSE; } if (!pitch) { pitch = (width * (format & 0xff) + 31) / 32 * 4; } if ((1 << 30) / pitch < height) { - return false; + return FALSE; } if (pBuffer) { m_pBuffer = pBuffer; - m_bExtBuf = true; + m_bExtBuf = TRUE; } else { int size = pitch * height + 4; int oomlimit = _MAX_OOM_LIMIT_; if (oomlimit >= 0 && size >= oomlimit) { m_pBuffer = FX_TryAlloc(uint8_t, size); if (m_pBuffer == NULL) { - return false; + return FALSE; } } else { m_pBuffer = FX_Alloc(uint8_t, size); @@ -94,33 +94,33 @@ bool CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* p m_Height = height; m_Pitch = pitch; if (HasAlpha() && format != FXDIB_Argb) { - bool ret = true; + FX_BOOL ret = TRUE; ret = BuildAlphaMask(); if (!ret) { if (!m_bExtBuf && m_pBuffer) { FX_Free(m_pBuffer); m_pBuffer = NULL; m_Width = m_Height = m_Pitch = 0; - return false; + return FALSE; } } } - return true; + return TRUE; } -bool CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc) +FX_BOOL CFX_DIBitmap::Copy(const CFX_DIBSource* pSrc) { if (m_pBuffer) { - return false; + return FALSE; } if (!Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat())) { - return false; + return FALSE; } CopyPalette(pSrc->GetPalette()); CopyAlphaMask(pSrc->m_pAlphaMask); for (int row = 0; row < pSrc->GetHeight(); row ++) { FXSYS_memcpy(m_pBuffer + row * m_Pitch, pSrc->GetScanline(row), m_Pitch); } - return true; + return TRUE; } CFX_DIBitmap::~CFX_DIBitmap() { @@ -218,19 +218,19 @@ void CFX_DIBSource::BuildPalette() } } } -bool CFX_DIBSource::BuildAlphaMask() +FX_BOOL CFX_DIBSource::BuildAlphaMask() { if (m_pAlphaMask) { - return true; + return TRUE; } m_pAlphaMask = new CFX_DIBitmap; if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) { delete m_pAlphaMask; m_pAlphaMask = NULL; - return false; + return FALSE; } FXSYS_memset(m_pAlphaMask->GetBuffer(), 0xff, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); - return true; + return TRUE; } FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const { @@ -367,15 +367,15 @@ void CFX_DIBSource::GetOverlapRect(int& dest_left, int& dest_top, int& width, in width = dest_rect.right - dest_rect.left; height = dest_rect.bottom - dest_rect.top; } -bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height, +FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), pSrcBitmap->GetHeight(), src_left, src_top, NULL); if (width == 0 || height == 0) { - return true; + return TRUE; } FXDIB_Format dest_format = GetFormat(); FXDIB_Format src_format = pSrcBitmap->GetFormat(); @@ -402,7 +402,7 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he } } else { if (m_pPalette) { - return false; + return FALSE; } if (m_bpp == 8) { dest_format = FXDIB_8bppMask; @@ -410,25 +410,25 @@ bool CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int he uint8_t* dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8; FX_DWORD* d_plt = NULL; if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) { - return false; + return FALSE; } } - return true; + return TRUE; } -bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height, +FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int height, const CFX_DIBSource* pMask, FX_DWORD color, int src_left, int src_top, int alpha_flag, void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } ASSERT(HasAlpha() && (m_bpp >= 24)); ASSERT(pMask->IsAlphaMask()); if (!HasAlpha() || !pMask->IsAlphaMask() || m_bpp < 24) { - return false; + return FALSE; } GetOverlapRect(dest_left, dest_top, width, height, pMask->GetWidth(), pMask->GetHeight(), src_left, src_top, NULL); if (width == 0 || height == 0) { - return true; + return TRUE; } int src_bpp = pMask->GetBPP(); int alpha; @@ -449,7 +449,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color), color_p[2], color_p[1], color_p[0]); else if (!(alpha_flag >> 8) && IsCmykImage()) { - return false; + return FALSE; } } if(!IsCmykImage()) { @@ -507,7 +507,7 @@ bool CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int heig } } } - return true; + return TRUE; } void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size) { @@ -570,21 +570,21 @@ CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const } return pMask; } -bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip) +FX_BOOL CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT* pClip) { if (!HasAlpha() || GetFormat() == FXDIB_Argb) { - return false; + return FALSE; } if (pAlphaMask) { FX_RECT rect(0, 0, pAlphaMask->m_Width, pAlphaMask->m_Height); if (pClip) { rect.Intersect(*pClip); if (rect.IsEmpty() || rect.Width() != m_Width || rect.Height() != m_Height) { - return false; + return FALSE; } } else { if (pAlphaMask->m_Width != m_Width || pAlphaMask->m_Height != m_Height) { - return false; + return FALSE; } } for (int row = 0; row < m_Height; row ++) @@ -593,25 +593,25 @@ bool CFX_DIBSource::CopyAlphaMask(const CFX_DIBSource* pAlphaMask, const FX_RECT } else { m_pAlphaMask->Clear(0xff000000); } - return true; + return TRUE; } const int g_ChannelOffset[] = {0, 2, 1, 0, 0, 1, 2, 3, 3}; -bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel) +FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* pSrcBitmap, FXDIB_Channel srcChannel) { if (m_pBuffer == NULL) { - return false; + return FALSE; } CFX_DIBSource* pSrcClone = (CFX_DIBSource*)pSrcBitmap; CFX_DIBitmap* pDst = this; int destOffset, srcOffset; if (srcChannel == FXDIB_Alpha) { if (!pSrcBitmap->HasAlpha() && !pSrcBitmap->IsAlphaMask()) { - return false; + return FALSE; } if (pSrcBitmap->GetBPP() == 1) { pSrcClone = pSrcBitmap->CloneConvert(FXDIB_8bppMask); if (pSrcClone == NULL) { - return false; + return FALSE; } } if(pSrcBitmap->GetFormat() == FXDIB_Argb) { @@ -621,7 +621,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p } } else { if (pSrcBitmap->IsAlphaMask()) { - return false; + return FALSE; } if (pSrcBitmap->GetBPP() < 24) { if (pSrcBitmap->IsCmykImage()) { @@ -630,7 +630,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p pSrcClone = pSrcBitmap->CloneConvert((FXDIB_Format)((pSrcBitmap->GetFormat() & 0xff00) | 0x18)); } if (pSrcClone == NULL) { - return false; + return FALSE; } } srcOffset = g_ChannelOffset[srcChannel]; @@ -641,7 +641,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } destOffset = 0; } else { @@ -650,7 +650,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } if (GetFormat() == FXDIB_Argb) { destOffset = 3; @@ -661,7 +661,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } if (GetBPP() < 24) { if (HasAlpha()) { @@ -669,7 +669,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } } else #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ @@ -680,7 +680,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } } destOffset = g_ChannelOffset[destChannel]; @@ -694,7 +694,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } } } @@ -710,7 +710,7 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p delete pSrcClone; } if (pSrcMatched == NULL) { - return false; + return FALSE; } pSrcClone = pSrcMatched; } @@ -732,24 +732,24 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource* p if (pSrcClone != pSrcBitmap && pSrcClone != pSrcBitmap->m_pAlphaMask) { delete pSrcClone; } - return true; + return TRUE; } -bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) +FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) { if (m_pBuffer == NULL) { - return false; + return FALSE; } int destOffset; if (destChannel == FXDIB_Alpha) { if (IsAlphaMask()) { if(!ConvertFormat(FXDIB_8bppMask)) { - return false; + return FALSE; } destOffset = 0; } else { destOffset = 0; if(!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) { - return false; + return FALSE; } if (GetFormat() == FXDIB_Argb) { destOffset = 3; @@ -757,21 +757,21 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) } } else { if (IsAlphaMask()) { - return false; + return FALSE; } if (GetBPP() < 24) { if (HasAlpha()) { if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyka : FXDIB_Argb)) { - return false; + return FALSE; } } else #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb)) { - return false; + return FALSE; } #else if (!ConvertFormat(IsCmykImage() ? FXDIB_Cmyk : FXDIB_Rgb32)) { - return false; + return FALSE; } #endif } @@ -780,11 +780,11 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) int Bpp = GetBPP() / 8; if (Bpp == 1) { FXSYS_memset(m_pBuffer, value, m_Height * m_Pitch); - return true; + return TRUE; } if (destChannel == FXDIB_Alpha && m_pAlphaMask) { FXSYS_memset(m_pAlphaMask->GetBuffer(), value, m_pAlphaMask->GetHeight()*m_pAlphaMask->GetPitch()); - return true; + return TRUE; } for (int row = 0; row < m_Height; row ++) { uint8_t* scan_line = m_pBuffer + row * m_Pitch + destOffset; @@ -793,16 +793,16 @@ bool CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value) scan_line += Bpp; } } - return true; + return TRUE; } -bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) +FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) { if (m_pBuffer == NULL) { - return false; + return FALSE; } ASSERT(pSrcBitmap->IsAlphaMask()); if (!pSrcBitmap->IsAlphaMask()) { - return false; + return FALSE; } if (!IsAlphaMask() && !HasAlpha()) { return LoadChannel(FXDIB_Alpha, pSrcBitmap, FXDIB_Alpha); @@ -812,7 +812,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) pSrcClone = pSrcBitmap->StretchTo(m_Width, m_Height); ASSERT(pSrcClone != NULL); if (pSrcClone == NULL) { - return false; + return FALSE; } } if (IsAlphaMask()) { @@ -820,7 +820,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } for (int row = 0; row < m_Height; row ++) { uint8_t* dest_scan = m_pBuffer + m_Pitch * row; @@ -844,7 +844,7 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return false; + return FALSE; } for (int row = 0; row < m_Height; row ++) { uint8_t* dest_scan = m_pBuffer + m_Pitch * row + 3; @@ -861,17 +861,17 @@ bool CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap) if (pSrcClone != pSrcBitmap) { delete pSrcClone; } - return true; + return TRUE; } -bool CFX_DIBitmap::GetGrayData(void* pIccTransform) +FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform) { if (m_pBuffer == NULL) { - return false; + return FALSE; } switch (GetFormat()) { case FXDIB_1bppRgb: { if (m_pPalette == NULL) { - return false; + return FALSE; } uint8_t gray[2]; for (int i = 0; i < 2; i ++) { @@ -883,7 +883,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) CFX_DIBitmap* pMask = new CFX_DIBitmap; if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) { delete pMask; - return false; + return FALSE; } FXSYS_memset(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height); for (int row = 0; row < m_Height; row ++) { @@ -902,7 +902,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) } case FXDIB_8bppRgb: { if (m_pPalette == NULL) { - return false; + return FALSE; } uint8_t gray[256]; for (int i = 0; i < 256; i ++) { @@ -914,7 +914,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) CFX_DIBitmap* pMask = new CFX_DIBitmap; if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) { delete pMask; - return false; + return FALSE; } for (int row = 0; row < m_Height; row ++) { uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch(); @@ -931,7 +931,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) CFX_DIBitmap* pMask = new CFX_DIBitmap; if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) { delete pMask; - return false; + return FALSE; } for (int row = 0; row < m_Height; row ++) { uint8_t* src_pos = m_pBuffer + row * m_Pitch; @@ -949,7 +949,7 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) CFX_DIBitmap* pMask = new CFX_DIBitmap; if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) { delete pMask; - return false; + return FALSE; } for (int row = 0; row < m_Height; row ++) { uint8_t* src_pos = m_pBuffer + row * m_Pitch; @@ -964,19 +964,19 @@ bool CFX_DIBitmap::GetGrayData(void* pIccTransform) break; } default: - return false; + return FALSE; } - return true; + return TRUE; } -bool CFX_DIBitmap::MultiplyAlpha(int alpha) +FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha) { if (m_pBuffer == NULL) { - return false; + return FALSE; } switch (GetFormat()) { case FXDIB_1bppMask: if (!ConvertFormat(FXDIB_8bppMask)) { - return false; + return FALSE; } MultiplyAlpha(alpha); break; @@ -1004,18 +1004,18 @@ bool CFX_DIBitmap::MultiplyAlpha(int alpha) m_pAlphaMask->MultiplyAlpha(alpha); } else if (IsCmykImage()) { if (!ConvertFormat((FXDIB_Format)(GetFormat() | 0x0200))) { - return false; + return FALSE; } m_pAlphaMask->MultiplyAlpha(alpha); } else { if (!ConvertFormat(FXDIB_Argb)) { - return false; + return FALSE; } MultiplyAlpha(alpha); } break; } - return true; + return TRUE; } FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const { @@ -1122,7 +1122,7 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color) } } void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, bool bFlipX, int clip_left, int clip_width) const + int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const { if (m_pBuffer == NULL) { return; @@ -1179,15 +1179,15 @@ void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp } } } -bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) +FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) { ASSERT(!IsAlphaMask()); if (m_pBuffer == NULL || IsAlphaMask()) { - return false; + return FALSE; } int fc, fm, fy, fk, bc, bm, by, bk; int fr, fg, fb, br, bg, bb; - bool isCmykImage = IsCmykImage(); + FX_BOOL isCmykImage = IsCmykImage(); if (isCmykImage) { fc = FXSYS_GetCValue(forecolor); fm = FXSYS_GetMValue(forecolor); @@ -1208,10 +1208,10 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) if (m_bpp <= 8) { if (isCmykImage) { if (forecolor == 0xff && backcolor == 0 && m_pPalette == NULL) { - return true; + return TRUE; } } else if (forecolor == 0 && backcolor == 0xffffff && m_pPalette == NULL) { - return true; + return TRUE; } if (m_pPalette == NULL) { BuildPalette(); @@ -1232,7 +1232,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) m_pPalette[i] = FXARGB_MAKE(0xff, br + (fr - br) * gray / 255, bg + (fg - bg) * gray / 255, bb + (fb - bb) * gray / 255); } - return true; + return TRUE; } if (isCmykImage) { if (forecolor == 0xff && backcolor == 0x00) { @@ -1248,7 +1248,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) *scanline ++ = 255 - FXRGB2GRAY(r, g, b); } } - return true; + return TRUE; } } else if (forecolor == 0 && backcolor == 0xffffff) { for (int row = 0; row < m_Height; row ++) { @@ -1262,7 +1262,7 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) scanline += gap; } } - return true; + return TRUE; } if (isCmykImage) { for (int row = 0; row < m_Height; row ++) { @@ -1291,18 +1291,18 @@ bool CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor) } } } - return true; + return TRUE; } -bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect) +FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_RECT* pRect) { if (m_pBuffer == NULL) { - return false; + return FALSE; } if (m_bpp != 8 && m_pPalette != NULL && m_AlphaFlag != 0) { - return false; + return FALSE; } if (m_Width < 4 && m_Height < 4) { - return false; + return FALSE; } FX_RECT rect(0, 0, m_Width, m_Height); if (pRect) { @@ -1374,9 +1374,9 @@ bool CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_REC } } } - return true; + return TRUE; } -CFX_DIBitmap* CFX_DIBSource::FlipImage(bool bXFlip, bool bYFlip) const +CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const { CFX_DIBitmap* pFlipped = new CFX_DIBitmap; if (!pFlipped->Create(m_Width, m_Height, GetFormat())) { @@ -1480,7 +1480,7 @@ CFX_FilteredDIB::~CFX_FilteredDIB() FX_Free(m_pScanline); } } -void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, bool bAutoDropSrc) +void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc) { m_pSrc = pSrc; m_bAutoDropSrc = bAutoDropSrc; @@ -1499,7 +1499,7 @@ const uint8_t* CFX_FilteredDIB::GetScanline(int line) const return m_pScanline; } void CFX_FilteredDIB::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp, - int dest_width, bool bFlipX, int clip_left, int clip_width) const + int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const { m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width); TranslateDownSamples(dest_scan, dest_scan, clip_width, dest_bpp); @@ -1508,18 +1508,18 @@ CFX_ImageRenderer::CFX_ImageRenderer() { m_Status = 0; m_pTransformer = NULL; - m_bRgbByteOrder = false; + m_bRgbByteOrder = FALSE; m_BlendType = FXDIB_BLEND_NORMAL; } CFX_ImageRenderer::~CFX_ImageRenderer() { delete m_pTransformer; } -extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY); -bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, +extern FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY); +FX_BOOL CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn, const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD mask_color, const CFX_AffineMatrix* pMatrix, - FX_DWORD dib_flags, bool bRgbByteOrder, + FX_DWORD dib_flags, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform, int blend_type) { m_Matrix = *pMatrix; @@ -1528,7 +1528,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn m_ClipBox = pClipRgn ? pClipRgn->GetBox() : FX_RECT(0, 0, pDevice->GetWidth(), pDevice->GetHeight()); m_ClipBox.Intersect(image_rect); if (m_ClipBox.IsEmpty()) { - return false; + return FALSE; } m_pDevice = pDevice; m_pClipRgn = pClipRgn; @@ -1540,7 +1540,7 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn m_pIccTransform = pIccTransform; m_bRgbByteOrder = bRgbByteOrder; m_BlendType = blend_type; - bool ret = true; + FX_BOOL ret = TRUE; if ((FXSYS_fabs(m_Matrix.b) >= 0.5f || m_Matrix.a == 0) || (FXSYS_fabs(m_Matrix.c) >= 0.5f || m_Matrix.d == 0) ) { if (FXSYS_fabs(m_Matrix.a) < FXSYS_fabs(m_Matrix.b) / 20 && FXSYS_fabs(m_Matrix.d) < FXSYS_fabs(m_Matrix.c) / 20 && @@ -1550,18 +1550,18 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn FX_RECT bitmap_clip = m_ClipBox; bitmap_clip.Offset(-image_rect.left, -image_rect.top); bitmap_clip = _FXDIB_SwapClipBox(bitmap_clip, dest_width, dest_height, m_Matrix.c > 0, m_Matrix.b < 0); - m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, true, + m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, m_ClipBox, TRUE, m_Matrix.c > 0, m_Matrix.b < 0, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType); if (!m_Stretcher.Start(&m_Composer, pSource, dest_height, dest_width, bitmap_clip, dib_flags)) { - return false; + return FALSE; } m_Status = 1; - return true; + return TRUE; } m_Status = 2; m_pTransformer = new CFX_ImageTransformer; m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox); - return true; + return TRUE; } int dest_width = image_rect.Width(); if (m_Matrix.a < 0) { @@ -1572,32 +1572,32 @@ bool CFX_ImageRenderer::Start(CFX_DIBitmap* pDevice, const CFX_ClipRgn* pClipRgn dest_height = -dest_height; } if (dest_width == 0 || dest_height == 0) { - return false; + return FALSE; } FX_RECT bitmap_clip = m_ClipBox; bitmap_clip.Offset(-image_rect.left, -image_rect.top); m_Composer.Compose(pDevice, pClipRgn, bitmap_alpha, mask_color, - m_ClipBox, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType); + m_ClipBox, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, m_BlendType); m_Status = 1; ret = m_Stretcher.Start(&m_Composer, pSource, dest_width, dest_height, bitmap_clip, dib_flags); return ret; } -bool CFX_ImageRenderer::Continue(IFX_Pause* pPause) +FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause) { if (m_Status == 1) { return m_Stretcher.Continue(pPause); } if (m_Status == 2) { if (m_pTransformer->Continue(pPause)) { - return true; + return TRUE; } CFX_DIBitmap* pBitmap = m_pTransformer->m_Storer.Detach(); if (pBitmap == NULL) { - return false; + return FALSE; } if (pBitmap->GetBuffer() == NULL) { delete pBitmap; - return false; + return FALSE; } if (pBitmap->IsAlphaMask()) { if (m_BitmapAlpha != 255) { @@ -1618,9 +1618,9 @@ bool CFX_ImageRenderer::Continue(IFX_Pause* pPause) pBitmap->GetWidth(), pBitmap->GetHeight(), pBitmap, 0, 0, m_BlendType, m_pClipRgn, m_bRgbByteOrder, m_pIccTransform); } delete pBitmap; - return false; + return FALSE; } - return false; + return FALSE; } CFX_BitmapStorer::CFX_BitmapStorer() { @@ -1653,16 +1653,16 @@ void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const FXSYS_memcpy(dest_alpha_buf, scan_extra_alpha, m_pBitmap->m_pAlphaMask->GetPitch()); } } -bool CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) +FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette) { m_pBitmap = new CFX_DIBitmap; if (!m_pBitmap->Create(width, height, src_format)) { delete m_pBitmap; m_pBitmap = NULL; - return false; + return FALSE; } if (pSrcPalette) { m_pBitmap->CopyPalette(pSrcPalette); } - return true; + return TRUE; } diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp index 01bc167ede..e34e715bf2 100644 --- a/core/src/fxge/dib/fx_dib_transform.cpp +++ b/core/src/fxge/dib/fx_dib_transform.cpp @@ -54,7 +54,7 @@ public: y1 /= base; } }; -CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDestClip) const +CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_RECT* pDestClip) const { FX_RECT dest_clip(0, 0, m_Height, m_Width); if (pDestClip) { @@ -148,7 +148,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(bool bXFlip, bool bYFlip, const FX_RECT* pDe return pTransBitmap; } #define FIX16_005 0.05f -FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, bool bFlipX, bool bFlipY) +FX_RECT _FXDIB_SwapClipBox(FX_RECT& clip, int width, int height, FX_BOOL bFlipX, FX_BOOL bFlipY) { FX_RECT rect; if (bFlipY) { @@ -206,7 +206,7 @@ CFX_ImageTransformer::CFX_ImageTransformer() CFX_ImageTransformer::~CFX_ImageTransformer() { } -bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip) +FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatrix* pDestMatrix, int flags, const FX_RECT* pDestClip) { m_pMatrix = (CFX_AffineMatrix*)pDestMatrix; CFX_FloatRect unit_rect = pDestMatrix->GetUnitRect(); @@ -216,7 +216,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr result_clip.Intersect(*pDestClip); } if (result_clip.IsEmpty()) { - return false; + return FALSE; } m_ResultLeft = result_clip.left; m_ResultTop = result_clip.top; @@ -232,7 +232,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr result_clip = _FXDIB_SwapClipBox(result_clip, dest_width, dest_height, pDestMatrix->c > 0, pDestMatrix->b < 0); m_Stretcher.Start(&m_Storer, pSrc, dest_height, dest_width, result_clip, flags); m_Status = 1; - return true; + return TRUE; } if (FXSYS_fabs(pDestMatrix->b) < FIX16_005 && FXSYS_fabs(pDestMatrix->c) < FIX16_005) { int dest_width = pDestMatrix->a > 0 ? (int)FXSYS_ceil(pDestMatrix->a) : (int)FXSYS_floor(pDestMatrix->a); @@ -240,7 +240,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr result_clip.Offset(-result_rect.left, -result_rect.top); m_Stretcher.Start(&m_Storer, pSrc, dest_width, dest_height, result_clip, flags); m_Status = 2; - return true; + return TRUE; } int stretch_width = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->a, pDestMatrix->b)); int stretch_height = (int)FXSYS_ceil(FXSYS_sqrt2(pDestMatrix->c, pDestMatrix->d)); @@ -254,7 +254,7 @@ bool CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineMatr m_StretchClip.Intersect(0, 0, stretch_width, stretch_height); m_Stretcher.Start(&m_Storer, pSrc, stretch_width, stretch_height, m_StretchClip, flags); m_Status = 3; - return true; + return TRUE; } 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, @@ -335,30 +335,30 @@ FXDIB_Format _GetTransformedFormat(const CFX_DIBSource* pDrc) } return format; } -bool CFX_ImageTransformer::Continue(IFX_Pause* pPause) +FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause) { if (m_Status == 1) { if (m_Stretcher.Continue(pPause)) { - return true; + return TRUE; } if (m_Storer.GetBitmap()) { m_Storer.Replace(m_Storer.GetBitmap()->SwapXY(m_pMatrix->c > 0, m_pMatrix->b < 0)); } - return false; + return FALSE; } if (m_Status == 2) { return m_Stretcher.Continue(pPause); } if (m_Status != 3) { - return false; + return FALSE; } if (m_Stretcher.Continue(pPause)) { - return true; + return TRUE; } int stretch_width = m_StretchClip.Width(); int stretch_height = m_StretchClip.Height(); if (m_Storer.GetBitmap() == NULL) { - return false; + return FALSE; } const uint8_t* stretch_buf = m_Storer.GetBitmap()->GetBuffer(); const uint8_t* stretch_buf_mask = NULL; @@ -370,7 +370,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause) FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource); if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) { delete pTransformed; - return false; + return FALSE; } pTransformed->Clear(0); if (pTransformed->m_pAlphaMask) { @@ -641,7 +641,7 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause) } } } else { - bool bHasAlpha = m_Storer.GetBitmap()->HasAlpha(); + FX_BOOL bHasAlpha = m_Storer.GetBitmap()->HasAlpha(); int destBpp = pTransformed->GetBPP() / 8; if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) { CFX_BilinearMatrix result2stretch_fix(result2stretch, 8); @@ -786,5 +786,5 @@ bool CFX_ImageTransformer::Continue(IFX_Pause* pPause) } } m_Storer.Replace(pTransformed); - return false; + return FALSE; } |