summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-09 11:30:25 -0700
commitbb17868d736f698d5217c30d52c5bbfed62c5936 (patch)
tree9d4d3e2538a81e6241d4992570bc3f3c1af71d28 /core/src/fxge
parentbf6c2a4873f8cc12ad910fb904218a78087a3735 (diff)
downloadpdfium-bb17868d736f698d5217c30d52c5bbfed62c5936.tar.xz
Use stdint.h types throughout PDFium.
It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/agg/agg23/fx_agg_driver.cpp54
-rw-r--r--core/src/fxge/android/fpf_skiafont.cpp20
-rw-r--r--core/src/fxge/android/fpf_skiafont.h20
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.cpp56
-rw-r--r--core/src/fxge/android/fpf_skiafontmgr.h24
-rw-r--r--core/src/fxge/apple/apple_int.h26
-rw-r--r--core/src/fxge/apple/fx_quartz_device.cpp44
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp328
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp66
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp86
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp62
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp64
-rw-r--r--core/src/fxge/ge/fx_ge.cpp2
-rw-r--r--core/src/fxge/ge/fx_ge_device.cpp2
-rw-r--r--core/src/fxge/ge/fx_ge_font.cpp4
-rw-r--r--core/src/fxge/ge/fx_ge_fontmap.cpp30
-rw-r--r--core/src/fxge/ge/fx_ge_linux.cpp28
-rw-r--r--core/src/fxge/ge/fx_ge_ps.cpp6
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp54
-rw-r--r--core/src/fxge/ge/text_int.h2
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.cpp200
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.h68
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp18
-rw-r--r--core/src/fxge/win32/fx_win32_dib.cpp6
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp2
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp6
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp2
-rw-r--r--core/src/fxge/win32/win32_int.h2
28 files changed, 641 insertions, 641 deletions
diff --git a/core/src/fxge/agg/agg23/fx_agg_driver.cpp b/core/src/fxge/agg/agg23/fx_agg_driver.cpp
index 08f76bf8e1..60843d7441 100644
--- a/core/src/fxge/agg/agg23/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/agg23/fx_agg_driver.cpp
@@ -402,7 +402,7 @@ public:
} else {
src_alpha = m_Alpha;
}
- FX_BYTE dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255;
+ uint8_t dest_alpha = ori_scan[3] + src_alpha - ori_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (m_bFullCover) {
@@ -476,7 +476,7 @@ public:
dest_scan += 2;
continue;
}
- FX_BYTE cover = cover_scan[col];
+ uint8_t cover = cover_scan[col];
dest_scan[3] = FXDIB_ALPHA_MERGE(dest_scan[3], src_alpha, cover);
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, cover);
dest_scan ++;
@@ -535,7 +535,7 @@ public:
} else {
int index = 0;
if (m_pDevice->GetPalette() == NULL) {
- index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0;
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
} else {
for (int i = 0; i < 2; i ++)
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) {
@@ -573,7 +573,7 @@ public:
dest_scan += col_start / 8;
int index = 0;
if (m_pDevice->GetPalette() == NULL) {
- index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0;
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
} else {
for (int i = 0; i < 2; i ++)
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color) {
@@ -628,7 +628,7 @@ public:
*dest_scan = m_Gray;
*dest_extra_alpha_scan = m_Alpha;
} else {
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
@@ -687,7 +687,7 @@ public:
if (src_alpha == 255) {
*(FX_DWORD*)dest_scan = m_Color;
} else {
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Red, alpha_ratio);
@@ -730,7 +730,7 @@ public:
dest_scan += 2;
continue;
}
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio);
@@ -803,13 +803,13 @@ public:
}
if (src_alpha) {
if (src_alpha == 255) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
- *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
+ *dest_extra_alpha_scan++ = (uint8_t)m_Alpha;
continue;
} else {
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
@@ -893,9 +893,9 @@ public:
if (src_alpha) {
if (src_alpha == 255) {
*(FX_CMYK*)dest_scan = m_Color;
- *dest_extra_alpha_scan = (FX_BYTE)m_Alpha;
+ *dest_extra_alpha_scan = (uint8_t)m_Alpha;
} else {
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
@@ -1029,13 +1029,13 @@ public:
m_Gray = 255;
} else {
if (pIccTransform) {
- FX_BYTE gray;
+ uint8_t gray;
color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, &gray, (FX_LPCBYTE)&color, 1);
m_Gray = gray;
} else {
if (bObjectCMYK) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
r, g, b);
m_Gray = FXRGB2GRAY(r, g, b);
@@ -1080,7 +1080,7 @@ public:
}
} else {
if (bObjectCMYK) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
r, g, b);
m_Color = FXARGB_MAKE(m_Alpha, r, g, b);
@@ -1192,7 +1192,7 @@ void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb)
if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) {
return;
}
- FX_LPBYTE pos = (FX_BYTE*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8;
+ FX_LPBYTE pos = (uint8_t*)pBitmap->GetBuffer() + y * pBitmap->GetPitch() + x * pBitmap->GetBPP() / 8;
if (pBitmap->GetFormat() == FXDIB_Argb) {
FXARGB_SETRGBORDERDIB(pos, ArgbGamma(argb));
} else {
@@ -1215,7 +1215,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid
int Bpp = pBitmap->GetBPP() / 8;
FX_BOOL bAlpha = pBitmap->HasAlpha();
int dib_argb = FXARGB_TOBGRORDERDIB(argb);
- FX_BYTE* pBuffer = pBitmap->GetBuffer();
+ uint8_t* pBuffer = pBitmap->GetBuffer();
if (src_alpha == 255) {
for (int row = rect.top; row < rect.bottom; row ++) {
FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp;
@@ -1241,13 +1241,13 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid
FX_LPBYTE dest_scan = pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp;
if (bAlpha) {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_r, alpha_ratio);
@@ -1286,7 +1286,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
FXDIB_Format dest_format = pBitmap->GetFormat();
FXDIB_Format src_format = pSrcBitmap->GetFormat();
int pitch = pBitmap->GetPitch();
- FX_BYTE* buffer = pBitmap->GetBuffer();
+ uint8_t* buffer = pBitmap->GetBuffer();
if (dest_format == src_format) {
for (int row = 0; row < height; row ++) {
FX_LPBYTE dest_scan = buffer + (dest_top + row) * pitch + dest_left * Bpp;
@@ -1313,7 +1313,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
if (src_format == FXDIB_Rgb32) {
for (int row = 0; row < height; row ++) {
FX_LPBYTE dest_scan = dest_buf + row * pitch;
- FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
*dest_scan++ = src_scan[2];
*dest_scan++ = src_scan[1];
@@ -1327,8 +1327,8 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
} else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) {
if (src_format == FXDIB_Rgb) {
for (int row = 0; row < height; row ++) {
- FX_BYTE* dest_scan = (FX_BYTE*)(dest_buf + row * pitch);
- FX_LPBYTE src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
+ uint8_t* dest_scan = (uint8_t*)(dest_buf + row * pitch);
+ FX_LPBYTE src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
if (src_format == FXDIB_Argb) {
for (int col = 0; col < width; col ++) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(0xff, FX_GAMMA(src_scan[0]), FX_GAMMA(src_scan[1]), FX_GAMMA(src_scan[2])));
@@ -1359,9 +1359,9 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
ASSERT(FALSE);
}
}
-FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, FX_BYTE alpha)
+FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
{
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
return ArgbEncode(alpha, r, g, b);
diff --git a/core/src/fxge/android/fpf_skiafont.cpp b/core/src/fxge/android/fpf_skiafont.cpp
index 97eeb2f683..290d989851 100644
--- a/core/src/fxge/android/fpf_skiafont.cpp
+++ b/core/src/fxge/android/fpf_skiafont.cpp
@@ -53,7 +53,7 @@ CFX_WideString CFPF_SkiaFont::GetPsName()
}
return CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face));
}
-FX_INT32 CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode)
+int32_t CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode)
{
if (!m_Face) {
return wUnicode;
@@ -63,7 +63,7 @@ FX_INT32 CFPF_SkiaFont::GetGlyphIndex(FX_WCHAR wUnicode)
}
return FXFT_Get_Char_Index(m_Face, wUnicode);
}
-FX_INT32 CFPF_SkiaFont::GetGlyphWidth(FX_INT32 iGlyphIndex)
+int32_t CFPF_SkiaFont::GetGlyphWidth(int32_t iGlyphIndex)
{
if (!m_Face) {
return 0;
@@ -73,21 +73,21 @@ FX_INT32 CFPF_SkiaFont::GetGlyphWidth(FX_INT32 iGlyphIndex)
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Glyph_HoriAdvance(m_Face));
}
-FX_INT32 CFPF_SkiaFont::GetAscent() const
+int32_t CFPF_SkiaFont::GetAscent() const
{
if (!m_Face) {
return 0;
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Ascender(m_Face));
}
-FX_INT32 CFPF_SkiaFont::GetDescent() const
+int32_t CFPF_SkiaFont::GetDescent() const
{
if (!m_Face) {
return 0;
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Descender(m_Face));
}
-FX_BOOL CFPF_SkiaFont::GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox)
+FX_BOOL CFPF_SkiaFont::GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox)
{
if (!m_Face) {
return FALSE;
@@ -107,8 +107,8 @@ FX_BOOL CFPF_SkiaFont::GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox)
}
FXFT_BBox cbox;
FXFT_Glyph_Get_CBox(glyph, FXFT_GLYPH_BBOX_PIXELS, &cbox);
- FX_INT32 x_ppem = m_Face->size->metrics.x_ppem;
- FX_INT32 y_ppem = m_Face->size->metrics.y_ppem;
+ int32_t x_ppem = m_Face->size->metrics.x_ppem;
+ int32_t y_ppem = m_Face->size->metrics.y_ppem;
rtBBox.left = FPF_EM_ADJUST(x_ppem, cbox.xMin);
rtBBox.right = FPF_EM_ADJUST(x_ppem, cbox.xMax);
rtBBox.top = FPF_EM_ADJUST(y_ppem, cbox.yMax);
@@ -138,14 +138,14 @@ FX_BOOL CFPF_SkiaFont::GetBBox(FX_RECT &rtBBox)
rtBBox.bottom = FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_yMax(m_Face));
return TRUE;
}
-FX_INT32 CFPF_SkiaFont::GetHeight() const
+int32_t CFPF_SkiaFont::GetHeight() const
{
if (!m_Face) {
return 0;
}
return FPF_EM_ADJUST(FXFT_Get_Face_UnitsPerEM(m_Face), FXFT_Get_Face_Height(m_Face));
}
-FX_INT32 CFPF_SkiaFont::GetItalicAngle() const
+int32_t CFPF_SkiaFont::GetItalicAngle() const
{
if (!m_Face) {
return 0;
@@ -166,7 +166,7 @@ FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWOR
}
return dwSize;
}
-FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset)
+FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
{
if (!pFontMgr || !pFontDes) {
return FALSE;
diff --git a/core/src/fxge/android/fpf_skiafont.h b/core/src/fxge/android/fpf_skiafont.h
index 135c830c95..72b569fe2e 100644
--- a/core/src/fxge/android/fpf_skiafont.h
+++ b/core/src/fxge/android/fpf_skiafont.h
@@ -28,30 +28,30 @@ public:
{
return m_dwStyle;
}
- virtual FX_BYTE GetCharset() const
+ virtual uint8_t GetCharset() const
{
return m_uCharset;
}
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode);
- virtual FX_INT32 GetGlyphWidth(FX_INT32 iGlyphIndex);
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode);
+ virtual int32_t GetGlyphWidth(int32_t iGlyphIndex);
- virtual FX_INT32 GetAscent() const;
- virtual FX_INT32 GetDescent() const;
+ virtual int32_t GetAscent() const;
+ virtual int32_t GetDescent() const;
- virtual FX_BOOL GetGlyphBBox(FX_INT32 iGlyphIndex, FX_RECT &rtBBox);
+ virtual FX_BOOL GetGlyphBBox(int32_t iGlyphIndex, FX_RECT &rtBBox);
virtual FX_BOOL GetBBox(FX_RECT &rtBBox);
- virtual FX_INT32 GetHeight() const;
- virtual FX_INT32 GetItalicAngle() const;
+ virtual int32_t GetHeight() const;
+ virtual int32_t GetItalicAngle() const;
virtual FX_DWORD GetFontData(FX_DWORD dwTable, FX_LPBYTE pBuffer, FX_DWORD dwSize);
- FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset);
+ FX_BOOL InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset);
protected:
CFPF_SkiaFontMgr *m_pFontMgr;
CFPF_SkiaFontDescriptor *m_pFontDes;
FXFT_Face m_Face;
FX_DWORD m_dwStyle;
- FX_BYTE m_uCharset;
+ uint8_t m_uCharset;
FX_DWORD m_dwRefCount;
};
#endif
diff --git a/core/src/fxge/android/fpf_skiafontmgr.cpp b/core/src/fxge/android/fpf_skiafontmgr.cpp
index fc012ea9ac..ba1e12acaf 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/src/fxge/android/fpf_skiafontmgr.cpp
@@ -64,10 +64,10 @@ static const FPF_SKIAFONTMAP g_SkiaFontmap[] = {
};
FX_DWORD FPF_SkiaGetSubstFont(FX_DWORD dwHash)
{
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP);
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP);
while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FPF_LPCSKIAFONTMAP pItem = &g_SkiaFontmap[iMid];
if (dwHash < pItem->dwFamily) {
iEnd = iMid - 1;
@@ -88,10 +88,10 @@ static const FPF_SKIAFONTMAP g_SkiaSansFontMap[] = {
};
FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash)
{
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP);
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP);
while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FPF_LPCSKIAFONTMAP pItem = &g_SkiaSansFontMap[iMid];
if (dwHash < pItem->dwFamily) {
iEnd = iMid - 1;
@@ -103,7 +103,7 @@ FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash)
}
return 0;
}
-static FX_UINT32 FPF_GetHashCode_StringA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE)
+static uint32_t FPF_GetHashCode_StringA(FX_LPCSTR pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE)
{
if (!pStr) {
return 0;
@@ -112,7 +112,7 @@ static FX_UINT32 FPF_GetHashCode_StringA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BO
iLength = FXSYS_strlen(pStr);
}
FX_LPCSTR pStrEnd = pStr + iLength;
- FX_UINT32 uHashCode = 0;
+ uint32_t uHashCode = 0;
if (bIgnoreCase) {
while (pStr < pStrEnd) {
uHashCode = 31 * uHashCode + FXSYS_tolower(*pStr++);
@@ -145,7 +145,7 @@ enum FPF_SKIACHARSET {
FPF_SKIACHARSET_PC = 1 << 17,
FPF_SKIACHARSET_OEM = 1 << 18,
};
-static FX_DWORD FPF_SkiaGetCharset(FX_BYTE uCharset)
+static FX_DWORD FPF_SkiaGetCharset(uint8_t uCharset)
{
switch (uCharset) {
case FXFONT_ANSI_CHARSET:
@@ -184,9 +184,9 @@ static FX_DWORD FPF_SkiaGetCharset(FX_BYTE uCharset)
static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily)
{
FX_DWORD dwHash = 0;
- FX_INT32 iLength = bsfamily.GetLength();
+ int32_t iLength = bsfamily.GetLength();
FX_LPCSTR pBuffer = bsfamily.GetCStr();
- for (FX_INT32 i = 0; i < iLength; i++) {
+ for (int32_t i = 0; i < iLength; i++) {
FX_CHAR ch = pBuffer[i];
if (ch == ' ' || ch == '-' || ch == ',') {
continue;
@@ -195,7 +195,7 @@ static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily)
}
return dwHash;
}
-static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYTE uCharset)
+static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
{
CFX_ByteString bsFont(bsFamily);
if (dwStyle & FXFONT_BOLD) {
@@ -210,7 +210,7 @@ static FX_DWORD FPF_SKIAGetFamilyHash(FX_BSTR bsFamily, FX_DWORD dwStyle, FX_BYT
bsFont += uCharset;
return FPF_GetHashCode_StringA(bsFont.c_str(), bsFont.GetLength(), TRUE);
}
-static FX_BOOL FPF_SkiaIsCJK(FX_BYTE uCharset)
+static FX_BOOL FPF_SkiaIsCJK(uint8_t uCharset)
{
return (uCharset == FXFONT_GB2312_CHARSET) || (uCharset == FXFONT_CHINESEBIG5_CHARSET)
|| (uCharset == FXFONT_HANGEUL_CHARSET) || (uCharset == FXFONT_SHIFTJIS_CHARSET);
@@ -243,7 +243,7 @@ CFPF_SkiaFontMgr::~CFPF_SkiaFontMgr()
}
}
m_FamilyFonts.RemoveAll();
- for (FX_INT32 i = m_FontFaces.GetUpperBound(); i >= 0; i--) {
+ for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) {
CFPF_SkiaFontDescriptor *pFont = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(i);
if (pFont) {
delete pFont;
@@ -279,11 +279,11 @@ void CFPF_SkiaFontMgr::LoadPrivateFont(FX_BSTR bsFileName)
void CFPF_SkiaFontMgr::LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer)
{
}
-IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch)
+IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, uint8_t uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch)
{
FX_DWORD dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset);
IFPF_Font *pFont = NULL;
- if (m_FamilyFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
if (pFont) {
return pFont->Retain();
}
@@ -297,16 +297,16 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset,
} else if (uCharset == FXFONT_ANSI_CHARSET && (dwMatch & FPF_MATCHFONT_REPLACEANSI)) {
uCharset = FXFONT_DEFAULT_CHARSET;
}
- FX_INT32 nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 + FPF_SKIAMATCHWEIGHT_2 * 2;
- FX_INT32 nItem = -1;
- FX_INT32 nMax = -1;
- FX_INT32 nGlyphNum = 0;
- for (FX_INT32 i = m_FontFaces.GetUpperBound(); i >= 0; i--) {
+ int32_t nExpectVal = FPF_SKIAMATCHWEIGHT_NAME1 + FPF_SKIAMATCHWEIGHT_1 * 3 + FPF_SKIAMATCHWEIGHT_2 * 2;
+ int32_t nItem = -1;
+ int32_t nMax = -1;
+ int32_t nGlyphNum = 0;
+ for (int32_t i = m_FontFaces.GetUpperBound(); i >= 0; i--) {
CFPF_SkiaPathFont *pFontDes = (CFPF_SkiaPathFont*)m_FontFaces.ElementAt(i);
if(!(pFontDes->m_dwCharsets & FPF_SkiaGetCharset(uCharset))) {
continue;
}
- FX_INT32 nFind = 0;
+ int32_t nFind = 0;
FX_DWORD dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily);
if (dwFaceName == dwSysFontName) {
nFind += FPF_SKIAMATCHWEIGHT_NAME1;
@@ -354,14 +354,14 @@ IFPF_Font* CFPF_SkiaFontMgr::CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset,
CFPF_SkiaFontDescriptor *pFontDes = (CFPF_SkiaFontDescriptor*)m_FontFaces.ElementAt(nItem);
CFPF_SkiaFont *pFont = new CFPF_SkiaFont;
if (pFont->InitFont(this, pFontDes, bsFamilyname, dwStyle, uCharset)) {
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return pFont->Retain();
}
pFont->Release();
}
return NULL;
}
-FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceIndex)
+FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, int32_t iFaceIndex)
{
if (!pFileRead) {
return NULL;
@@ -388,7 +388,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceI
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
}
-FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex )
+FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, int32_t iFaceIndex )
{
if (bsFile.IsEmpty()) {
return NULL;
@@ -406,7 +406,7 @@ FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex )
FXFT_Set_Pixel_Sizes(face, 0, 64);
return face;
}
-FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, FX_INT32 iFaceIndex )
+FXFT_Face CFPF_SkiaFontMgr::GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, int32_t iFaceIndex )
{
if (!pBuffer || szBuffer < 1) {
return NULL;
@@ -505,7 +505,7 @@ static FX_DWORD FPF_SkiaGetFaceCharset(TT_OS2 *pOS2)
{
FX_DWORD dwCharset = 0;
if (pOS2) {
- for (FX_INT32 i = 0; i < 32; i++) {
+ for (int32_t i = 0; i < 32; i++) {
if (pOS2->ulCodePageRange1 & (1 << i)) {
dwCharset |= g_FPFSkiaFontCharsets[i];
}
@@ -535,7 +535,7 @@ void CFPF_SkiaFontMgr::ReportFace(FXFT_Face face, CFPF_SkiaFontDescriptor *pFont
pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC;
}
if (pOS2->panose[0] == 2) {
- FX_BYTE uSerif = pOS2->panose[1];
+ uint8_t uSerif = pOS2->panose[1];
if ((uSerif > 1 && uSerif < 10) || uSerif > 13) {
pFontDesc->m_dwStyle |= FXFONT_SERIF;
}
diff --git a/core/src/fxge/android/fpf_skiafontmgr.h b/core/src/fxge/android/fpf_skiafontmgr.h
index 3c072fa186..44d427f8af 100644
--- a/core/src/fxge/android/fpf_skiafontmgr.h
+++ b/core/src/fxge/android/fpf_skiafontmgr.h
@@ -22,7 +22,7 @@ public:
FX_Free(m_pFamily);
}
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FPF_SKIAFONTTYPE_Unknown;
}
@@ -31,16 +31,16 @@ public:
if (m_pFamily) {
FX_Free(m_pFamily);
}
- FX_INT32 iSize = FXSYS_strlen(pFamily);
+ int32_t iSize = FXSYS_strlen(pFamily);
m_pFamily = FX_Alloc(FX_CHAR, iSize + 1);
FXSYS_memcpy32(m_pFamily, pFamily, iSize * sizeof(FX_CHAR));
m_pFamily[iSize] = 0;
}
FX_LPSTR m_pFamily;
FX_DWORD m_dwStyle;
- FX_INT32 m_iFaceIndex;
+ int32_t m_iFaceIndex;
FX_DWORD m_dwCharsets;
- FX_INT32 m_iGlyphNum;
+ int32_t m_iGlyphNum;
};
class CFPF_SkiaPathFont : public CFPF_SkiaFontDescriptor
{
@@ -52,7 +52,7 @@ public:
FX_Free(m_pPath);
}
}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FPF_SKIAFONTTYPE_Path;
}
@@ -61,7 +61,7 @@ public:
if (m_pPath) {
FX_Free(m_pPath);
}
- FX_INT32 iSize = FXSYS_strlen(pPath);
+ int32_t iSize = FXSYS_strlen(pPath);
m_pPath = FX_Alloc(FX_CHAR, iSize + 1);
FXSYS_memcpy32(m_pPath, pPath, iSize * sizeof(FX_CHAR));
m_pPath[iSize] = 0;
@@ -72,7 +72,7 @@ class CFPF_SkiaFileFont : public CFPF_SkiaFontDescriptor
{
public:
CFPF_SkiaFileFont() : m_pFile(NULL) {}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FPF_SKIAFONTTYPE_File;
}
@@ -82,7 +82,7 @@ class CFPF_SkiaBufferFont : public CFPF_SkiaFontDescriptor
{
public:
CFPF_SkiaBufferFont() : m_pBuffer(NULL), m_szBuffer(0) {}
- virtual FX_INT32 GetType() const
+ virtual int32_t GetType() const
{
return FPF_SKIAFONTTYPE_Buffer;
}
@@ -100,10 +100,10 @@ public:
virtual void LoadPrivateFont(FX_BSTR bsFileName);
virtual void LoadPrivateFont(FX_LPVOID pBuffer, size_t szBuffer);
- virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, FX_BYTE uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0);
- FXFT_Face GetFontFace(IFX_FileRead *pFileRead, FX_INT32 iFaceIndex = 0);
- FXFT_Face GetFontFace(FX_BSTR bsFile, FX_INT32 iFaceIndex = 0);
- FXFT_Face GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, FX_INT32 iFaceIndex = 0);
+ virtual IFPF_Font* CreateFont(FX_BSTR bsFamilyname, uint8_t uCharset, FX_DWORD dwStyle, FX_DWORD dwMatch = 0);
+ FXFT_Face GetFontFace(IFX_FileRead *pFileRead, int32_t iFaceIndex = 0);
+ FXFT_Face GetFontFace(FX_BSTR bsFile, int32_t iFaceIndex = 0);
+ FXFT_Face GetFontFace(FX_LPCBYTE pBuffer, size_t szBuffer, int32_t iFaceIndex = 0);
protected:
void ScanPath(FX_BSTR path);
void ScanFile(FX_BSTR file);
diff --git a/core/src/fxge/apple/apple_int.h b/core/src/fxge/apple/apple_int.h
index 2466ecbc9a..6cd880603a 100644
--- a/core/src/fxge/apple/apple_int.h
+++ b/core/src/fxge/apple/apple_int.h
@@ -56,7 +56,7 @@ public:
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
CGPoint* glyphPositions,
- FX_INT32 chars,
+ int32_t chars,
FX_ARGB argb,
CFX_AffineMatrix* matrix = NULL);
void saveGraphicsState(void* graphics);
@@ -81,7 +81,7 @@ public:
class CFX_QuartzDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass);
+ CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass);
virtual ~CFX_QuartzDeviceDriver();
virtual int GetDeviceCaps(int caps_id);
@@ -176,15 +176,15 @@ protected:
CGContextRef _context;
CGAffineTransform _foxitDevice2User;
CGAffineTransform _user2FoxitDevice;
- FX_INT32 m_saveCount;
+ int32_t m_saveCount;
- FX_INT32 _width;
- FX_INT32 _height;
- FX_INT32 _bitsPerPixel;
- FX_INT32 _deviceClass;
- FX_INT32 _renderCaps;
- FX_INT32 _horzSize;
- FX_INT32 _vertSize;
+ int32_t _width;
+ int32_t _height;
+ int32_t _bitsPerPixel;
+ int32_t _deviceClass;
+ int32_t _renderCaps;
+ int32_t _horzSize;
+ int32_t _vertSize;
};
class CFX_FontProvider final : public IFX_FileRead
{
@@ -239,10 +239,10 @@ private:
int _tableCount;
int _totalSize;
};
-FX_UINT32 FX_GetHashCode( FX_LPCSTR pStr);
+uint32_t FX_GetHashCode( FX_LPCSTR pStr);
FX_DWORD FX_IOSGetMatchFamilyNameHashcode(FX_LPCSTR pFontName);
-FX_UINT32 FX_IOSGetFamilyNamesCount();
-FX_LPCSTR FX_IOSGetFamilyName( FX_UINT32 uIndex);
+uint32_t FX_IOSGetFamilyNamesCount();
+FX_LPCSTR FX_IOSGetFamilyName( uint32_t uIndex);
#endif
#endif // CORE_SRC_FXGE_APPLE_APPLE_INT_H_
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index f7faee15b3..6a97c7baf2 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -81,7 +81,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
FX_FLOAT fontSize,
FX_WORD* glyphIndices,
CGPoint* glyphPositions,
- FX_INT32 charsCount,
+ int32_t charsCount,
FX_ARGB argb,
CFX_AffineMatrix* matrix )
{
@@ -102,7 +102,7 @@ FX_BOOL CQuartz2D::drawGraphicsString(void* graphics,
matrix->f));
CGContextSetTextMatrix(context, m);
}
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(context,
r / 255.f,
@@ -166,7 +166,7 @@ static CGContextRef createContextWithBitmap(CFX_DIBitmap* pBitmap)
CGColorSpaceRelease(colorSpace);
return context;
}
-CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, FX_INT32 deviceClass)
+CFX_QuartzDeviceDriver::CFX_QuartzDeviceDriver(CGContextRef context, int32_t deviceClass)
{
m_saveCount = 0;
_context = context;
@@ -438,7 +438,7 @@ FX_BOOL CFX_QuartzDeviceDriver::FillRect(const FX_RECT* rect,
}
CGRect rect_fx = CGRectMake(rect->left, rect->top, rect->Width(), rect->Height());
CGRect rect_usr = CGRectApplyAffineTransform(rect_fx, _foxitDevice2User);
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(fillArgb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -470,7 +470,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
pt = CGPointApplyAffineTransform(CGPointMake(x2, y2), _foxitDevice2User);
x2 = pt.x;
y2 = pt.y;
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBStrokeColor(_context,
r / 255.f,
@@ -496,8 +496,8 @@ FX_BOOL CFX_QuartzDeviceDriver::GetClipBox(FX_RECT* rect)
return TRUE;
}
FX_BOOL CFX_QuartzDeviceDriver::GetDIBits(CFX_DIBitmap* bitmap,
- FX_INT32 left,
- FX_INT32 top,
+ int32_t left,
+ int32_t top,
void* pIccTransform,
FX_BOOL bDEdge)
{
@@ -656,9 +656,9 @@ FX_BOOL CFX_QuartzDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f);
pScanline += 4;
}
}
@@ -781,9 +781,9 @@ FX_BOOL CFX_QuartzDeviceDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
for (int row = 0; row < pBitmap1->GetHeight(); row ++) {
FX_LPBYTE pScanline = (FX_LPBYTE)pBitmap1->GetScanline(row);
for (int col = 0; col < pBitmap1->GetWidth(); col ++) {
- pScanline[0] = (FX_BYTE)(pScanline[0] * pScanline[3] / 255.f + .5f);
- pScanline[1] = (FX_BYTE)(pScanline[1] * pScanline[3] / 255.f + .5f);
- pScanline[2] = (FX_BYTE)(pScanline[2] * pScanline[3] / 255.f + .5f);
+ pScanline[0] = (uint8_t)(pScanline[0] * pScanline[3] / 255.f + .5f);
+ pScanline[1] = (uint8_t)(pScanline[1] * pScanline[3] / 255.f + .5f);
+ pScanline[2] = (uint8_t)(pScanline[2] * pScanline[3] / 255.f + .5f);
pScanline += 4;
}
}
@@ -844,7 +844,7 @@ FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlypRun(int nChars
CGContextSetTextMatrix(_context, matrix_cg);
CGContextSetFont(_context, (CGFontRef)pFont->m_pPlatformFont);
CGContextSetFontSize(_context, FXSYS_fabs(font_size));
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -897,7 +897,7 @@ FX_BOOL CFX_QuartzDeviceDriver::DrawDeviceText(int nChars,
SaveState();
CGContextSetTextDrawingMode(_context, kCGTextFillClip);
FX_BOOL ret = FALSE;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < nChars) {
if (pCharPos[i].m_bGlyphAdjust || font_size < 0) {
if (i > 0) {
@@ -992,7 +992,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState,
delete[] dashArray;
#endif
}
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBStrokeColor(_context,
r / 255.f,
@@ -1002,7 +1002,7 @@ void CFX_QuartzDeviceDriver::setStrokeInfo(const CFX_GraphStateData* graphState,
}
void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
{
- FX_INT32 a, r, g, b;
+ int32_t a, r, g, b;
ArgbDecode(argb, a, r, g, b);
CGContextSetRGBFillColor(_context,
r / 255.f,
@@ -1012,10 +1012,10 @@ void CFX_QuartzDeviceDriver::setFillInfo(FX_ARGB argb)
}
void CFX_QuartzDeviceDriver::setPathToContext(const CFX_PathData* pathData)
{
- FX_INT32 count = pathData->GetPointCount();
+ int32_t count = pathData->GetPointCount();
FX_PATHPOINT* points = pathData->GetPoints();
CGContextBeginPath(_context);
- for (FX_INT32 i = 0; i < count; i ++) {
+ for (int32_t i = 0; i < count; i ++) {
switch (points[i].m_Flag & FXPT_TYPE) {
case FXPT_MOVETO:
CGContextMoveToPoint(_context, points[i].m_PointX, points[i].m_PointY);
@@ -1090,7 +1090,7 @@ CGContextRef CFX_QuartzDevice::GetContext()
{
return m_pContext;
}
-FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, FX_INT32 nDeviceClass)
+FX_BOOL CFX_QuartzDevice::Attach(CGContextRef context, int32_t nDeviceClass)
{
if (m_pContext) {
CGContextRelease(m_pContext);
@@ -1112,9 +1112,9 @@ FX_BOOL CFX_QuartzDevice::Attach(CFX_DIBitmap* pBitmap)
SetDeviceDriver(pDriver);
return TRUE;
}
-FX_BOOL CFX_QuartzDevice::Create(FX_INT32 width, FX_INT32 height, FXDIB_Format format)
+FX_BOOL CFX_QuartzDevice::Create(int32_t width, int32_t height, FXDIB_Format format)
{
- if ((FX_BYTE)format < 32) {
+ if ((uint8_t)format < 32) {
return FALSE;
}
CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index e385bc9ffe..970325a2d4 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -7,7 +7,7 @@
#include "../../../include/fxge/fx_ge.h"
#include "../../../include/fxcodec/fx_codec.h"
#include "dib_int.h"
-const FX_BYTE g_GammaRamp[256] = {
+const uint8_t g_GammaRamp[256] = {
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
@@ -25,7 +25,7 @@ const FX_BYTE g_GammaRamp[256] = {
190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220,
222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255,
};
-const FX_BYTE g_GammaInverse[256] = {
+const uint8_t g_GammaInverse[256] = {
0, 13, 22, 28, 34, 38, 42, 46, 50, 53, 56, 59, 61, 64, 66, 69,
71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 93, 95, 96, 98,
99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119,
@@ -43,7 +43,7 @@ const FX_BYTE g_GammaInverse[256] = {
241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
};
-const FX_BYTE _color_sqrt[256] = {
+const uint8_t _color_sqrt[256] = {
0x00, 0x03, 0x07, 0x0B, 0x0F, 0x12, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32,
0x35, 0x37, 0x3A, 0x3C, 0x3F, 0x41, 0x43, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56,
0x57, 0x59, 0x5B, 0x5C, 0x5E, 0x60, 0x61, 0x63, 0x64, 0x65, 0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D,
@@ -227,7 +227,7 @@ static _RGB _SetSat(_RGB color, int s)
}
return color;
}
-void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, FX_BYTE* dest_scan, int results[3])
+void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, uint8_t* dest_scan, int results[3])
{
_RGB src, back, result;
src.red = src_scan[2];
@@ -262,7 +262,7 @@ inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -279,7 +279,7 @@ void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -312,7 +312,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
@@ -331,7 +331,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 3;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -343,7 +343,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -360,7 +360,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
} else
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = src_scan[3];
if (clip_scan) {
@@ -379,7 +379,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 4;
continue;
}
- FX_BYTE src_alpha = src_scan[3];
+ uint8_t src_alpha = src_scan[3];
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -391,7 +391,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -406,7 +406,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
@@ -425,7 +425,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 3;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -437,7 +437,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -450,7 +450,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
} else
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = src_scan[3];
if (clip_scan) {
@@ -469,7 +469,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 4;
continue;
}
- FX_BYTE src_alpha = src_scan[3];
+ uint8_t src_alpha = src_scan[3];
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -481,7 +481,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -498,7 +498,7 @@ inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
FX_LPCBYTE src_alpha_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
@@ -589,7 +589,7 @@ inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
@@ -665,10 +665,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -707,10 +707,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -728,7 +728,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
if (dest_alpha_scan == NULL) {
if (src_alpha_scan == NULL) {
- FX_BYTE back_alpha = 0;
+ uint8_t back_alpha = 0;
for (int col = 0; col < pixel_count; col ++) {
back_alpha = dest_scan[3];
if (back_alpha == 0) {
@@ -742,7 +742,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -753,7 +753,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -776,7 +776,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
}
} else {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -789,7 +789,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -800,7 +800,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 3;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -824,7 +824,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
} else {
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -842,7 +842,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -854,7 +854,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -875,7 +875,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
}
} else {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -893,7 +893,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -905,7 +905,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -936,7 +936,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (src_Bpp == 4) {
FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
@@ -964,7 +964,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -998,7 +998,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -1012,7 +1012,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1033,7 +1033,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
} else {
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -1048,7 +1048,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1088,7 +1088,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -1117,7 +1117,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -1161,7 +1161,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1188,7 +1188,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -1220,7 +1220,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1249,7 +1249,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -1306,7 +1306,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
+ uint8_t src_alpha = *clip_scan ++;
if (src_alpha == 0) {
dest_scan += dest_Bpp;
src_scan += src_Bpp;
@@ -1396,7 +1396,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
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);
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -1414,7 +1414,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -1427,7 +1427,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1527,7 +1527,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBY
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1566,7 +1566,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPC
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1669,7 +1669,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
@@ -1689,7 +1689,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
@@ -1707,7 +1707,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
if (bNonseparableBlend) {
blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
}
@@ -1723,7 +1723,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
if (clip_scan && clip_scan[col] < 255) {
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
} else {
@@ -1743,9 +1743,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan ++;
if (clip_scan) {
@@ -1759,7 +1759,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -1781,9 +1781,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan ++;
if (clip_scan) {
@@ -1797,7 +1797,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -1817,7 +1817,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
@@ -1831,7 +1831,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1844,7 +1844,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
@@ -1858,7 +1858,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
@@ -1875,7 +1875,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (bNonseparableBlend) {
blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
}
@@ -1890,7 +1890,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan && clip_scan[col] < 255) {
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
} else {
@@ -1909,7 +1909,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
*dest_alpha_scan ++ = 255;
@@ -1922,7 +1922,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1935,7 +1935,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
*dest_alpha_scan ++ = 255;
@@ -1948,7 +1948,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
@@ -1968,7 +1968,7 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE sr
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
src_scan ++;
- FX_BYTE src_alpha = 0;
+ uint8_t src_alpha = 0;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -2069,7 +2069,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
int src_r = FXARGB_R(argb);
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -2081,7 +2081,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -2091,7 +2091,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2123,7 +2123,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2147,7 +2147,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
int src_r = FXARGB_R(argb);
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -2161,7 +2161,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan++;
} else {
@@ -2172,7 +2172,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2204,7 +2204,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2251,7 +2251,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2300,7 +2300,7 @@ void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2321,7 +2321,7 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
@@ -2331,12 +2331,12 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2379,7 +2379,7 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_b;
*dest_scan ++ = src_g;
@@ -2392,12 +2392,12 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2447,7 +2447,7 @@ void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2486,7 +2486,7 @@ void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -2522,7 +2522,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_gray;
*dest_alpha_scan ++ = src_alpha;
@@ -2533,7 +2533,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
@@ -2564,18 +2564,18 @@ void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2636,7 +2636,7 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
*dest_scan ++ = src_b;
*dest_scan ++ = src_g;
@@ -2644,12 +2644,12 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
*dest_alpha_scan ++ = mask_alpha;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2714,7 +2714,7 @@ void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mas
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2757,7 +2757,7 @@ void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -2802,7 +2802,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_gray;
*dest_alpha_scan ++ = src_alpha;
@@ -2813,7 +2813,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
@@ -2825,7 +2825,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -2840,7 +2840,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -2851,11 +2851,11 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
src_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2883,7 +2883,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (src_Bpp == 4) {
FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
@@ -2896,7 +2896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
}
dest_scan[3] = 0xff;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2919,7 +2919,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -2931,7 +2931,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
continue;
}
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2968,7 +2968,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan,
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2990,7 +2990,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan,
inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan)
{
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -3035,7 +3035,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
dest_scan[2] = FX_GAMMA(*src_scan++);
dest_scan[1] = FX_GAMMA(*src_scan++);
@@ -3049,11 +3049,11 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -3078,14 +3078,14 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, F
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
+ uint8_t src_alpha = *clip_scan ++;
if (src_alpha == 0) {
dest_scan += dest_Bpp;
src_scan += src_Bpp;
continue;
}
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -3124,7 +3124,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -3247,7 +3247,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
@@ -3298,7 +3298,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
@@ -3317,7 +3317,7 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
@@ -3327,13 +3327,13 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3378,8 +3378,8 @@ void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3429,19 +3429,19 @@ void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3501,8 +3501,8 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3559,7 +3559,7 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int
mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0];
} else {
if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(mask_red, mask_green, mask_blue, mask_black,
r, g, b);
mask_red = FXRGB2GRAY(r, g, b);
@@ -3600,7 +3600,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (pSrcPalette) {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
pDestPalette = (FX_DWORD*)gray_pal;
for (int i = 0; i < pal_count; i ++) {
FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
@@ -3618,7 +3618,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
}
} else {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3643,12 +3643,12 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (pSrcPalette) {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
pDestPalette = (FX_DWORD*)gray_pal;
if (isSrcCmyk) {
for (int i = 0; i < pal_count; i ++) {
FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
*gray_pal ++ = FXRGB2GRAY(r, g, b);
@@ -3666,7 +3666,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
} else {
for (int i = 0; i < palsize; i ++) {
FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -3676,7 +3676,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
} else {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3700,7 +3700,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (isSrcCmyk != isDstCmyk) {
for (int i = 0; i < palsize; i ++) {
FX_CMYK cmyk = pDestPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -3727,7 +3727,7 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
FX_Free(m_pCacheScanline);
}
}
-FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
+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;
@@ -3861,7 +3861,7 @@ void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCB
} else {
int dest_Size = width * dest_Bpp + 4;
if (dest_Size > m_CacheSize) {
- m_pCacheScanline = FX_Realloc(FX_BYTE, m_pCacheScanline, dest_Size);
+ m_pCacheScanline = FX_Realloc(uint8_t, m_pCacheScanline, dest_Size);
if (!m_pCacheScanline) {
return;
}
@@ -4158,7 +4158,7 @@ FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int
if (width == 0 || height == 0) {
return TRUE;
}
- int src_alpha = (FX_BYTE)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
+ int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
return TRUE;
}
@@ -4214,19 +4214,19 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
if (m_bpp == 8) {
- FX_BYTE gray = 255;
+ uint8_t gray = 255;
if (!IsAlphaMask()) {
if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1);
} else {
if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(color_p[0], color_p[1], color_p[2], color_p[3],
r, g, b);
gray = FXRGB2GRAY(r, g, b);
} else {
- gray = (FX_BYTE)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
+ gray = (uint8_t)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
}
}
if (IsCmykImage()) {
@@ -4245,13 +4245,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
return TRUE;
} else if (m_bpp == 1) {
- ASSERT(!IsCmykImage() && (FX_BYTE)(alpha_flag >> 8) == 0);
+ ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0);
int left_shift = rect.left % 8;
int right_shift = rect.right % 8;
int width = rect.right / 8 - rect.left / 8;
int index = 0;
if (m_pPalette == NULL) {
- index = ((FX_BYTE)color == 0xff) ? 1 : 0;
+ index = ((uint8_t)color == 0xff) ? 1 : 0;
} else {
for (int i = 0; i < 2; i ++)
if (m_pPalette[i] == color) {
@@ -4259,10 +4259,10 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_BYTE* dest_scan_top = (FX_BYTE*)GetScanline(row) + rect.left / 8;
- FX_BYTE* dest_scan_top_r = (FX_BYTE*)GetScanline(row) + rect.right / 8;
- FX_BYTE left_flag = *dest_scan_top & (255 << (8 - left_shift));
- FX_BYTE right_flag = *dest_scan_top_r & (255 >> right_shift);
+ uint8_t* dest_scan_top = (uint8_t*)GetScanline(row) + rect.left / 8;
+ uint8_t* dest_scan_top_r = (uint8_t*)GetScanline(row) + rect.right / 8;
+ uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift));
+ uint8_t right_flag = *dest_scan_top_r & (255 >> right_shift);
if (width) {
FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1);
if (!index) {
@@ -4298,7 +4298,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
}
if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)src_alpha;
+ color_p[3] = (uint8_t)src_alpha;
}
int Bpp = m_bpp / 8;
FX_BOOL bAlpha = HasAlpha();
@@ -4330,13 +4330,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
if (bAlpha) {
if (bArgb) {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], color_p[1], color_p[0]));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[0], alpha_ratio);
dest_scan ++;
@@ -4349,14 +4349,14 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
} else {
FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left;
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_scan_alpha;
+ uint8_t back_alpha = *dest_scan_alpha;
if (back_alpha == 0) {
*dest_scan_alpha++ = src_alpha;
FXSYS_memcpy32(dest_scan, color_p, Bpp);
dest_scan += Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_scan_alpha ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for(int comps = 0; comps < Bpp; comps ++) {
@@ -4437,14 +4437,14 @@ FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_form
return FALSE;
}
if (m_bVertical) {
- m_pScanlineV = FX_Alloc(FX_BYTE, m_pBitmap->GetBPP() / 8 * width + 4);
- m_pClipScanV = FX_Alloc(FX_BYTE, m_pBitmap->GetHeight());
+ m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4);
+ m_pClipScanV = FX_Alloc(uint8_t, m_pBitmap->GetHeight());
if (m_pBitmap->m_pAlphaMask) {
- m_pScanlineAlphaV = FX_Alloc(FX_BYTE, width + 4);
+ m_pScanlineAlphaV = FX_Alloc(uint8_t, width + 4);
}
}
if (m_BitmapAlpha < 255) {
- m_pAddClipScan = FX_Alloc(FX_BYTE, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
+ m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
}
return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index dacc43db64..0f866a7cc7 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -117,7 +117,7 @@ public:
{
return m_aLut;
}
- FX_INT32 Getlut()const
+ int32_t Getlut()const
{
return m_lut;
}
@@ -159,11 +159,11 @@ void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
_Qsort(alut, clut, pI + 1, r);
}
}
-void _ColorDecode(FX_DWORD pal_v, FX_BYTE& r, FX_BYTE& g, FX_BYTE& b)
+void _ColorDecode(FX_DWORD pal_v, uint8_t& r, uint8_t& g, uint8_t& b)
{
- r = (FX_BYTE)((pal_v & 0xf00) >> 4);
- g = (FX_BYTE)(pal_v & 0x0f0);
- b = (FX_BYTE)((pal_v & 0x00f) << 4);
+ r = (uint8_t)((pal_v & 0xf00) >> 4);
+ g = (uint8_t)(pal_v & 0x0f0);
+ b = (uint8_t)((pal_v & 0x00f) << 4);
}
void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type, FX_DWORD* win_mac_pal, FX_DWORD lut)
{
@@ -176,7 +176,7 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type
lut_offset += 256;
}
FX_DWORD color = cLut[lut_offset];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(color, r, g, b);
dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000;
aLut[lut_offset] = row;
@@ -187,15 +187,15 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type
if (lut_offset < 0) {
lut_offset += 256;
}
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(cLut[lut_offset], r, g, b);
int error, min_error = 1000000;
int c_index = 0;
for (col = 0; col < 256; col++) {
FX_DWORD p_color = win_mac_pal[col];
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)p_color;
+ int d_r = r - (uint8_t)(p_color >> 16);
+ int d_g = g - (uint8_t)(p_color >> 8);
+ int d_b = b - (uint8_t)p_color;
error = d_r * d_r + d_g * d_g + d_b * d_b;
if (error < min_error) {
min_error = error;
@@ -252,9 +252,9 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
int row, col;
m_lut = 0;
for (row = 0; row < height; row++) {
- FX_BYTE* scan_line = (FX_BYTE*)pBitmap->GetScanline(row);
+ uint8_t* scan_line = (uint8_t*)pBitmap->GetScanline(row);
for (col = 0; col < width; col++) {
- FX_BYTE* src_port = scan_line + col * bpp;
+ uint8_t* src_port = scan_line + col * bpp;
FX_DWORD b = src_port[0] & 0xf0;
FX_DWORD g = src_port[1] & 0xf0;
FX_DWORD r = src_port[2] & 0xf0;
@@ -282,7 +282,7 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
- FX_BYTE set_gray, reset_gray;
+ uint8_t set_gray, reset_gray;
set_gray = 0xff;
reset_gray = 0x00;
for (int row = 0; row < height; row ++) {
@@ -312,7 +312,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[2];
+ uint8_t gray[2];
if (pIccTransform) {
FX_DWORD plt[2];
if (pSrcBitmap->IsCmykImage()) {
@@ -330,7 +330,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2);
} else {
- FX_BYTE reset_r, reset_g, reset_b,
+ uint8_t reset_r, reset_g, reset_b,
set_r, set_g, set_b;
if (pSrcBitmap->IsCmykImage()) {
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
@@ -365,7 +365,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[256];
+ uint8_t gray[256];
if (pIccTransform) {
FX_DWORD plt[256];
if (pSrcBitmap->IsCmykImage()) {
@@ -384,7 +384,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256);
} else {
if (pSrcBitmap->IsCmykImage()) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
for (int i = 0; i < 256; i ++) {
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
r, g, b);
@@ -433,7 +433,7 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), FXSYS_GetMValue((FX_DWORD)src_scan[1]), FXSYS_GetYValue((FX_DWORD)src_scan[2]), FXSYS_GetKValue((FX_DWORD)src_scan[3]),
r, g, b);
*dest_scan++ = FXRGB2GRAY(r, g, b);
@@ -506,7 +506,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
} else {
if (pSrcBitmap->IsCmykImage()) {
for (int i = 0; i < plt_size; i ++) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
r, g, b);
dst_plt[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -536,14 +536,14 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de
int lut_256 = lut - 256;
for (row = 0; row < lut_256; row++) {
min_err = 1000000;
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(cLut[row], r, g, b);
int clrindex = 0;
for (int col = 0; col < 256; col++) {
FX_DWORD p_color = *(pPalette + col);
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)(p_color);
+ int d_r = r - (uint8_t)(p_color >> 16);
+ int d_g = g - (uint8_t)(p_color >> 8);
+ int d_b = b - (uint8_t)(p_color);
err = d_r * d_r + d_g * d_g + d_b * d_b;
if (err < min_err) {
min_err = err;
@@ -553,19 +553,19 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de
aLut[row] = clrindex;
}
}
- FX_INT32 lut_1 = lut - 1;
+ int32_t lut_1 = lut - 1;
for (row = 0; row < height; row ++) {
- FX_BYTE* src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE* dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
for (col = 0; col < width; col++) {
- FX_BYTE* src_port = src_scan + col * bpp;
+ uint8_t* src_port = src_scan + col * bpp;
int r = src_port[2] & 0xf0;
int g = src_port[1] & 0xf0;
int b = src_port[0] & 0xf0;
FX_DWORD clrindex = (r << 4) + g + (b >> 4);
for (int i = lut_1; i >= 0; i--)
if (clrindex == cLut[i]) {
- *(dest_scan + col) = (FX_BYTE)(aLut[i]);
+ *(dest_scan + col) = (uint8_t)(aLut[i]);
break;
}
}
@@ -592,7 +592,7 @@ FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
- FX_BYTE set_gray, reset_gray;
+ uint8_t set_gray, reset_gray;
set_gray = 0xff;
reset_gray = 0x00;
for (int row = 0; row < height; row ++) {
@@ -620,7 +620,7 @@ FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
for (int row = 0; row < height; row ++) {
FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE src_pixel;
+ uint8_t src_pixel;
for (int col = 0; col < width; col ++) {
src_pixel = *src_scan++;
*dest_scan++ = src_pixel;
@@ -996,7 +996,7 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor
}
int dest_bpp = dest_format & 0xff;
int dest_pitch = (dest_bpp * m_Width + 31) / 32 * 4;
- FX_LPBYTE dest_buf = FX_TryAlloc(FX_BYTE, dest_pitch * m_Height + 4);
+ FX_LPBYTE dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4);
if (dest_buf == NULL) {
return FALSE;
}
@@ -1061,8 +1061,8 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor
}
m_bExtBuf = FALSE;
m_pBuffer = dest_buf;
- m_bpp = (FX_BYTE)dest_format;
- m_AlphaFlag = (FX_BYTE)(dest_format >> 8);
+ m_bpp = (uint8_t)dest_format;
+ m_AlphaFlag = (uint8_t)(dest_format >> 8);
m_Pitch = dest_pitch;
return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index b486def167..f52c30e95a 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -28,7 +28,7 @@ void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, int src_len, i
if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize) {
return;
}
- m_pWeightTables = FX_TryAlloc(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4);
+ m_pWeightTables = FX_TryAlloc(uint8_t, (dest_max - dest_min) * m_ItemSize + 4);
if (m_pWeightTables == NULL) {
return;
}
@@ -202,7 +202,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
}
size += 31;
size = size / 32 * 4;
- m_pDestScanline = FX_TryAlloc(FX_BYTE, size);
+ m_pDestScanline = FX_TryAlloc(uint8_t, size);
if (m_pDestScanline == NULL) {
return;
}
@@ -373,7 +373,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ *dest_scan++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -388,7 +388,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ *dest_scan++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -406,8 +406,8 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_r = dest_r < 0 ? 0 : dest_r > 16711680 ? 16711680 : dest_r;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_r >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan++ = (uint8_t)(dest_r >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
break;
}
@@ -419,13 +419,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
if (m_DestFormat == FXDIB_Rgb) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)argb_cmyk;
} else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8);
}
}
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
@@ -433,9 +433,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
}
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
+ *dest_scan++ = (uint8_t)(dest_b_c >> 16);
+ *dest_scan++ = (uint8_t)(dest_g_m >> 16);
+ *dest_scan++ = (uint8_t)(dest_r_y >> 16);
}
break;
}
@@ -448,13 +448,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
pixel_weight = pixel_weight * src_scan_mask[j] / 255;
unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
if (m_DestFormat == FXDIB_Rgba) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)argb_cmyk;
} else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8);
}
dest_a += pixel_weight;
}
@@ -464,10 +464,10 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan++ = (uint8_t)(dest_b_c >> 16);
+ *dest_scan++ = (uint8_t)(dest_g_m >> 16);
+ *dest_scan++ = (uint8_t)(dest_r_y >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
break;
}
@@ -487,9 +487,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
}
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ *dest_scan++ = (uint8_t)((dest_b_c) >> 16);
+ *dest_scan++ = (uint8_t)((dest_g_m) >> 16);
+ *dest_scan++ = (uint8_t)((dest_r_y) >> 16);
dest_scan += Bpp - 3;
}
break;
@@ -517,14 +517,14 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ *dest_scan++ = (uint8_t)((dest_b_c) >> 16);
+ *dest_scan++ = (uint8_t)((dest_g_m) >> 16);
+ *dest_scan++ = (uint8_t)((dest_r_y) >> 16);
if (m_DestFormat == FXDIB_Argb) {
- *dest_scan = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan = (uint8_t)((dest_a * 255) >> 16);
}
if (dest_scan_mask) {
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
dest_scan += Bpp - 3;
}
@@ -564,7 +564,7 @@ void CStretchEngine::StretchVert()
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan = (FX_BYTE)(dest_a >> 16);
+ *dest_scan = (uint8_t)(dest_a >> 16);
dest_scan += DestBpp;
}
break;
@@ -583,9 +583,9 @@ void CStretchEngine::StretchVert()
dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan = (FX_BYTE)(dest_k >> 16);
+ *dest_scan = (uint8_t)(dest_k >> 16);
dest_scan += DestBpp;
- *dest_sacn_mask++ = (FX_BYTE)(dest_a >> 16);
+ *dest_sacn_mask++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -606,9 +606,9 @@ void CStretchEngine::StretchVert()
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
}
- dest_scan[0] = (FX_BYTE)((dest_b_c) >> 16);
- dest_scan[1] = (FX_BYTE)((dest_g_m) >> 16);
- dest_scan[2] = (FX_BYTE)((dest_r_y) >> 16);
+ dest_scan[0] = (uint8_t)((dest_b_c) >> 16);
+ dest_scan[1] = (uint8_t)((dest_g_m) >> 16);
+ dest_scan[2] = (uint8_t)((dest_r_y) >> 16);
dest_scan += DestBpp;
}
break;
@@ -653,9 +653,9 @@ void CStretchEngine::StretchVert()
dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r;
}
if (m_DestFormat == FXDIB_Argb) {
- dest_scan[3] = (FX_BYTE)((dest_a) >> 16);
+ dest_scan[3] = (uint8_t)((dest_a) >> 16);
} else {
- *dest_sacn_mask = (FX_BYTE)((dest_a) >> 16);
+ *dest_sacn_mask = (uint8_t)((dest_a) >> 16);
}
dest_scan += DestBpp;
if (dest_sacn_mask) {
@@ -795,9 +795,9 @@ FX_BOOL CFX_ImageStretcher::StartQuickStretch()
return FALSE;
}
size *= m_DestBPP;
- m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4);
+ m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4);
if (m_pSource->m_pAlphaMask) {
- m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4);
+ m_pMaskScanline = FX_Alloc(uint8_t, (m_ClipRect.Width() + 3) / 4 * 4);
}
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
ContinueQuickStretch(NULL);
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index f55b2f5737..f02dd6e382 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -62,8 +62,8 @@ CFX_DIBitmap::CFX_DIBitmap()
FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch)
{
m_pBuffer = NULL;
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
+ 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;
@@ -84,12 +84,12 @@ FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBY
int size = pitch * height + 4;
int oomlimit = _MAX_OOM_LIMIT_;
if (oomlimit >= 0 && size >= oomlimit) {
- m_pBuffer = FX_TryAlloc(FX_BYTE, size);
+ m_pBuffer = FX_TryAlloc(uint8_t, size);
if (m_pBuffer == NULL) {
return FALSE;
}
} else {
- m_pBuffer = FX_Alloc(FX_BYTE, size);
+ m_pBuffer = FX_Alloc(uint8_t, size);
}
}
m_Width = width;
@@ -267,14 +267,14 @@ int CFX_DIBSource::FindPalette(FX_DWORD color) const
if (m_pPalette == NULL) {
if (IsCmykImage()) {
if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 0 : 1;
+ return ((uint8_t)color == 0xff) ? 0 : 1;
}
- return 0xff - (FX_BYTE)color;
+ return 0xff - (uint8_t)color;
}
if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 1 : 0;
+ return ((uint8_t)color == 0xff) ? 1 : 0;
}
- return (FX_BYTE)color;
+ return (uint8_t)color;
}
int palsize = (1 << GetBPP());
for (int i = 0; i < palsize; i ++)
@@ -457,7 +457,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h
}
}
if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)alpha;
+ color_p[3] = (uint8_t)alpha;
}
if (GetFormat() == FXDIB_Argb) {
for (int row = 0; row < height; row ++) {
@@ -877,12 +877,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
if (m_pPalette == NULL) {
return FALSE;
}
- FX_BYTE gray[2];
+ uint8_t gray[2];
for (int i = 0; i < 2; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ int r = (uint8_t)(m_pPalette[i] >> 16);
+ int g = (uint8_t)(m_pPalette[i] >> 8);
+ int b = (uint8_t)m_pPalette[i];
+ gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
@@ -908,12 +908,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
if (m_pPalette == NULL) {
return FALSE;
}
- FX_BYTE gray[256];
+ uint8_t gray[256];
for (int i = 0; i < 256; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ int r = (uint8_t)(m_pPalette[i] >> 16);
+ int g = (uint8_t)(m_pPalette[i] >> 8);
+ int b = (uint8_t)m_pPalette[i];
+ gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = new CFX_DIBitmap;
if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
@@ -1090,13 +1090,13 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
}
break;
case FXDIB_8bppMask:
- *pos = (FX_BYTE)(color >> 24);
+ *pos = (uint8_t)(color >> 24);
break;
case FXDIB_8bppRgb: {
if (m_pPalette) {
for (int i = 0; i < 256; i ++) {
if (m_pPalette[i] == color) {
- *pos = (FX_BYTE)i;
+ *pos = (uint8_t)i;
return;
}
}
@@ -1225,7 +1225,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
int size = 1 << m_bpp;
if (isCmykImage) {
for (int i = 0; i < size; i ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(m_pPalette[i]), FXSYS_GetMValue(m_pPalette[i]), FXSYS_GetYValue(m_pPalette[i]), FXSYS_GetKValue(m_pPalette[i]),
r, g, b);
int gray = 255 - FXRGB2GRAY(r, g, b);
@@ -1245,7 +1245,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
for (int row = 0; row < m_Height; row ++) {
FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
r, g, b);
*scanline ++ = 0;
@@ -1274,7 +1274,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
for (int row = 0; row < m_Height; row ++) {
FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
r, g, b);
int gray = 255 - FXRGB2GRAY(r, g, b);
@@ -1314,11 +1314,11 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_
if (pRect) {
rect.Intersect(*pRect);
}
- FX_BYTE translate[256];
+ uint8_t translate[256];
for (int i = 0; i < 256; i ++) {
int err2 = 65536;
for (int j = 0; j < pal_size; j ++) {
- FX_BYTE entry = (FX_BYTE)pPalette[j];
+ uint8_t entry = (uint8_t)pPalette[j];
int err = (int)entry - i;
if (err * err < err2) {
err2 = err * err;
@@ -1332,7 +1332,7 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_
for (int col = rect.left; col < rect.right; col ++) {
int src_pixel = scan[col];
int dest_pixel = translate[src_pixel];
- scan[col] = (FX_BYTE)dest_pixel;
+ scan[col] = (uint8_t)dest_pixel;
int error = -dest_pixel + src_pixel;
if (col < rect.right - 1) {
int src = scan[col + 1];
@@ -1495,11 +1495,11 @@ void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
m_Width = pSrc->GetWidth();
m_Height = pSrc->GetHeight();
FXDIB_Format format = GetDestFormat();
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
+ m_bpp = (uint8_t)format;
+ m_AlphaFlag = (uint8_t)(format >> 8);
m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
m_pPalette = GetDestPalette();
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
+ m_pScanline = FX_Alloc(uint8_t, m_Pitch);
}
FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const
{
@@ -1611,7 +1611,7 @@ FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255) {
if (m_AlphaFlag >> 8) {
- m_AlphaFlag = (((FX_BYTE)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
+ m_AlphaFlag = (((uint8_t)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
} else {
m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha);
}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 4544506e7b..073248823d 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -256,7 +256,7 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineM
m_Status = 3;
return TRUE;
}
-FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
+uint8_t _bilinear_interpol(FX_LPCBYTE 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)
{
@@ -269,23 +269,23 @@ FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
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;
- FX_BYTE r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
- FX_BYTE r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
+ 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;
}
-FX_BYTE _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(FX_LPCBYTE 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;
for (int i = 0; i < 4; i ++) {
int a_result = 0;
for (int j = 0; j < 4; j ++) {
- a_result += u_w[j] * (*(FX_BYTE*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
+ a_result += u_w[j] * (*(uint8_t*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
}
s_result += a_result * v_w[i];
}
s_result >>= 16;
- return (FX_BYTE)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
+ return (uint8_t)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
}
void _bicubic_get_pos_weight(int pos_pixel[], int u_w[], int v_w[], int src_col_l, int src_row_l,
int res_x, int res_y, int stretch_width, int stretch_height)
@@ -384,7 +384,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_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->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);
@@ -413,7 +413,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_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->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);
@@ -435,7 +435,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_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);
@@ -549,7 +549,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (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);
@@ -572,9 +572,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
int row_offset_r = src_row_r * stretch_pitch;
FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -585,7 +585,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (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);
@@ -601,9 +601,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
_bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
FX_DWORD r_bgra_cmyk = argb[_bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -614,7 +614,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (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);
@@ -627,9 +627,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
FX_DWORD r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -644,7 +644,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -665,9 +665,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
int row_offset_l = src_row_l * stretch_pitch;
int row_offset_r = src_row_r * stretch_pitch;
- FX_BYTE r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
+ uint8_t r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
+ uint8_t r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
+ uint8_t r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
if (bHasAlpha) {
if (transformF != FXDIB_Argb) {
if (transformF == FXDIB_Rgba) {
@@ -679,7 +679,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
*(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
}
} else {
- FX_BYTE r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
+ uint8_t r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
*(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
}
} else {
@@ -698,7 +698,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -712,9 +712,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
src_row_l--;
}
_bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- FX_BYTE r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
+ uint8_t r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
+ uint8_t r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
+ uint8_t r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
if (bHasAlpha) {
if (transformF != FXDIB_Argb) {
if (transformF == FXDIB_Rgba) {
@@ -726,7 +726,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
*(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
}
} else {
- FX_BYTE r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
+ uint8_t r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
*(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
}
} else {
@@ -745,7 +745,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_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (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);
diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp
index 755aad565e..dffc98962f 100644
--- a/core/src/fxge/ge/fx_ge.cpp
+++ b/core/src/fxge/ge/fx_ge.cpp
@@ -61,7 +61,7 @@ void CFX_GEModule::SetTextGamma(FX_FLOAT gammaValue)
gammaValue /= 2.2f;
int i = 0;
while (i < 256) {
- m_GammaValue[i] = (FX_BYTE)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f);
+ m_GammaValue[i] = (uint8_t)(FXSYS_pow((FX_FLOAT)i / 255, gammaValue) * 255.0f + 0.5f);
i++;
}
}
diff --git a/core/src/fxge/ge/fx_ge_device.cpp b/core/src/fxge/ge/fx_ge_device.cpp
index 9c268b5606..0b4ffd5f4c 100644
--- a/core/src/fxge/ge/fx_ge_device.cpp
+++ b/core/src/fxge/ge/fx_ge_device.cpp
@@ -125,7 +125,7 @@ FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
FX_DWORD fill_color, FX_DWORD stroke_color, int fill_mode,
int alpha_flag, void* pIccTransform, int blend_type)
{
- FX_BYTE fill_alpha, stroke_alpha;
+ uint8_t fill_alpha, stroke_alpha;
if (FXGETFLAG_COLORTYPE(alpha_flag)) {
fill_alpha = FXGETFLAG_ALPHA_FILL(alpha_flag);
stroke_alpha = FXGETFLAG_ALPHA_STROKE(alpha_flag);
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 1896218cbf..8928d25d4c 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -103,7 +103,7 @@ extern "C" {
};
FX_BOOL _LoadFile(FXFT_Library library, FXFT_Face* Face, IFX_FileRead* pFile, FXFT_Stream* stream)
{
- FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(FX_BYTE, sizeof (FXFT_StreamRec));
+ FXFT_Stream stream1 = (FXFT_Stream)FX_Alloc(uint8_t, sizeof (FXFT_StreamRec));
stream1->base = NULL;
stream1->size = (unsigned long)pFile->GetSize();
stream1->pos = 0;
@@ -173,7 +173,7 @@ static FXFT_Face FT_LoadFont(FX_LPBYTE pData, int size)
}
FX_BOOL CFX_Font::LoadEmbedded(FX_LPCBYTE data, FX_DWORD size)
{
- m_pFontDataAllocation = FX_Alloc(FX_BYTE, size);
+ m_pFontDataAllocation = FX_Alloc(uint8_t, size);
FXSYS_memcpy32(m_pFontDataAllocation, data, size);
m_Face = FT_LoadFont((FX_LPBYTE)m_pFontDataAllocation, size);
m_pFontData = (FX_LPBYTE)m_pFontDataAllocation;
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index c1ea5906ff..9bb53c638f 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -565,7 +565,7 @@ CFX_ByteString CFX_FontMapper::GetPSNameFromTT(void* hFont)
CFX_ByteString result;
FX_DWORD size = m_pFontInfo->GetFontData(hFont, 0x6e616d65, NULL, 0);
if (size) {
- FX_LPBYTE buffer = FX_Alloc(FX_BYTE, size);
+ FX_LPBYTE buffer = FX_Alloc(uint8_t, size);
m_pFontInfo->GetFontData(hFont, 0x6e616d65, buffer, size);
result = _FPDF_GetNameFromTT(buffer, 6);
FX_Free(buffer);
@@ -644,7 +644,7 @@ CFX_ByteString CFX_FontMapper::MatchInstalledFonts(const CFX_ByteString& norm_na
return match;
}
typedef struct _CHARSET_MAP_ {
- FX_BYTE charset;
+ uint8_t charset;
FX_WORD codepage;
} CHARSET_MAP;
static const CHARSET_MAP g_Codepage2CharsetTable[] = {
@@ -680,11 +680,11 @@ static const CHARSET_MAP g_Codepage2CharsetTable[] = {
{ 88, 10029 },
{ 89, 10007 },
};
-FX_BYTE _GetCharsetFromCodePage(FX_WORD codepage)
+uint8_t _GetCharsetFromCodePage(FX_WORD codepage)
{
- FX_INT32 iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1;
+ int32_t iEnd = sizeof(g_Codepage2CharsetTable) / sizeof(CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const CHARSET_MAP & cp = g_Codepage2CharsetTable[iMid];
@@ -824,7 +824,7 @@ static CFX_ByteString _GetFontFamily(CFX_ByteString fontName, int nStyle)
};
typedef struct _FX_FontStyle {
FX_LPCSTR style;
- FX_INT32 len;
+ int32_t len;
} FX_FontStyle;
const FX_FontStyle g_FontStyles[] = {
{ "Bold", 4 },
@@ -848,9 +848,9 @@ CFX_ByteString ParseStyle(FX_LPCSTR pStyle, int iLen, int iIndex)
}
return buf.GetByteString();
}
-FX_INT32 GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
+int32_t GetStyleType(const CFX_ByteString &bsStyle, FX_BOOL bRevert)
{
- FX_INT32 iLen = bsStyle.GetLength();
+ int32_t iLen = bsStyle.GetLength();
if (!iLen) {
return -1;
}
@@ -968,7 +968,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
if (!bHasHypen) {
int nLen = family.GetLength();
- FX_INT32 nRet = GetStyleType(family, TRUE);
+ int32_t nRet = GetStyleType(family, TRUE);
if (nRet > -1) {
family = family.Left(nLen - g_FontStyles[nRet].len);
if (nRet == 0) {
@@ -1000,7 +1000,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
CFX_ByteString buf;
while (i < nLen) {
buf = ParseStyle(pStyle, nLen, i);
- FX_INT32 nRet = GetStyleType(buf, FALSE);
+ int32_t nRet = GetStyleType(buf, FALSE);
if ((i && !bStyleAvail) || (!i && nRet < 0)) {
family = SubstName;
iBaseFont = 12;
@@ -1198,7 +1198,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
}
FXFT_Face face = NULL;
if (ttc_size) {
- FX_BYTE temp[1024];
+ uint8_t temp[1024];
m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024);
FX_DWORD checksum = 0;
for (int i = 0; i < 256; i ++) {
@@ -1207,7 +1207,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
FX_LPBYTE pFontData;
face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum, ttc_size - font_size, pFontData);
if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, ttc_size);
+ pFontData = FX_Alloc(uint8_t, ttc_size);
m_pFontInfo->GetFontData(hFont, 0x74746366, pFontData, ttc_size);
face = m_pFontMgr->AddCachedTTCFace(ttc_size, checksum, pFontData, ttc_size,
ttc_size - font_size);
@@ -1216,7 +1216,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name, FX_BOOL bTru
FX_LPBYTE pFontData;
face = m_pFontMgr->GetCachedFace(SubstName, weight, bItalic, pFontData);
if (face == NULL) {
- pFontData = FX_Alloc(FX_BYTE, font_size);
+ pFontData = FX_Alloc(uint8_t, font_size);
m_pFontInfo->GetFontData(hFont, 0, pFontData, font_size);
face = m_pFontMgr->AddCachedFace(SubstName, weight, bItalic, pFontData, font_size, m_pFontInfo->GetFaceIndex(hFont));
}
@@ -1357,7 +1357,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
}
FXSYS_fseek(pFile, 0, FXSYS_SEEK_END);
FX_DWORD filesize = FXSYS_ftell(pFile);
- FX_BYTE buffer[16];
+ uint8_t buffer[16];
FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET);
size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile);
if (readCnt != 1) {
@@ -1372,7 +1372,7 @@ void CFX_FolderFontInfo::ScanFile(CFX_ByteString& path)
return;
}
FX_DWORD face_bytes = nFaces * 4;
- FX_LPBYTE offsets = FX_Alloc(FX_BYTE, face_bytes);
+ FX_LPBYTE offsets = FX_Alloc(uint8_t, face_bytes);
readCnt = FXSYS_fread(offsets, face_bytes, 1, pFile);
if (readCnt != face_bytes) {
FX_Free(offsets);
diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp
index b9cfc8ef54..e2ed84e081 100644
--- a/core/src/fxge/ge/fx_ge_linux.cpp
+++ b/core/src/fxge/ge/fx_ge_linux.cpp
@@ -56,7 +56,7 @@ static const FX_LPCSTR g_LinuxB5FontList[] = {
static const FX_LPCSTR g_LinuxHGFontList[] = {
"UnDotum",
};
-static FX_INT32 GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
+static int32_t GetJapanesePreference(FX_LPCSTR facearr, int weight, int picth_family)
{
CFX_ByteString face = facearr;
if (face.Find("Gothic") >= 0 || face.Find("\x83\x53\x83\x56\x83\x62\x83\x4e") >= 0) {
@@ -94,35 +94,35 @@ void* CFX_LinuxFontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int p
FX_BOOL bCJK = TRUE;
switch (charset) {
case FXFONT_SHIFTJIS_CHARSET: {
- FX_INT32 index = GetJapanesePreference(cstr_face, weight, pitch_family);
+ int32_t index = GetJapanesePreference(cstr_face, weight, pitch_family);
if (index < 0) {
break;
}
- for (FX_INT32 i = 0; i < LINUX_GPNAMESIZE; i++)
+ for (int32_t i = 0; i < LINUX_GPNAMESIZE; i++)
if (m_FontList.Lookup(LinuxGpFontList[index].NameArr[i], p)) {
return p;
}
}
break;
case FXFONT_GB2312_CHARSET: {
- static FX_INT32 s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_gbCount; i++)
+ static int32_t s_gbCount = sizeof(g_LinuxGbFontList) / sizeof(FX_LPCSTR);
+ for (int32_t i = 0; i < s_gbCount; i++)
if (m_FontList.Lookup(g_LinuxGbFontList[i], p)) {
return p;
}
}
break;
case FXFONT_CHINESEBIG5_CHARSET: {
- static FX_INT32 s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_b5Count; i++)
+ static int32_t s_b5Count = sizeof(g_LinuxB5FontList) / sizeof(FX_LPCSTR);
+ for (int32_t i = 0; i < s_b5Count; i++)
if (m_FontList.Lookup(g_LinuxB5FontList[i], p)) {
return p;
}
}
break;
case FXFONT_HANGEUL_CHARSET: {
- static FX_INT32 s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
- for (FX_INT32 i = 0; i < s_hgCount; i++)
+ static int32_t s_hgCount = sizeof(g_LinuxHGFontList) / sizeof(FX_LPCSTR);
+ for (int32_t i = 0; i < s_hgCount; i++)
if (m_FontList.Lookup(g_LinuxHGFontList[i], p)) {
return p;
}
@@ -157,9 +157,9 @@ static FX_DWORD _LinuxGetCharset(int charset)
}
return 0;
}
-static FX_INT32 _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
+static int32_t _LinuxGetSimilarValue(int weight, FX_BOOL bItalic, int pitch_family, FX_DWORD style)
{
- FX_INT32 iSimilarValue = 0;
+ int32_t iSimilarValue = 0;
if ((style & FXFONT_BOLD) == (weight > 400)) {
iSimilarValue += 16;
}
@@ -181,7 +181,7 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int
{
CFontFaceInfo* pFind = NULL;
FX_DWORD charset_flag = _LinuxGetCharset(charset);
- FX_INT32 iBestSimilar = 0;
+ int32_t iBestSimilar = 0;
FX_POSITION pos = m_FontList.GetStartPosition();
while (pos) {
CFX_ByteString bsName;
@@ -190,8 +190,8 @@ void* CFX_LinuxFontInfo::FindFont(int weight, FX_BOOL bItalic, int charset, int
if (!(pFont->m_Charsets & charset_flag) && charset != FXFONT_DEFAULT_CHARSET) {
continue;
}
- FX_INT32 iSimilarValue = 0;
- FX_INT32 index = bsName.Find(family);
+ int32_t iSimilarValue = 0;
+ int32_t index = bsName.Find(family);
if (bMatchName && index < 0) {
continue;
}
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index e81b6bf362..1829386755 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -93,7 +93,7 @@ void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData, const CFX_AffineM
CFX_ByteTextBuf buf;
buf.EstimateSize(nPoints * 10);
for (int i = 0; i < nPoints; i ++) {
- FX_BYTE flag = pPathData->GetFlag(i);
+ uint8_t flag = pPathData->GetFlag(i);
FX_FLOAT x = pPathData->GetPointX(i);
FX_FLOAT y = pPathData->GetPointY(i);
if (pObject2Device) {
@@ -348,7 +348,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
if (pSource->GetBPP() == 1 && pSource->GetPalette() == NULL) {
int pitch = (width + 7) / 8;
FX_DWORD src_size = height * pitch;
- FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
+ FX_LPBYTE src_buf = FX_Alloc(uint8_t, src_size);
for (int row = 0; row < height; row ++) {
FX_LPCBYTE src_scan = pSource->GetScanline(row);
FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch);
@@ -421,7 +421,7 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
if (filter == NULL) {
int src_pitch = width * Bpp;
output_size = height * src_pitch;
- output_buf = FX_Alloc(FX_BYTE, output_size);
+ output_buf = FX_Alloc(uint8_t, output_size);
for (int row = 0; row < height; row ++) {
FX_LPCBYTE src_scan = pConverted->GetScanline(row);
FX_LPBYTE dest_scan = output_buf + row * src_pitch;
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index f6d2fa510f..0d9e985a8e 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -78,7 +78,7 @@ static void _AdjustGlyphSpace(FXTEXT_GLYPHPOS* pGlyphAndPos, int nChars)
next_origin_f = this_origin_f;
}
}
-static const FX_BYTE g_TextGammaAdjust[256] = {
+static const uint8_t g_TextGammaAdjust[256] = {
0, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 19,
21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55,
@@ -97,7 +97,7 @@ static const FX_BYTE g_TextGammaAdjust[256] = {
241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 250, 251, 252, 253, 254, 255,
};
#define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \
- src_alpha = g_TextGammaAdjust[(FX_BYTE)src_alpha];
+ src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha];
void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransform)
{
if (pIccTransform == NULL && !FXGETFLAG_COLORTYPE(alpha_flag)) {
@@ -107,7 +107,7 @@ void _Color2Argb(FX_ARGB& argb, FX_DWORD color, int alpha_flag, void* pIccTransf
if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
pIccTransform = NULL;
}
- FX_BYTE bgra[4];
+ uint8_t bgra[4];
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
color = FXGETFLAG_COLORTYPE(alpha_flag) ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -445,7 +445,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
int src_alpha1 = (src_scan[0] + src_scan[1] + src_scan[2]) / 3;
ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
dest_scan += 4;
@@ -457,7 +457,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
src_scan += 3;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1 * 255 / dest_alpha;
dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
@@ -492,11 +492,11 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
dest_scan += 4;
src_scan += 3;
} else {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
} else {
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1 * 255 / dest_alpha;
dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
@@ -530,7 +530,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
int src_alpha1 = (src_scan[-1] + src_scan[0] + src_scan[1]) / 3;
ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
dest_scan += 4;
@@ -542,7 +542,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
src_scan += 3;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1 * 255 / dest_alpha;
dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
@@ -577,11 +577,11 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
dest_scan += 4;
src_scan += 3;
} else {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
} else {
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1 * 255 / dest_alpha;
dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
@@ -615,7 +615,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
int src_alpha1 = (src_scan[-2] + src_scan[-1] + src_scan[0]) / 3;
ADJUST_ALPHA(dest_scan[2], r, src_alpha1, nativetext_flags, a);
src_alpha1 = src_alpha1 * a / 255;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha1, r, g, b));
dest_scan += 4;
@@ -627,7 +627,7 @@ FX_BOOL CFX_RenderDevice::DrawNormalText(int nChars, const FXTEXT_CHARPOS* pChar
src_scan += 3;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha1 - back_alpha * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1 * 255 / dest_alpha;
dest_scan[2] = FX_GAMMA_INVERSE(FXDIB_ALPHA_MERGE(FX_GAMMA(dest_scan[2]), r, alpha_ratio));
@@ -1071,14 +1071,14 @@ CFX_GlyphBitmap* CFX_FaceCache::LookUpGlyphBitmap(CFX_Font* pFont, const CFX_Aff
m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
}
CFX_GlyphBitmap* pGlyphBitmap = NULL;
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
+ if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
return pGlyphBitmap;
}
pGlyphBitmap = RenderGlyph(pFont, glyph_index, bFontStyle, pMatrix, dest_width, anti_alias);
if (pGlyphBitmap == NULL) {
return NULL;
}
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD glyph_index, FX_BOOL bFontStyle, const CFX_AffineMatrix* pMatrix,
@@ -1125,12 +1125,12 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
CFX_GlyphBitmap* pGlyphBitmap;
CFX_SizeGlyphCache* pSizeCache = NULL;
if (m_SizeMap.Lookup(FaceGlyphsKey, (void*&)pSizeCache)) {
- if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(FX_UINTPTR)glyph_index, (void*&)pGlyphBitmap)) {
+ if (pSizeCache->m_GlyphMap.Lookup((FX_LPVOID)(uintptr_t)glyph_index, (void*&)pGlyphBitmap)) {
return pGlyphBitmap;
}
pGlyphBitmap = RenderGlyph_Nativetext(pFont, glyph_index, pMatrix, dest_width, anti_alias);
if (pGlyphBitmap) {
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
} else {
@@ -1138,7 +1138,7 @@ const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont, FX_DWORD
if (pGlyphBitmap) {
pSizeCache = new CFX_SizeGlyphCache;
m_SizeMap.SetAt(FaceGlyphsKey, pSizeCache);
- pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(FX_UINTPTR)glyph_index, pGlyphBitmap);
+ pSizeCache->m_GlyphMap.SetAt((FX_LPVOID)(uintptr_t)glyph_index, pGlyphBitmap);
return pGlyphBitmap;
}
}
@@ -1209,7 +1209,7 @@ static const char g_AngleSkew[ANGLESKEW_ARRAY_SIZE] = {
36, 38, 40, 42, 45, 47, 49, 51, 53, 55,
};
static const size_t WEIGHTPOW_ARRAY_SIZE = 100;
-static const FX_BYTE g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = {
+static const uint8_t g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = {
0, 3, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 35, 36, 36,
37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, 42,
@@ -1217,7 +1217,7 @@ static const FX_BYTE g_WeightPow[WEIGHTPOW_ARRAY_SIZE] = {
47, 47, 48, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51,
51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53,
};
-static const FX_BYTE g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = {
+static const uint8_t g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = {
0, 4, 7, 8, 9, 10, 12, 13, 15, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 39, 40, 40,
41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 46,
@@ -1225,7 +1225,7 @@ static const FX_BYTE g_WeightPow_11[WEIGHTPOW_ARRAY_SIZE] = {
52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56,
56, 56, 56, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58,
};
-static const FX_BYTE g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE] = {
+static const uint8_t g_WeightPow_SHIFTJIS[WEIGHTPOW_ARRAY_SIZE] = {
0, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 26, 28,
30, 32, 33, 35, 37, 39, 41, 43, 45, 48, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50,
51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 55, 55,
@@ -1275,7 +1275,7 @@ static void _ContrastAdjust(FX_LPBYTE pDataIn, FX_LPBYTE pDataOut, int nWid, int
} else if (temp < 0) {
temp = 0;
}
- *pDstRow ++ = (FX_BYTE)temp;
+ *pDstRow ++ = (uint8_t)temp;
}
}
}
@@ -1365,13 +1365,13 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde
pGlyphBitmap->m_Top = FXFT_Get_Glyph_BitmapTop(m_Face);
int dest_pitch = pGlyphBitmap->m_Bitmap.GetPitch();
int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(m_Face));
- FX_BYTE* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer();
- FX_BYTE* pSrcBuf = (FX_BYTE*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face));
+ uint8_t* pDestBuf = pGlyphBitmap->m_Bitmap.GetBuffer();
+ uint8_t* pSrcBuf = (uint8_t*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(m_Face));
if (anti_alias != FXFT_RENDER_MODE_MONO && FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) == FXFT_PIXEL_MODE_MONO) {
int bytes = anti_alias == FXFT_RENDER_MODE_LCD ? 3 : 1;
for(int i = 0; i < bmheight; i++)
for(int n = 0; n < bmwidth; n++) {
- FX_BYTE data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0;
+ uint8_t data = (pSrcBuf[i * src_pitch + n / 8] & (0x80 >> (n % 8))) ? 255 : 0;
for (int b = 0; b < bytes; b ++) {
pDestBuf[i * dest_pitch + n * bytes + b] = data;
}
@@ -1485,11 +1485,11 @@ const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph
CFX_PathData* pGlyphPath = NULL;
FX_LPVOID key;
if (pFont->GetSubstFont())
- key = (FX_LPVOID)(FX_UINTPTR)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
+ key = (FX_LPVOID)(uintptr_t)(glyph_index + ((pFont->GetSubstFont()->m_Weight / 16) << 15) +
((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) + ((dest_width / 16) << 25) +
(pFont->IsVertical() << 31));
else {
- key = (FX_LPVOID)(FX_UINTPTR)glyph_index;
+ key = (FX_LPVOID)(uintptr_t)glyph_index;
}
if (m_PathMap.Lookup(key, (FX_LPVOID&)pGlyphPath)) {
return pGlyphPath;
diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h
index 34496e8b13..32e1cd53f7 100644
--- a/core/src/fxge/ge/text_int.h
+++ b/core/src/fxge/ge/text_int.h
@@ -44,7 +44,7 @@ public:
FXFT_Face m_pFaces[16];
} m_TTCFace;
};
- FX_BYTE* m_pFontData;
+ uint8_t* m_pFontData;
int m_RefCount;
};
class CFX_UnicodeEncoding : public IFX_FontEncoding
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp
index a107485d72..3b3bd3349c 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.cpp
+++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp
@@ -74,13 +74,13 @@
}
/*---------------------------------------------------------------------------------------------------*/
void CFX_SkiaRenderer::CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_bRgbByteOrder);
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left/8;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left/8;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -88,7 +88,7 @@
int index = 0;
if (m_pDevice->GetPalette() == NULL)
- index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0;
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
else {
for (int i = 0; i < 2; i ++)
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color)
@@ -107,14 +107,14 @@
}
}
void CFX_SkiaRenderer::CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_bRgbByteOrder);
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left/8;
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left/8;
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -122,7 +122,7 @@
int index = 0;
if (m_pDevice->GetPalette() == NULL)
- index = ((FX_BYTE)m_Color == 0xff) ? 1 : 0;
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
else {
for (int i = 0; i < 2; i ++)
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color)
@@ -143,13 +143,13 @@
}
/*-----------------------------------------------------------------------------------------------------*/
void CFX_SkiaRenderer::CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
ASSERT(!m_bRgbByteOrder);
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -165,14 +165,14 @@
}
}
void CFX_SkiaRenderer::CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
ASSERT(!m_bRgbByteOrder);
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left;
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left;
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -208,13 +208,13 @@
}
void CFX_SkiaRenderer::CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_bRgbByteOrder);
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left;
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left;
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -236,14 +236,14 @@
}
void CFX_SkiaRenderer::CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left;
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left;
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left;
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left;
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -296,11 +296,11 @@
/*--------------------------------------------------------------------------------------------------*/
void CFX_SkiaRenderer::CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -331,7 +331,7 @@
dest_scan += 2;
continue;
}
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio);
@@ -344,13 +344,13 @@
}
void CFX_SkiaRenderer::CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- //ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -393,12 +393,12 @@
}
}
void CFX_SkiaRenderer::CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -425,7 +425,7 @@
dest_scan += 2;
continue;
}
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1*255/dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio);
@@ -459,7 +459,7 @@
dest_scan += 2;
continue;
}
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio);
@@ -492,7 +492,7 @@
dest_scan += 2;
continue;
}
- FX_BYTE dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255;
+ uint8_t dest_alpha = dest_scan[3] + src_alpha1 - dest_scan[3] * src_alpha1 / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha1*255/dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, m_Blue, alpha_ratio);
@@ -508,14 +508,14 @@
}
void CFX_SkiaRenderer::CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- //ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ //ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -558,11 +558,11 @@
/*-----------------------------------------------------------------------------------------------------------*/
void CFX_SkiaRenderer::CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -589,12 +589,12 @@
}
}
void CFX_SkiaRenderer::CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -628,12 +628,12 @@
}
}
void CFX_SkiaRenderer::CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -706,14 +706,14 @@
#endif
}
void CFX_SkiaRenderer::CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + (span_left<<2);
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + (span_left<<2);
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + (span_left<<2);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -785,11 +785,11 @@
}
/*-----------------------------------------------------------------------------------------------------*/
void CFX_SkiaRenderer::CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -819,13 +819,13 @@
}
}
void CFX_SkiaRenderer::CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1);
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left + (span_left<<1);
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left + (span_left<<1);
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left + (span_left<<1);
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -860,12 +860,12 @@
}
}
void CFX_SkiaRenderer::CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -940,14 +940,14 @@
#endif
}
void CFX_SkiaRenderer::CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
ASSERT(!m_pDevice->IsCmykImage());
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
- ori_scan = (FX_BYTE*)m_pOriDevice->GetScanline(span_top) + span_left+(span_left<<1);
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
+ ori_scan = (uint8_t*)m_pOriDevice->GetScanline(span_top) + span_left+(span_left<<1);
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -1018,12 +1018,12 @@
#endif
}
void CFX_SkiaRenderer::CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
- dest_extra_alpha_scan = (FX_BYTE*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
+ dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -1031,9 +1031,9 @@
#if 1
if (m_Alpha == 255 && cover_scan == 255) {
for (int col = col_start; col < col_end; col ++) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
*dest_extra_alpha_scan++ = 255;
}
return;
@@ -1042,7 +1042,7 @@
for (int col = col_start; col < col_end; col ++) {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
@@ -1057,9 +1057,9 @@
if (m_bFullCover) {
if (m_Alpha == 255) {
for (int col = col_start; col < col_end; col ++) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
*dest_extra_alpha_scan++ = 255;
}
return;
@@ -1067,7 +1067,7 @@
for (int col = col_start; col < col_end; col ++) {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + m_Alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + m_Alpha -
(*dest_extra_alpha_scan) * m_Alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = m_Alpha*255/dest_alpha;
@@ -1081,9 +1081,9 @@
} else {
if (m_Alpha == 255 && cover_scan == 255) {
for (int col = col_start; col < col_end; col ++) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
*dest_extra_alpha_scan++ = 255;
}
return;
@@ -1092,7 +1092,7 @@
for (int col = col_start; col < col_end; col ++) {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
@@ -1107,13 +1107,13 @@
#endif
}
void CFX_SkiaRenderer::CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
- dest_scan = (FX_BYTE*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
- dest_extra_alpha_scan = (FX_BYTE*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left;
- clip_scan = (FX_BYTE*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
+ dest_scan = (uint8_t*)m_pDevice->GetScanline(span_top) + span_left+(span_left<<1);
+ dest_extra_alpha_scan = (uint8_t*)m_pDevice->m_pAlphaMask->GetScanline(span_top)+span_left;
+ clip_scan = (uint8_t*)m_pClipMask->GetScanline(span_top-clip_top) - clip_left + span_left;
int col_start = span_left < clip_left ? clip_left - span_left : 0;
int col_end = (span_left + span_len) < clip_right ? span_len : (clip_right - span_left);
if (col_end < col_start) return; // do nothing.
@@ -1128,14 +1128,14 @@
continue;
}
if (src_alpha1 == 255) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
- *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
+ *dest_extra_alpha_scan++ = (uint8_t)m_Alpha;
} else {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 -
(*dest_extra_alpha_scan) * src_alpha1 / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha1*255/dest_alpha;
@@ -1157,14 +1157,14 @@
continue;
}
if (src_alpha == 255) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
- *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
+ *dest_extra_alpha_scan++ = (uint8_t)m_Alpha;
} else {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
@@ -1186,14 +1186,14 @@
continue;
}
if (src_alpha1 == 255) {
- *dest_scan++ = (FX_BYTE)m_Blue;
- *dest_scan++ = (FX_BYTE)m_Green;
- *dest_scan++ = (FX_BYTE)m_Red;
- *dest_extra_alpha_scan++ = (FX_BYTE)m_Alpha;
+ *dest_scan++ = (uint8_t)m_Blue;
+ *dest_scan++ = (uint8_t)m_Green;
+ *dest_scan++ = (uint8_t)m_Red;
+ *dest_extra_alpha_scan++ = (uint8_t)m_Alpha;
} else {
// Dest format: Rgba
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha1 -
(*dest_extra_alpha_scan) * src_alpha1 / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha1*255/dest_alpha;
@@ -1212,7 +1212,7 @@
// A general alpha merge function (with clipping mask). Cmyka/Cmyk device.
void CFX_SkiaRenderer::CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan)
{
@@ -1243,11 +1243,11 @@
if (src_alpha) {
if (src_alpha == 255) {
*(FX_CMYK*)dest_scan = m_Color;
- *dest_extra_alpha_scan = (FX_BYTE)m_Alpha;
+ *dest_extra_alpha_scan = (uint8_t)m_Alpha;
} else {
// Dest format: Cmyka
// calculate destination alpha (it's union of source and dest alpha)
- FX_BYTE dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
+ uint8_t dest_alpha = (*dest_extra_alpha_scan) + src_alpha -
(*dest_extra_alpha_scan) * src_alpha / 255;
*dest_extra_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha*255/dest_alpha;
@@ -1351,13 +1351,13 @@
} else {
//Gray(a) device
if (pIccTransform) {
- FX_BYTE gray;
+ uint8_t gray;
color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, &gray, (FX_LPCBYTE)&color, 1);
m_Gray = gray;
} else {
if (bObjectCMYK) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
r, g, b);
m_Gray = FXRGB2GRAY(r, g, b);
@@ -1404,7 +1404,7 @@
}
} else {
if (bObjectCMYK) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(color), FXSYS_GetMValue(color), FXSYS_GetYValue(color), FXSYS_GetKValue(color),
r, g, b);
m_Color = FXARGB_MAKE(m_Alpha, r, g, b);
@@ -1552,7 +1552,7 @@
col_end = col_end < m_dstWidth ? col_end - m_Left: m_pDevice->GetWidth();
int result = col_end - col_start;
if (result > 0) {
- FX_BYTE* dest_pos = dest_scan + col_start;
+ uint8_t* dest_pos = dest_scan + col_start;
if (result >= 4)
FXSYS_memset32(dest_pos, 0xffffffff,result);
else
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.h b/core/src/fxge/skia/fx_skia_blitter_new.h
index 1193e64c1c..a80e56b2aa 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.h
+++ b/core/src/fxge/skia/fx_skia_blitter_new.h
@@ -30,7 +30,7 @@ protected:
FX_LPBYTE m_pOriScan;
FX_LPBYTE m_pClipScan;
- void (CFX_SkiaRenderer::*composite_span)(FX_LPBYTE,FX_LPBYTE,int,int,int,int,FX_BYTE,int,int,int,FX_LPBYTE,FX_LPBYTE);
+ void (CFX_SkiaRenderer::*composite_span)(FX_LPBYTE,FX_LPBYTE,int,int,int,int,uint8_t,int,int,int,FX_LPBYTE,FX_LPBYTE);
public:
//--------------------------------------------------------------------
@@ -43,35 +43,35 @@ public:
/*------------------------------------------------------------------------------------------------------*/
// A general alpha merge function (with clipping mask). Gray device.
void CompositeSpan1bpp_0(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_1(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_4(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_5(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_8(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_9(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_12(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpan1bpp_13(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
@@ -79,119 +79,119 @@ public:
// A general alpha merge function (with clipping mask). Gray device.
void CompositeSpanGray_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanGray_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
/*--------------------------------------------------------------------------------------------------------*/
void CompositeSpanARGB_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanARGB_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanARGB_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanARGB_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
// ...
/*--------------------------------------------------------------------------------------------------------*/
void CompositeSpanRGB32_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB32_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB32_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB32_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
/*---------------------------------------------------------------------------------------------------------*/
void CompositeSpanRGB24_2(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_3(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_6(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_7(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_10(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_11(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_14(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
void CompositeSpanRGB24_15(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
@@ -199,7 +199,7 @@ public:
// A general alpha merge function (with clipping mask). Cmyka/Cmyk device.
void CompositeSpanCMYK(FX_LPBYTE dest_scan, FX_LPBYTE ori_scan,int Bpp,
- int span_left, int span_len, int span_top, FX_BYTE cover_scan,
+ int span_left, int span_len, int span_top, uint8_t cover_scan,
int clip_top, int clip_left, int clip_right, FX_LPBYTE clip_scan,
FX_LPBYTE dest_extra_alpha_scan);
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 4bef988885..d2d83dea75 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -64,9 +64,9 @@ FX_BOOL CWin32FontInfo::IsOpenTypeFromDiv(const LOGFONTA *plf)
FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
FX_DWORD lVersion = 0;
- GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
- lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
- ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
+ GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD));
+ lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 |
+ ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24));
if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
lVersion == 0x00010000 ||
lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
@@ -85,9 +85,9 @@ FX_BOOL CWin32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf)
FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
FX_DWORD lVersion = 0;
- GetFontData(hFont, 0, (FX_BYTE*)(&lVersion), sizeof(FX_DWORD));
- lVersion = (((FX_DWORD)(FX_BYTE)(lVersion)) << 24) | ((FX_DWORD)((FX_BYTE)(lVersion >> 8))) << 16 |
- ((FX_DWORD)((FX_BYTE)(lVersion >> 16))) << 8 | ((FX_BYTE)(lVersion >> 24));
+ GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD));
+ lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) | ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 |
+ ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 | ((uint8_t)(lVersion >> 24));
if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') ||
lVersion == 0x00010000 ||
lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
@@ -145,7 +145,7 @@ FX_BOOL CWin32FontInfo::EnumFontList(CFX_FontMapper* pMapper)
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfFaceName[0] = 0;
lf.lfPitchAndFamily = 0;
- EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (FX_UINTPTR)this, 0);
+ EnumFontFamiliesExA(m_hDC, &lf, (FONTENUMPROCA)FontEnumProc, (uintptr_t)this, 0);
if (pMapper->GetFontEnumerator()) {
pMapper->GetFontEnumerator()->Finish();
}
@@ -518,7 +518,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de
return FALSE;
}
CFX_ByteString info = CFX_WindowsDIB::GetBitmapInfo(pBitmap);
- if ((FX_INT64)abs(dest_width) * abs(dest_height) < (FX_INT64)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
+ if ((int64_t)abs(dest_width) * abs(dest_height) < (int64_t)pBitmap1->GetWidth() * pBitmap1->GetHeight() * 4 ||
(flags & FXDIB_INTERPOL) || (flags & FXDIB_BICUBIC_INTERPOL)) {
SetStretchBltMode(m_hDC, HALFTONE);
} else {
@@ -526,7 +526,7 @@ FX_BOOL CGdiDeviceDriver::GDI_StretchDIBits(const CFX_DIBitmap* pBitmap1, int de
}
CFX_DIBitmap* pToStrechBitmap = pBitmap;
bool del = false;
- if (m_DeviceClass == FXDC_PRINTER && ((FX_INT64)pBitmap->GetWidth() * pBitmap->GetHeight() > (FX_INT64)abs(dest_width) * abs(dest_height))) {
+ if (m_DeviceClass == FXDC_PRINTER && ((int64_t)pBitmap->GetWidth() * pBitmap->GetHeight() > (int64_t)abs(dest_width) * abs(dest_height))) {
pToStrechBitmap = pBitmap->StretchTo(dest_width, dest_height);
del = true;
}
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index 47da880680..659e602e1a 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -68,7 +68,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL
}
FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height);
if (bBottomUp) {
- FX_LPBYTE temp_buf = FX_Alloc(FX_BYTE, pitch);
+ FX_LPBYTE temp_buf = FX_Alloc(uint8_t, pitch);
int top = 0, bottom = height - 1;
while (top < bottom) {
FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch);
@@ -196,7 +196,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP
if (bmih.biBitCount == 8) {
size += sizeof (FX_DWORD) * 254;
}
- BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size);
+ BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(uint8_t, size);
pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pbmih->bmiHeader.biBitCount = bmih.biBitCount;
pbmih->bmiHeader.biCompression = BI_RGB;
@@ -232,7 +232,7 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP
if (ret != 0 && bmih.biBitCount == 32) {
int pitch = pDIBitmap->GetPitch();
for (int row = 0; row < height; row ++) {
- FX_BYTE* dest_scan = (FX_BYTE*)(pDIBitmap->GetBuffer() + row * pitch);
+ uint8_t* dest_scan = (uint8_t*)(pDIBitmap->GetBuffer() + row * pitch);
for (int col = 0; col < width; col++) {
dest_scan[3] = 255;
dest_scan += 4;
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index 0849583384..e2951e4d07 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -310,7 +310,7 @@ HRESULT STDMETHODCALLTYPE CDwFontFileStream::ReadFileFragment(
{
if (fileOffset <= resourceSize_ &&
fragmentSize <= resourceSize_ - fileOffset) {
- *fragmentStart = static_cast<FX_BYTE const*>(resourcePtr_) + static_cast<size_t>(fileOffset);
+ *fragmentStart = static_cast<uint8_t const*>(resourcePtr_) + static_cast<size_t>(fileOffset);
*fragmentContext = NULL;
return S_OK;
} else {
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index e36d283115..944266c1c9 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -220,7 +220,7 @@ typedef GpStatus (WINGDIPAPI *FuncType_GdipSetImagePalette)(GpImage *image, GDIP
typedef GpStatus (WINGDIPAPI *FuncType_GdipSetInterpolationMode)(GpGraphics *graphics, InterpolationMode interpolationMode);
typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawImagePointsI)(GpGraphics *graphics, GpImage *image, GDIPCONST GpPoint *dstpoints, INT count);
typedef GpStatus (WINGDIPAPI *FuncType_GdipCreateBitmapFromGdiDib)(GDIPCONST BITMAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap);
-typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT FX_UINTPTR *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output);
+typedef Status (WINAPI *FuncType_GdiplusStartup)(OUT uintptr_t *token, const GdiplusStartupInput *input, OUT GdiplusStartupOutput *output);
typedef GpStatus (WINGDIPAPI *FuncType_GdipDrawLineI)(GpGraphics *graphics, GpPen *pen, int x1, int y1, int x2, int y2);
typedef GpStatus (WINGDIPAPI *FuncType_GdipResetClip)(GpGraphics *graphics);
typedef GpStatus (WINGDIPAPI *FuncType_GdipCreatePath)(GpFillMode brushMode, GpPath **path);
@@ -506,7 +506,7 @@ void CGdiplusExt::Load()
return;
}
}
- FX_UINTPTR gdiplusToken;
+ uintptr_t gdiplusToken;
GdiplusStartupInput gdiplusStartupInput;
((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])(&gdiplusToken, &gdiplusStartupInput, NULL);
m_GdiModule = LoadLibraryA("GDI32.DLL");
@@ -1044,7 +1044,7 @@ public:
bytes_left = m_InterStream.GetLength() - m_ReadPos;
bytes_out = FX_MIN(cb, bytes_left);
FXSYS_memcpy32(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out);
- m_ReadPos += (FX_INT32)bytes_out;
+ m_ReadPos += (int32_t)bytes_out;
if (pcbRead != NULL) {
*pcbRead = (ULONG)bytes_out;
}
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index d6a44b490f..7740fbd87a 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -294,7 +294,7 @@ FX_BOOL CPSPrinterDriver::Init(HDC hDC, int pslevel, FX_BOOL bCmykOutput)
if (ret == 1) {
ret = ::GetRegionData(hRgn, 0, NULL);
if (ret) {
- RGNDATA* pData = (RGNDATA*)FX_Alloc(FX_BYTE, ret);
+ RGNDATA* pData = (RGNDATA*)FX_Alloc(uint8_t, ret);
ret = ::GetRegionData(hRgn, ret, pData);
if (ret) {
CFX_PathData path;
diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h
index 7c5c0720b1..a3380f3b5b 100644
--- a/core/src/fxge/win32/win32_int.h
+++ b/core/src/fxge/win32/win32_int.h
@@ -29,7 +29,7 @@ public:
int fill_mode
);
- void* LoadMemFont(FX_BYTE* pData, FX_DWORD size);
+ void* LoadMemFont(uint8_t* pData, FX_DWORD size);
void DeleteMemFont(void* pFontCollection);
FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
void GdipDeleteGraphics(void* graphics);