summaryrefslogtreecommitdiff
path: root/core/src/fxge/dib
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fxge/dib
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r--core/src/fxge/dib/dib_int.h6
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp394
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp160
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp16
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp108
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp44
6 files changed, 364 insertions, 364 deletions
diff --git a/core/src/fxge/dib/dib_int.h b/core/src/fxge/dib/dib_int.h
index c82a0378b8..9eeb0fddc0 100644
--- a/core/src/fxge/dib/dib_int.h
+++ b/core/src/fxge/dib/dib_int.h
@@ -54,7 +54,7 @@ public:
return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize);
}
int m_DestMin, m_ItemSize;
- FX_LPBYTE m_pWeightTables;
+ uint8_t* m_pWeightTables;
};
class CStretchEngine
{
@@ -70,8 +70,8 @@ public:
IFX_ScanlineComposer* m_pDestBitmap;
int m_DestWidth, m_DestHeight;
FX_RECT m_DestClip;
- FX_LPBYTE m_pDestScanline;
- FX_LPBYTE m_pDestMaskScanline;
+ uint8_t* m_pDestScanline;
+ uint8_t* m_pDestMaskScanline;
FX_RECT m_SrcClip;
const CFX_DIBSource* m_pSource;
FX_DWORD* m_pSrcPalette;
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index 970325a2d4..aeee91bb4b 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -227,7 +227,7 @@ static _RGB _SetSat(_RGB color, int s)
}
return color;
}
-void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, uint8_t* dest_scan, int results[3])
+void _RGB_Blend(int blend_mode, const uint8_t* src_scan, uint8_t* dest_scan, int results[3])
{
_RGB src, back, result;
src.red = src_scan[2];
@@ -254,7 +254,7 @@ void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, uint8_t* dest_scan, int res
results[1] = result.green;
results[2] = result.red;
}
-inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Argb2Mask(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, const uint8_t* clip_scan)
{
src_scan += 3;
for (int col = 0; col < pixel_count; col ++) {
@@ -272,7 +272,7 @@ inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
src_scan += 4;
}
}
-void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int pixel_count, FX_LPCBYTE clip_scan)
+void _CompositeRow_Rgba2Mask(uint8_t* dest_scan, const uint8_t* src_alpha_scan, int pixel_count, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha = *src_alpha_scan++;
@@ -288,7 +288,7 @@ void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int
dest_scan ++;
}
}
-void _CompositeRow_Rgb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan)
+void _CompositeRow_Rgb2Mask(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan)
{
if (clip_scan) {
for (int i = 0; i < width; i ++) {
@@ -300,8 +300,8 @@ void _CompositeRow_Rgb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
FXSYS_memset8(dest_scan, 0xff, width);
}
}
-void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE dst_alpha_scan, void* pIccTransform)
+void _CompositeRow_Argb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan, uint8_t* dst_alpha_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
if (pIccTransform) {
@@ -493,9 +493,9 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 4;
}
}
-inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, void* pIccTransform)
+inline void _CompositeRow_Argb2Gray(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
uint8_t gray;
@@ -584,8 +584,8 @@ inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
src_scan += 4;
}
}
-inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
+inline void _CompositeRow_Rgb2Gray(uint8_t* dest_scan, const uint8_t* src_scan, int src_Bpp, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
@@ -631,9 +631,9 @@ inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
src_scan += src_Bpp;
}
}
-void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_Bpp, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, void* pIccTransform)
+void _CompositeRow_Rgb2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int src_Bpp, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
if (pIccTransform) {
@@ -721,8 +721,8 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B
src_scan += src_Bpp;
}
}
-void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+void _CompositeRow_Argb2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -928,8 +928,8 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
}
}
}
-void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_Rgb2Argb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp,
+ uint8_t* dest_alpha_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -989,8 +989,8 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
}
}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+inline void _CompositeRow_Rgb2Argb_Blend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -1067,8 +1067,8 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
}
}
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
@@ -1129,8 +1129,8 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE
}
}
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
- FX_LPBYTE dest_alpha_scan)
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp,
+ uint8_t* dest_alpha_scan)
{
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
@@ -1153,8 +1153,8 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYT
}
}
}
-inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_Argb2Rgb_Blend(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -1214,8 +1214,8 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
}
}
-inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_Argb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan)
{
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
@@ -1276,7 +1276,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s
}
}
}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -1299,7 +1299,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE s
src_scan += src_gap;
}
}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -1328,7 +1328,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src
src_scan += src_gap;
}
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp)
{
if (dest_Bpp == src_Bpp) {
FXSYS_memcpy32(dest_scan, src_scan, width * dest_Bpp);
@@ -1342,7 +1342,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE
src_scan += src_Bpp;
}
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
for (int col = 0; col < width; col ++) {
int src_alpha = clip_scan[col];
@@ -1366,10 +1366,10 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE s
src_scan += src_Bpp;
}
}
-void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+void _CompositeRow_Argb2Argb_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_alpha_scan) {
if (dest_alpha_scan == NULL) {
@@ -1451,14 +1451,14 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
}
_CompositeRow_Argb2Argb(dest_scan, src_cache_scan, pixel_count, blend_type, clip_scan, dest_alpha_scan, src_alpha_scan);
}
-void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp,
+ uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1467,14 +1467,14 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBY
}
_CompositeRow_Rgb2Argb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, 3, dest_alpha_scan);
}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1483,14 +1483,14 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_
}
_CompositeRow_Rgb2Argb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, 3, clip_scan, dest_alpha_scan);
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1499,14 +1499,14 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, F
}
_CompositeRow_Rgb2Argb_NoBlend_Clip(dest_scan, src_cache_scan, width, 3, clip_scan, dest_alpha_scan);
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp,
- FX_LPBYTE dest_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp,
+ uint8_t* dest_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1515,8 +1515,8 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan,
}
_CompositeRow_Rgb2Argb_NoBlend_NoClip(dest_scan, src_cache_scan, width, 3, dest_alpha_scan);
}
-inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Argb2Rgb_Blend_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_alpha_scan) {
@@ -1556,8 +1556,8 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBY
}
_CompositeRow_Argb2Rgb_Blend(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, clip_scan, src_alpha_scan);
}
-inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan, FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan, uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_alpha_scan) {
@@ -1596,14 +1596,14 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPC
}
_CompositeRow_Argb2Rgb_NoBlend(dest_scan, src_cache_scan, width, dest_Bpp, clip_scan, src_alpha_scan);
}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp,
+ uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1612,14 +1612,14 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_Transform(FX_LPBYTE dest_scan, FX
}
_CompositeRow_Rgb2Rgb_Blend_NoClip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3);
}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1628,14 +1628,14 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_Transform(FX_LPBYTE dest_scan, FX_L
}
_CompositeRow_Rgb2Rgb_Blend_Clip(dest_scan, src_cache_scan, width, blend_type, dest_Bpp, 3, clip_scan);
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp,
+ uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1644,14 +1644,14 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_Transform(FX_LPBYTE dest_scan,
}
_CompositeRow_Rgb2Rgb_NoBlend_NoClip(dest_scan, src_cache_scan, width, dest_Bpp, 3);
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan,
- FX_LPBYTE src_cache_scan, void* pIccTransform)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan,
+ uint8_t* src_cache_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (src_Bpp == 3) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, width);
} else {
- FX_LPBYTE dp = src_cache_scan;
+ uint8_t* dp = src_cache_scan;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dp, src_scan, 1);
src_scan += 4;
@@ -1660,9 +1660,9 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_Transform(FX_LPBYTE dest_scan, FX
}
_CompositeRow_Rgb2Rgb_NoBlend_Clip(dest_scan, src_cache_scan, width, dest_Bpp, 3, clip_scan);
}
-inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_8bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_scan, const uint8_t* pPalette, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan)
{
if (src_alpha_scan) {
if (blend_type) {
@@ -1734,9 +1734,9 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
}
}
}
-inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_LPCBYTE pPalette, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_8bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_scan, const uint8_t* pPalette, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan)
{
if (src_alpha_scan) {
if (blend_type) {
@@ -1866,8 +1866,8 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
}
}
}
-inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_1bppPal2Gray(uint8_t* dest_scan, const uint8_t* src_scan, int src_left,
+ const uint8_t* pPalette, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
@@ -1899,9 +1899,9 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
dest_scan ++;
}
}
-inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_LPCBYTE pPalette, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+inline void _CompositeRow_1bppPal2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int src_left,
+ const uint8_t* pPalette, int pixel_count, int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
int reset_gray = pPalette[0];
int set_gray = pPalette[1];
@@ -1955,9 +1955,9 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_scan ++;
}
}
-inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_DWORD* pPalette, int pixel_count,
- int DestBpp, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_8bppRgb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, FX_DWORD* pPalette, int pixel_count,
+ int DestBpp, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan)
{
if (src_alpha_scan) {
int dest_gap = DestBpp - 3;
@@ -2019,8 +2019,8 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE sr
}
}
}
-inline void _CompositeRow_1bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_DWORD* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_1bppRgb2Rgb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left,
+ FX_DWORD* pPalette, int pixel_count, int DestBpp, const uint8_t* clip_scan)
{
int reset_r, reset_g, reset_b;
int set_r, set_g, set_b;
@@ -2058,9 +2058,9 @@ inline void _CompositeRow_1bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE sr
}
}
}
-inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_alpha_scan)
+inline void _CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int width,
+ FX_DWORD* pPalette, const uint8_t* clip_scan,
+ const uint8_t* src_alpha_scan)
{
if (src_alpha_scan) {
for (int col = 0; col < width; col ++) {
@@ -2136,9 +2136,9 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
src_scan ++;
}
}
-void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan, FX_LPCBYTE src_alpha_scan)
+void _CompositeRow_8bppRgb2Rgba_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int width,
+ FX_DWORD* pPalette, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan, const uint8_t* src_alpha_scan)
{
if (src_alpha_scan) {
for (int col = 0; col < width; col ++) {
@@ -2216,8 +2216,8 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
src_scan ++;
}
}
-inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_1bppRgb2Argb_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width,
+ FX_DWORD* pPalette, const uint8_t* clip_scan)
{
int reset_r, reset_g, reset_b;
int set_r, set_g, set_b;
@@ -2263,9 +2263,9 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
dest_scan ++;
}
}
-void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_DWORD* pPalette, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_1bppRgb2Rgba_NoBlend(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width,
+ FX_DWORD* pPalette, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
int reset_r, reset_g, reset_b;
int set_r, set_g, set_b;
@@ -2311,8 +2311,8 @@ void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_scan ++;
}
}
-void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2368,9 +2368,9 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan += 2;
}
}
-void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_ByteMask2Rgba(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2431,8 +2431,8 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
}
}
}
-void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Rgb(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, int Bpp, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2476,8 +2476,8 @@ void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
dest_scan += Bpp - 2;
}
}
-void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int pixel_count,
- FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Mask(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int pixel_count,
+ const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2495,8 +2495,8 @@ void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan ++;
}
}
-void _CompositeRow_ByteMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int pixel_count, FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Gray(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_gray,
+ int pixel_count, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2511,9 +2511,9 @@ void _CompositeRow_ByteMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan ++;
}
}
-void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int pixel_count, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_ByteMask2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_gray,
+ int pixel_count, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -2540,8 +2540,8 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
dest_scan ++;
}
}
-void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Argb(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
@@ -2607,9 +2607,9 @@ void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
dest_scan += 2;
}
}
-void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_BitMask2Rgba(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
for (int col = 0; col < pixel_count; col ++) {
@@ -2683,8 +2683,8 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
}
}
}
-void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Rgb(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, int Bpp, const uint8_t* clip_scan)
{
if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
for (int col = 0; col < pixel_count; col ++) {
@@ -2743,8 +2743,8 @@ void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mas
dest_scan += Bpp - 2;
}
}
-void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_left,
- int pixel_count, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Mask(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_left,
+ int pixel_count, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
@@ -2766,8 +2766,8 @@ void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
dest_scan ++;
}
}
-void _CompositeRow_BitMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int src_left, int pixel_count, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Gray(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_gray,
+ int src_left, int pixel_count, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
@@ -2786,9 +2786,9 @@ void _CompositeRow_BitMask2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
dest_scan ++;
}
}
-void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_gray,
- int src_left, int pixel_count, FX_LPCBYTE clip_scan,
- FX_LPBYTE dest_alpha_scan)
+void _CompositeRow_BitMask2Graya(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_gray,
+ int src_left, int pixel_count, const uint8_t* clip_scan,
+ uint8_t* dest_alpha_scan)
{
for (int col = 0; col < pixel_count; col ++) {
if (!(src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8)))) {
@@ -2820,7 +2820,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan ++;
}
}
-void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+void _CompositeRow_Argb2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -2877,7 +2877,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
src_scan++;
}
}
-void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp)
+void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -2914,7 +2914,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
src_scan += src_gap;
}
}
-inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -2949,7 +2949,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
src_scan ++;
}
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp)
+inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp)
{
for (int col = 0; col < width; col ++) {
if (src_Bpp == 4) {
@@ -2961,7 +2961,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_sc
src_scan += src_Bpp;
}
}
-inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
+inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -2987,7 +2987,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan += src_gap;
}
}
-inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, const uint8_t* clip_scan)
{
for (int col = 0; col < width; col ++) {
uint8_t src_alpha;
@@ -3018,7 +3018,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_
src_scan ++;
}
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp)
{
for (int col = 0; col < width; col ++) {
dest_scan[2] = src_scan[0];
@@ -3028,7 +3028,7 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_NoClip_RgbByteOrder(FX_LPBYTE dest_sca
src_scan += src_Bpp;
}
}
-inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -3072,7 +3072,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan += src_gap;
}
}
-inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int blend_type, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
@@ -3104,7 +3104,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, F
src_scan += src_gap;
}
}
-inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int src_Bpp, const uint8_t* clip_scan)
{
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
@@ -3136,7 +3136,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan
src_scan += src_gap;
}
}
-inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, int src_Bpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width, int dest_Bpp, int src_Bpp, const uint8_t* clip_scan)
{
for (int col = 0; col < width; col ++) {
int src_alpha = clip_scan[col];
@@ -3158,8 +3158,8 @@ inline void _CompositeRow_Rgb2Rgb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan += src_Bpp;
}
}
-inline void _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, FX_ARGB* pPalette, int pixel_count,
- int DestBpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, FX_ARGB* pPalette, int pixel_count,
+ int DestBpp, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
FX_ARGB argb = pPalette ? pPalette[*src_scan] : (*src_scan) * 0x010101;
@@ -3179,8 +3179,8 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan ++;
}
}
-inline void _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left,
- FX_ARGB* pPalette, int pixel_count, int DestBpp, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int src_left,
+ FX_ARGB* pPalette, int pixel_count, int DestBpp, const uint8_t* clip_scan)
{
int reset_r, reset_g, reset_b;
int set_r, set_g, set_b;
@@ -3218,8 +3218,8 @@ inline void _CompositeRow_1bppRgb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
dest_scan += DestBpp;
}
}
-inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width,
- FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int width,
+ FX_ARGB* pPalette, const uint8_t* clip_scan)
{
for (int col = 0; col < width; col ++) {
int src_r, src_g, src_b;
@@ -3257,8 +3257,8 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan ++;
}
}
-inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width,
- FX_ARGB* pPalette, FX_LPCBYTE clip_scan)
+inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width,
+ FX_ARGB* pPalette, const uint8_t* clip_scan)
{
int reset_r, reset_g, reset_b;
int set_r, set_g, set_b;
@@ -3307,8 +3307,8 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
dest_scan += 4;
}
}
-void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -3362,8 +3362,8 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr
dest_scan += 4;
}
}
-void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
- int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+void _CompositeRow_ByteMask2Rgb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b, int pixel_count,
+ int blend_type, int Bpp, const uint8_t* clip_scan)
{
for (int col = 0; col < pixel_count; col ++) {
int src_alpha;
@@ -3405,8 +3405,8 @@ void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
dest_scan += Bpp;
}
}
-void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Argb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, const uint8_t* clip_scan)
{
if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
FX_ARGB argb = FXARGB_MAKE(0xff, src_r, src_g, src_b);
@@ -3470,8 +3470,8 @@ void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
dest_scan += 4;
}
}
-void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mask_alpha, int src_r, int src_g, int src_b,
- int src_left, int pixel_count, int blend_type, int Bpp, FX_LPCBYTE clip_scan)
+void _CompositeRow_BitMask2Rgb_RgbByteOrder(uint8_t* dest_scan, const uint8_t* src_scan, int mask_alpha, int src_r, int src_g, int src_b,
+ int src_left, int pixel_count, int blend_type, int Bpp, const uint8_t* clip_scan)
{
if (blend_type == FXDIB_BLEND_NORMAL && clip_scan == NULL && mask_alpha == 255) {
for (int col = 0; col < pixel_count; col ++) {
@@ -3554,7 +3554,7 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int
if ((dest_format & 0xff) == 8) {
if (pIccTransform) {
mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
- FX_LPBYTE gray_p = (FX_LPBYTE)&mask_color;
+ uint8_t* gray_p = (uint8_t*)&mask_color;
pIccModule->TranslateScanline(pIccTransform, gray_p, gray_p, 1);
mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0];
} else {
@@ -3571,7 +3571,7 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int
}
}
} else {
- FX_LPBYTE mask_color_p = (FX_LPBYTE)&mask_color;
+ uint8_t* mask_color_p = (uint8_t*)&mask_color;
mask_color = (alpha_flag >> 8) ? FXCMYK_TODIB(mask_color) : FXARGB_TODIB(mask_color);
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, mask_color_p, mask_color_p, 1);
@@ -3600,11 +3600,11 @@ 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(uint8_t, pal_count);
+ uint8_t* 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]);
- pIccModule->TranslateScanline(pIccTransform, gray_pal, (FX_LPCBYTE)&color, 1);
+ pIccModule->TranslateScanline(pIccTransform, gray_pal, (const uint8_t*)&color, 1);
gray_pal ++;
}
} else {
@@ -3612,13 +3612,13 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
pDestPalette = FX_Alloc(FX_DWORD, palsize);
for (int i = 0; i < palsize; i ++) {
FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&color, (FX_LPCBYTE)&color, 1);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color, (const uint8_t*)&color, 1);
pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
}
}
} else {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
+ uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3633,7 +3633,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
} else {
pDestPalette = FX_Alloc(FX_DWORD, pal_count);
for (int i = 0; i < pal_count; i ++) {
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&pDestPalette[i], &gray_pal[i], 1);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&pDestPalette[i], &gray_pal[i], 1);
pDestPalette[i] = isDstCmyk ? FXCMYK_TODIB(pDestPalette[i]) : FXARGB_TODIB(pDestPalette[i]);
}
FX_Free(gray_pal);
@@ -3643,7 +3643,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(uint8_t, pal_count);
+ uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count);
pDestPalette = (FX_DWORD*)gray_pal;
if (isSrcCmyk) {
for (int i = 0; i < pal_count; i ++) {
@@ -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(uint8_t, pal_count);
+ uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3774,8 +3774,8 @@ FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_
+ (pIccTransform ? 64 : 0);
return TRUE;
}
-void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+void CFX_ScanlineCompositor::CompositeRgbBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
{
int src_Bpp = (m_SrcFormat & 0xff) >> 3;
int dest_Bpp = (m_DestFormat & 0xff) >> 3;
@@ -3967,8 +3967,8 @@ void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCB
}
}
}
-void CFX_ScanlineCompositor::CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+void CFX_ScanlineCompositor::CompositePalBitmapLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
{
if (m_bRgbByteOrder) {
if (m_SrcFormat == FXDIB_1bppRgb) {
@@ -3996,16 +3996,16 @@ void CFX_ScanlineCompositor::CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCB
} else if ((m_DestFormat & 0xff) == 8) {
if (m_Transparency & 8) {
if (m_DestFormat & 0x0200) {
- _CompositeRow_1bppPal2Graya(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan, dst_extra_alpha);
+ _CompositeRow_1bppPal2Graya(dest_scan, src_scan, src_left, (const uint8_t*)m_pSrcPalette, width, m_BlendType, clip_scan, dst_extra_alpha);
} else {
- _CompositeRow_1bppPal2Gray(dest_scan, src_scan, src_left, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan);
+ _CompositeRow_1bppPal2Gray(dest_scan, src_scan, src_left, (const uint8_t*)m_pSrcPalette, width, m_BlendType, clip_scan);
}
} else {
if (m_DestFormat & 0x0200)
- _CompositeRow_8bppPal2Graya(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
+ _CompositeRow_8bppPal2Graya(dest_scan, src_scan, (const uint8_t*)m_pSrcPalette, width, m_BlendType, clip_scan,
dst_extra_alpha, src_extra_alpha);
else
- _CompositeRow_8bppPal2Gray(dest_scan, src_scan, (FX_LPCBYTE)m_pSrcPalette, width, m_BlendType, clip_scan,
+ _CompositeRow_8bppPal2Gray(dest_scan, src_scan, (const uint8_t*)m_pSrcPalette, width, m_BlendType, clip_scan,
src_extra_alpha);
}
} else {
@@ -4036,8 +4036,8 @@ void CFX_ScanlineCompositor::CompositePalBitmapLine(FX_LPBYTE dest_scan, FX_LPCB
}
}
}
-void CFX_ScanlineCompositor::CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha)
+void CFX_ScanlineCompositor::CompositeByteMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int width, const uint8_t* clip_scan,
+ uint8_t* dst_extra_alpha)
{
if (m_DestFormat == FXDIB_8bppMask) {
_CompositeRow_ByteMask2Mask(dest_scan, src_scan, m_MaskAlpha, width, clip_scan);
@@ -4065,8 +4065,8 @@ void CFX_ScanlineCompositor::CompositeByteMaskLine(FX_LPBYTE dest_scan, FX_LPCBY
_CompositeRow_ByteMask2Rgba(dest_scan, src_scan, m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue,
width, m_BlendType, clip_scan, dst_extra_alpha);
}
-void CFX_ScanlineCompositor::CompositeBitMaskLine(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_left, int width, FX_LPCBYTE clip_scan,
- FX_LPBYTE dst_extra_alpha)
+void CFX_ScanlineCompositor::CompositeBitMaskLine(uint8_t* dest_scan, const uint8_t* src_scan, int src_left, int width, const uint8_t* clip_scan,
+ uint8_t* dst_extra_alpha)
{
if (m_DestFormat == FXDIB_8bppMask) {
_CompositeRow_BitMask2Mask(dest_scan, src_scan, m_MaskAlpha, src_left, width, clip_scan);
@@ -4126,11 +4126,11 @@ FX_BOOL CFX_DIBitmap::CompositeBitmap(int dest_left, int dest_top, int width, in
FX_BOOL bRgb = src_Bpp > 1 && !pSrcBitmap->IsCmykImage();
CFX_DIBitmap* pSrcAlphaMask = pSrcBitmap->m_pAlphaMask;
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * src_Bpp;
- FX_LPCBYTE src_scan_extra_alpha = pSrcAlphaMask ? pSrcAlphaMask->GetScanline(src_top + row) + src_left : NULL;
- FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
- FX_LPCBYTE clip_scan = NULL;
+ uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * dest_Bpp;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * src_Bpp;
+ const uint8_t* src_scan_extra_alpha = pSrcAlphaMask ? pSrcAlphaMask->GetScanline(src_top + row) + src_left : NULL;
+ uint8_t* dst_scan_extra_alpha = m_pAlphaMask ? (uint8_t*)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
+ const uint8_t* clip_scan = NULL;
if (pClipMask) {
clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
}
@@ -4176,10 +4176,10 @@ FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int
return FALSE;
}
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
- FX_LPBYTE dst_scan_extra_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
- FX_LPCBYTE clip_scan = NULL;
+ uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
+ const uint8_t* src_scan = pMask->GetScanline(src_top + row);
+ uint8_t* dst_scan_extra_alpha = m_pAlphaMask ? (uint8_t*)m_pAlphaMask->GetScanline(dest_top + row) + dest_left : NULL;
+ const uint8_t* clip_scan = NULL;
if (pClipMask) {
clip_scan = pClipMask->m_pBuffer + (dest_top + row - clip_box.top) * pClipMask->m_Pitch + (dest_left - clip_box.left);
}
@@ -4212,7 +4212,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
} else {
dst_color = FXARGB_TODIB(color);
}
- FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
+ uint8_t* color_p = (uint8_t*)&dst_color;
if (m_bpp == 8) {
uint8_t gray = 255;
if (!IsAlphaMask()) {
@@ -4234,7 +4234,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left;
+ uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left;
if (src_alpha == 255) {
FXSYS_memset8(dest_scan, gray, width);
} else
@@ -4305,8 +4305,8 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
FX_BOOL bArgb = GetFormat() == FXDIB_Argb ? TRUE : FALSE;
if (src_alpha == 255) {
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
- FX_LPBYTE dest_scan_alpha = m_pAlphaMask ? (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left : NULL;
+ uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
+ uint8_t* dest_scan_alpha = m_pAlphaMask ? (uint8_t*)m_pAlphaMask->GetScanline(row) + rect.left : NULL;
if (dest_scan_alpha) {
FXSYS_memset8(dest_scan_alpha, 0xff, width);
}
@@ -4326,7 +4326,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
return TRUE;
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
+ uint8_t* dest_scan = m_pBuffer + row * m_Pitch + rect.left * Bpp;
if (bAlpha) {
if (bArgb) {
for (int col = 0; col < width; col ++) {
@@ -4347,7 +4347,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
*dest_scan++ = dest_alpha;
}
} else {
- FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left;
+ uint8_t* dest_scan_alpha = (uint8_t*)m_pAlphaMask->GetScanline(row) + rect.left;
for (int col = 0; col < width; col ++) {
uint8_t back_alpha = *dest_scan_alpha;
if (back_alpha == 0) {
@@ -4448,8 +4448,8 @@ FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_form
}
return TRUE;
}
-void CFX_BitmapComposer::DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int dest_width, FX_LPCBYTE clip_scan,
- FX_LPCBYTE src_extra_alpha, FX_LPBYTE dst_extra_alpha)
+void CFX_BitmapComposer::DoCompose(uint8_t* dest_scan, const uint8_t* src_scan, int dest_width, const uint8_t* clip_scan,
+ const uint8_t* src_extra_alpha, uint8_t* dst_extra_alpha)
{
if (m_BitmapAlpha < 255) {
if (clip_scan) {
@@ -4469,31 +4469,31 @@ void CFX_BitmapComposer::DoCompose(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
m_Compositor.CompositeRgbBitmapLine(dest_scan, src_scan, dest_width, clip_scan, src_extra_alpha, dst_extra_alpha);
}
}
-void CFX_BitmapComposer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+void CFX_BitmapComposer::ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha)
{
if (m_bVertical) {
ComposeScanlineV(line, scanline, scan_extra_alpha);
return;
}
- FX_LPCBYTE clip_scan = NULL;
+ const uint8_t* clip_scan = NULL;
if (m_pClipMask)
clip_scan = m_pClipMask->GetBuffer() + (m_DestTop + line - m_pClipRgn->GetBox().top) *
m_pClipMask->GetPitch() + (m_DestLeft - m_pClipRgn->GetBox().left);
- FX_LPBYTE dest_scan = (FX_LPBYTE)m_pBitmap->GetScanline(line + m_DestTop) +
+ uint8_t* dest_scan = (uint8_t*)m_pBitmap->GetScanline(line + m_DestTop) +
m_DestLeft * m_pBitmap->GetBPP() / 8;
- FX_LPBYTE dest_alpha_scan = m_pBitmap->m_pAlphaMask ?
- (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line + m_DestTop) + m_DestLeft : NULL;
+ uint8_t* dest_alpha_scan = m_pBitmap->m_pAlphaMask ?
+ (uint8_t*)m_pBitmap->m_pAlphaMask->GetScanline(line + m_DestTop) + m_DestLeft : NULL;
DoCompose(dest_scan, scanline, m_DestWidth, clip_scan, scan_extra_alpha, dest_alpha_scan);
}
-void CFX_BitmapComposer::ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+void CFX_BitmapComposer::ComposeScanlineV(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha)
{
int i;
int Bpp = m_pBitmap->GetBPP() / 8;
int dest_pitch = m_pBitmap->GetPitch();
int dest_alpha_pitch = m_pBitmap->m_pAlphaMask ? m_pBitmap->m_pAlphaMask->GetPitch() : 0;
int dest_x = m_DestLeft + (m_bFlipX ? (m_DestWidth - line - 1) : line);
- FX_LPBYTE dest_buf = m_pBitmap->GetBuffer() + dest_x * Bpp + m_DestTop * dest_pitch;
- FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
+ uint8_t* dest_buf = m_pBitmap->GetBuffer() + dest_x * Bpp + m_DestTop * dest_pitch;
+ uint8_t* dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
m_pBitmap->m_pAlphaMask->GetBuffer() + dest_x + m_DestTop * dest_alpha_pitch : NULL;
if (m_bFlipY) {
dest_buf += dest_pitch * (m_DestHeight - 1);
@@ -4505,27 +4505,27 @@ void CFX_BitmapComposer::ComposeScanlineV(int line, FX_LPCBYTE scanline, FX_LPCB
y_step = -y_step;
y_alpha_step = -y_alpha_step;
}
- FX_LPBYTE src_scan = m_pScanlineV;
- FX_LPBYTE dest_scan = dest_buf;
+ uint8_t* src_scan = m_pScanlineV;
+ uint8_t* dest_scan = dest_buf;
for (i = 0; i < m_DestHeight; i ++) {
for (int j = 0; j < Bpp; j ++) {
*src_scan++ = dest_scan[j];
}
dest_scan += y_step;
}
- FX_LPBYTE src_alpha_scan = m_pScanlineAlphaV;
- FX_LPBYTE dest_alpha_scan = dest_alpha_buf;
+ uint8_t* src_alpha_scan = m_pScanlineAlphaV;
+ uint8_t* dest_alpha_scan = dest_alpha_buf;
if (dest_alpha_scan) {
for (i = 0; i < m_DestHeight; i ++) {
*src_alpha_scan++ = *dest_alpha_scan;
dest_alpha_scan += y_alpha_step;
}
}
- FX_LPBYTE clip_scan = NULL;
+ uint8_t* clip_scan = NULL;
if (m_pClipMask) {
clip_scan = m_pClipScanV;
int clip_pitch = m_pClipMask->GetPitch();
- FX_LPCBYTE src_clip = m_pClipMask->GetBuffer() + (m_DestTop - m_pClipRgn->GetBox().top) *
+ const uint8_t* src_clip = m_pClipMask->GetBuffer() + (m_DestTop - m_pClipRgn->GetBox().top) *
clip_pitch + (dest_x - m_pClipRgn->GetBox().left);
if (m_bFlipY) {
src_clip += clip_pitch * (m_DestHeight - 1);
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index b4fdd3a1ba..ef4f7e40b5 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -279,16 +279,16 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
_Obtain_Pal(m_aLut, m_cLut, m_pPalette, pal_type, win_mac_pal, m_lut);
return TRUE;
}
-FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
uint8_t set_gray, reset_gray;
set_gray = 0xff;
reset_gray = 0x00;
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
FXSYS_memset8(dest_scan, reset_gray, width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = src_left; col < src_left + width; col ++) {
if (src_scan[col / 8] & (1 << (7 - col % 8))) {
*dest_scan = set_gray;
@@ -298,17 +298,17 @@ FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wid
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_8bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
FXSYS_memcpy32(dest_scan, src_scan, width);
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -319,7 +319,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
plt[0] = FXCMYK_TODIB(src_plt[0]);
plt[1] = FXCMYK_TODIB(src_plt[1]);
} else {
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ uint8_t* bgr_ptr = (uint8_t*)plt;
bgr_ptr[0] = FXARGB_B(src_plt[0]);
bgr_ptr[1] = FXARGB_G(src_plt[0]);
bgr_ptr[2] = FXARGB_R(src_plt[0]);
@@ -328,7 +328,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
bgr_ptr[5] = FXARGB_R(src_plt[1]);
}
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2);
+ pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 2);
} else {
uint8_t reset_r, reset_g, reset_b,
set_r, set_g, set_b;
@@ -349,9 +349,9 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
gray[1] = FXRGB2GRAY(set_r, set_g, set_b);
}
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
FXSYS_memset8(dest_scan, gray[0], width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = src_left; col < src_left + width; col ++) {
if (src_scan[col / 8] & (1 << (7 - col % 8))) {
*dest_scan = gray[1];
@@ -361,7 +361,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
@@ -373,7 +373,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
plt[i] = FXCMYK_TODIB(src_plt[i]);
}
} else {
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ uint8_t* bgr_ptr = (uint8_t*)plt;
for (int i = 0; i < 256; i ++) {
*bgr_ptr++ = FXARGB_B(src_plt[i]);
*bgr_ptr++ = FXARGB_G(src_plt[i]);
@@ -381,7 +381,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
}
}
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256);
+ pIccModule->TranslateScanline(pIccTransform, gray, (const uint8_t*)plt, 256);
} else {
if (pSrcBitmap->IsCmykImage()) {
uint8_t r, g, b;
@@ -396,15 +396,15 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
}
}
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;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
for (int col = 0; col < width; col ++) {
*dest_scan++ = gray[*src_scan++];
}
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int Bpp = pSrcBitmap->GetBPP() / 8;
@@ -412,14 +412,14 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
if (Bpp == 3 || pSrcBitmap->IsCmykImage()) {
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 * Bpp;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
}
} else {
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 * 4;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
dest_scan++;
@@ -430,8 +430,8 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
} else {
if (pSrcBitmap->IsCmykImage()) {
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 * 4;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
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]),
@@ -442,8 +442,8 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
}
} else {
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 * Bpp;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
for (int col = 0; col < width; col ++) {
*dest_scan++ = FXRGB2GRAY(src_scan[2], src_scan[1], src_scan[0]);
src_scan += Bpp;
@@ -453,14 +453,14 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
}
return TRUE;
}
-inline void _ConvertBuffer_IndexCopy(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+inline void _ConvertBuffer_IndexCopy(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
if (pSrcBitmap->GetBPP() == 1) {
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
FXSYS_memset32(dest_scan, 0, width);
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = src_left; col < src_left + width; col ++) {
if (src_scan[col / 8] & (1 << (7 - col % 8))) {
*dest_scan = 1;
@@ -470,13 +470,13 @@ inline void _ConvertBuffer_IndexCopy(FX_LPBYTE dest_buf, int dest_pitch, int wid
}
} else {
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;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
FXSYS_memcpy32(dest_scan, src_scan, width);
}
}
}
-FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Plt2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
_ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top);
@@ -484,7 +484,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
int plt_size = pSrcBitmap->GetPaletteSize();
if (pIccTransform) {
FX_DWORD plt[256];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ uint8_t* bgr_ptr = (uint8_t*)plt;
if (pSrcBitmap->IsCmykImage()) {
for (int i = 0; i < plt_size; i ++) {
plt[i] = FXCMYK_TODIB(src_plt[i]);
@@ -495,10 +495,10 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
*bgr_ptr++ = FXARGB_G(src_plt[i]);
*bgr_ptr++ = FXARGB_R(src_plt[i]);
}
- bgr_ptr = (FX_LPBYTE)plt;
+ bgr_ptr = (uint8_t*)plt;
}
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, plt_size);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, plt_size);
for (int i = 0; i < plt_size; i ++) {
dst_plt[i] = FXARGB_MAKE(0xff, bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
bgr_ptr += 3;
@@ -517,7 +517,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
}
return TRUE;
}
-inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt)
{
int bpp = pSrcBitmap->GetBPP() / 8;
@@ -573,7 +573,7 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de
FXSYS_memcpy32(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
return TRUE;
}
-FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD* dst_plt, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
@@ -586,13 +586,13 @@ FX_BOOL _ConvertBuffer_Rgb2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
for (int i = 0; i < 256; i++) {
FX_ARGB* plt = dst_plt + i;
FX_ARGB plt_entry = FXARGB_TODIB(*plt);
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)&plt_entry, (FX_LPCBYTE)&plt_entry, 1);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&plt_entry, (const uint8_t*)&plt_entry, 1);
*plt = FXARGB_TODIB(plt_entry);
}
}
return ret;
}
-FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
@@ -600,8 +600,8 @@ FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
set_gray = 0xff;
reset_gray = 0x00;
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);
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = src_left; col < src_left + width; col ++) {
if (src_scan[col / 8] & (1 << (7 - col % 8))) {
dest_scan[0] = set_gray;
@@ -617,13 +617,13 @@ FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
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;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
uint8_t src_pixel;
for (int col = 0; col < width; col ++) {
src_pixel = *src_scan++;
@@ -635,13 +635,13 @@ FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
FX_DWORD plt[2];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ uint8_t* bgr_ptr = (uint8_t*)plt;
if (pSrcBitmap->IsCmykImage()) {
plt[0] = FXCMYK_TODIB(src_plt[0]);
plt[1] = FXCMYK_TODIB(src_plt[1]);
@@ -655,7 +655,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 2);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, 2);
} else {
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]),
@@ -665,8 +665,8 @@ FX_BOOL _ConvertBuffer_1bppPlt2Rgb(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);
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = src_left; col < src_left + width; col ++) {
if (src_scan[col / 8] & (1 << (7 - col % 8))) {
*dest_scan++ = bgr_ptr[3];
@@ -682,20 +682,20 @@ FX_BOOL _ConvertBuffer_1bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = (dst_format & 0xff) / 8;
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
FX_DWORD plt[256];
- FX_LPBYTE bgr_ptr = (FX_LPBYTE)plt;
+ uint8_t* bgr_ptr = (uint8_t*)plt;
if (!pSrcBitmap->IsCmykImage()) {
for (int i = 0; i < 256; i++) {
*bgr_ptr++ = FXARGB_B(src_plt[i]);
*bgr_ptr++ = FXARGB_G(src_plt[i]);
*bgr_ptr++ = FXARGB_R(src_plt[i]);
}
- bgr_ptr = (FX_LPBYTE)plt;
+ bgr_ptr = (uint8_t*)plt;
}
if (pIccTransform) {
if (pSrcBitmap->IsCmykImage()) {
@@ -704,7 +704,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
}
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
- pIccModule->TranslateScanline(pIccTransform, (FX_LPBYTE)plt, (FX_LPCBYTE)plt, 256);
+ pIccModule->TranslateScanline(pIccTransform, (uint8_t*)plt, (const uint8_t*)plt, 256);
} else {
if (pSrcBitmap->IsCmykImage()) {
for (int i = 0; i < 256; i++) {
@@ -712,14 +712,14 @@ FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
bgr_ptr[2], bgr_ptr[1], bgr_ptr[0]);
bgr_ptr += 3;
}
- bgr_ptr = (FX_LPBYTE)plt;
+ bgr_ptr = (uint8_t*)plt;
}
}
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;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
for (int col = 0; col < width; col ++) {
- FX_LPBYTE src_pixel = bgr_ptr + 3 * (*src_scan++);
+ uint8_t* src_pixel = bgr_ptr + 3 * (*src_scan++);
*dest_scan++ = *src_pixel++;
*dest_scan++ = *src_pixel++;
*dest_scan = *src_pixel++;
@@ -728,31 +728,31 @@ FX_BOOL _ConvertBuffer_8bppPlt2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_24bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
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 * 3;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, width);
}
} else {
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 * 3;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 3;
FXSYS_memcpy32(dest_scan, src_scan, width * 3);
}
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -763,21 +763,21 @@ FX_BOOL _ConvertBuffer_32bppRgb2Rgb24(FX_LPBYTE dest_buf, int dest_pitch, int wi
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
pIccModule->TranslateScanline(pIccTransform, dest_scan, dest_scan, width);
}
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_Rgb2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_Rgb2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
int comps = pSrcBitmap->GetBPP() / 8;
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
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 * comps;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
dest_scan += 4;
@@ -786,8 +786,8 @@ FX_BOOL _ConvertBuffer_Rgb2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width,
}
} else {
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 * comps;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * comps;
for (int col = 0; col < width; col ++) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -799,14 +799,14 @@ FX_BOOL _ConvertBuffer_Rgb2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width,
}
return TRUE;
}
-FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
if (pIccTransform) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
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 * 4;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, dest_scan, src_scan, 1);
dest_scan += 4;
@@ -815,8 +815,8 @@ FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int w
}
} else {
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 * 4;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
AdobeCMYK_to_sRGB1(src_scan[0], src_scan[1], src_scan[2], src_scan[3],
dest_scan[2], dest_scan[1], dest_scan[0]);
@@ -827,7 +827,7 @@ FX_BOOL _ConvertBuffer_32bppCmyk2Rgb32(FX_LPBYTE dest_buf, int dest_pitch, int w
}
return TRUE;
}
-FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& d_pal, void* pIccTransform)
{
FXDIB_Format src_format = pSrcBitmap->GetFormat();
@@ -993,7 +993,7 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor
if (dest_format == FXDIB_Argb && src_format == FXDIB_Rgb32 && pIccTransform == NULL) {
m_AlphaFlag = 2;
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch + 3;
+ uint8_t* scanline = m_pBuffer + row * m_Pitch + 3;
for (int col = 0; col < m_Width; col ++) {
*scanline = 0xff;
scanline += 4;
@@ -1003,7 +1003,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(uint8_t, dest_pitch * m_Height + 4);
+ uint8_t* dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4);
if (dest_buf == NULL) {
return FALSE;
}
@@ -1012,8 +1012,8 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor
FXSYS_memset8(dest_buf, 0xff, dest_pitch * m_Height + 4);
if (m_pAlphaMask) {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE pDstScanline = dest_buf + row * dest_pitch + 3;
- FX_LPCBYTE pSrcScanline = m_pAlphaMask->GetScanline(row);
+ uint8_t* pDstScanline = dest_buf + row * dest_pitch + 3;
+ const uint8_t* pSrcScanline = m_pAlphaMask->GetScanline(row);
for (int col = 0; col < m_Width; col ++) {
*pDstScanline = *pSrcScanline++;
pDstScanline += 4;
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index e0b21d2f59..fc36b95581 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -350,10 +350,10 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
rows_to_go = FX_STRECH_PAUSE_ROWS;
}
}
- FX_LPCBYTE src_scan = m_pSource->GetScanline(m_CurRow);
- FX_LPBYTE dest_scan = m_pInterBuf + (m_CurRow - m_SrcClip.top) * m_InterPitch;
- FX_LPCBYTE src_scan_mask = NULL;
- FX_LPBYTE dest_scan_mask = NULL;
+ const uint8_t* src_scan = m_pSource->GetScanline(m_CurRow);
+ uint8_t* dest_scan = m_pInterBuf + (m_CurRow - m_SrcClip.top) * m_InterPitch;
+ const uint8_t* src_scan_mask = NULL;
+ uint8_t* dest_scan_mask = NULL;
if (m_pExtraAlphaBuf) {
src_scan_mask = m_pSource->m_pAlphaMask->GetScanline(m_CurRow);
dest_scan_mask = m_pExtraAlphaBuf + (m_CurRow - m_SrcClip.top) * m_ExtraMaskPitch;
@@ -477,7 +477,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + j * Bpp;
+ const uint8_t* src_pixel = src_scan + j * Bpp;
dest_b_c += pixel_weight * (*src_pixel++);
dest_g_m += pixel_weight * (*src_pixel++);
dest_r_y += pixel_weight * (*src_pixel);
@@ -500,7 +500,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + j * Bpp;
+ const uint8_t* src_pixel = src_scan + j * Bpp;
if (m_DestFormat == FXDIB_Argb) {
pixel_weight = pixel_weight * src_pixel[3] / 255;
} else {
@@ -596,7 +596,7 @@ void CStretchEngine::StretchVert()
int dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
+ const uint8_t* src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
dest_b_c += pixel_weight * (*src_pixel++);
dest_g_m += pixel_weight * (*src_pixel++);
dest_r_y += pixel_weight * (*src_pixel);
@@ -624,7 +624,7 @@ void CStretchEngine::StretchVert()
int dest_a = 0, dest_r_y = 0, dest_g_m = 0, dest_b_c = 0;
for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd; j ++) {
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
- FX_LPCBYTE src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
+ const uint8_t* src_pixel = src_scan + (j - m_SrcClip.top) * m_InterPitch;
int mask_v = 255;
if (src_scan_mask) {
mask_v = src_scan_mask[(j - m_SrcClip.top) * m_ExtraMaskPitch];
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index 74c4276695..db9b43412a 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -9,7 +9,7 @@
#include "../../../include/fxcodec/fx_codec.h"
#include "dib_int.h"
#include <limits.h>
-FX_BOOL ConvertBuffer(FXDIB_Format dest_format, FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
+FX_BOOL ConvertBuffer(FXDIB_Format dest_format, uint8_t* dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, FX_DWORD*& pal, void* pIccTransform);
void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k)
{
@@ -59,7 +59,7 @@ CFX_DIBitmap::CFX_DIBitmap()
m_pPalette = NULL;
}
#define _MAX_OOM_LIMIT_ 12000000
-FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch)
+FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, uint8_t* pBuffer, int pitch)
{
m_pBuffer = NULL;
m_bpp = (uint8_t)format;
@@ -191,8 +191,8 @@ CFX_DIBitmap* CFX_DIBSource::Clone(const FX_RECT* pClip) const
copy_len = m_Pitch;
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row) + rect.left * m_bpp / 8;
- FX_LPBYTE dest_scan = (FX_LPBYTE)pNewBitmap->GetScanline(row - rect.top);
+ const uint8_t* src_scan = GetScanline(row) + rect.left * m_bpp / 8;
+ uint8_t* dest_scan = (uint8_t*)pNewBitmap->GetScanline(row - rect.top);
FXSYS_memcpy32(dest_scan, src_scan, copy_len);
}
}
@@ -392,8 +392,8 @@ FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int
if (dest_format == src_format && pIccTransform == NULL) {
if (GetBPP() == 1) {
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row);
+ uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row);
for (int col = 0; col < width; col ++) {
if (src_scan[(src_left + col) / 8] & (1 << (7 - (src_left + col) % 8))) {
dest_scan[(dest_left + col) / 8] |= 1 << (7 - (dest_left + col) % 8);
@@ -405,8 +405,8 @@ FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int
} else {
int Bpp = GetBPP() / 8;
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
- FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
+ uint8_t* dest_scan = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * Bpp;
+ const uint8_t* src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * Bpp;
FXSYS_memcpy32(dest_scan, src_scan, width * Bpp);
}
}
@@ -417,7 +417,7 @@ FX_BOOL CFX_DIBitmap::TransferBitmap(int dest_left, int dest_top, int width, int
if (m_bpp == 8) {
dest_format = FXDIB_8bppMask;
}
- FX_LPBYTE dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
+ uint8_t* dest_buf = m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
FX_DWORD* d_plt = NULL;
if(!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height, pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
return FALSE;
@@ -450,7 +450,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h
alpha = FXARGB_A(color);
dst_color = FXARGB_TODIB(color);
}
- FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
+ uint8_t* color_p = (uint8_t*)&dst_color;
if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
pIccModule->TranslateScanline(pIccTransform, color_p, color_p, 1);
@@ -468,7 +468,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h
if (GetFormat() == FXDIB_Argb) {
for (int row = 0; row < height; row ++) {
FX_DWORD* dest_pos = (FX_DWORD*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4);
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
+ const uint8_t* src_scan = pMask->GetScanline(src_top + row);
if (src_bpp == 1) {
for (int col = 0; col < width; col ++) {
int src_bitpos = src_left + col;
@@ -491,9 +491,9 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h
} else {
int comps = m_bpp / 8;
for (int row = 0; row < height; row ++) {
- FX_LPBYTE dest_color_pos = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * comps;
- FX_LPBYTE dest_alpha_pos = (FX_LPBYTE)m_pAlphaMask->GetScanline(dest_top + row) + dest_left;
- FX_LPCBYTE src_scan = pMask->GetScanline(src_top + row);
+ uint8_t* dest_color_pos = m_pBuffer + (dest_top + row) * m_Pitch + dest_left * comps;
+ uint8_t* dest_alpha_pos = (uint8_t*)m_pAlphaMask->GetScanline(dest_top + row) + dest_left;
+ const uint8_t* src_scan = pMask->GetScanline(src_top + row);
if (src_bpp == 1) {
for (int col = 0; col < width; col ++) {
int src_bitpos = src_left + col;
@@ -574,8 +574,8 @@ CFX_DIBitmap* CFX_DIBSource::GetAlphaMask(const FX_RECT* pClip) const
return NULL;
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row) + rect.left * 4 + 3;
- FX_LPBYTE dest_scan = (FX_LPBYTE)pMask->GetScanline(row - rect.top);
+ const uint8_t* src_scan = GetScanline(row) + rect.left * 4 + 3;
+ uint8_t* dest_scan = (uint8_t*)pMask->GetScanline(row - rect.top);
for (int col = rect.left; col < rect.right; col ++) {
*dest_scan ++ = *src_scan;
src_scan += 4;
@@ -734,8 +734,8 @@ FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, const CFX_DIBSource
int srcBytes = pSrcClone->GetBPP() / 8;
int destBytes = pDst->GetBPP() / 8;
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_pos = (FX_LPBYTE)pDst->GetScanline(row) + destOffset;
- FX_LPCBYTE src_pos = pSrcClone->GetScanline(row) + srcOffset;
+ uint8_t* dest_pos = (uint8_t*)pDst->GetScanline(row) + destOffset;
+ const uint8_t* src_pos = pSrcClone->GetScanline(row) + srcOffset;
for (int col = 0; col < m_Width; col ++) {
*dest_pos = *src_pos;
dest_pos += destBytes;
@@ -800,7 +800,7 @@ FX_BOOL CFX_DIBitmap::LoadChannel(FXDIB_Channel destChannel, int value)
return TRUE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + destOffset;
+ uint8_t* scan_line = m_pBuffer + row * m_Pitch + destOffset;
for (int col = 0; col < m_Width; col ++) {
*scan_line = value;
scan_line += Bpp;
@@ -836,8 +836,8 @@ FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row;
- FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
+ uint8_t* dest_scan = m_pBuffer + m_Pitch * row;
+ uint8_t* src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
if (pSrcClone->GetBPP() == 1) {
for (int col = 0; col < m_Width; col ++) {
if (!((1 << (7 - col % 8)) & src_scan[col / 8])) {
@@ -860,8 +860,8 @@ FX_BOOL CFX_DIBitmap::MultiplyAlpha(const CFX_DIBSource* pSrcBitmap)
return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_scan = m_pBuffer + m_Pitch * row + 3;
- FX_LPBYTE src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
+ uint8_t* dest_scan = m_pBuffer + m_Pitch * row + 3;
+ uint8_t* src_scan = pSrcClone->m_pBuffer + pSrcClone->m_Pitch * row;
for (int col = 0; col < m_Width; col ++) {
*dest_scan = (*dest_scan) * src_scan[col] / 255;
dest_scan += 4;
@@ -903,8 +903,8 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
}
FXSYS_memset8(pMask->GetBuffer(), gray[0], pMask->GetPitch() * m_Height);
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = (FX_LPBYTE)pMask->GetScanline(row);
+ uint8_t* src_pos = m_pBuffer + row * m_Pitch;
+ uint8_t* dest_pos = (uint8_t*)pMask->GetScanline(row);
for (int col = 0; col < m_Width; col ++) {
if (src_pos[col / 8] & (1 << (7 - col % 8))) {
*dest_pos = gray[1];
@@ -936,8 +936,8 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
+ uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ uint8_t* src_pos = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
*dest_pos ++ = gray[*src_pos ++];
}
@@ -956,8 +956,8 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ uint8_t* src_pos = m_pBuffer + row * m_Pitch;
+ uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
for (int col = 0; col < m_Width; col ++) {
*dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
src_pos += 3;
@@ -977,8 +977,8 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
return FALSE;
}
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE src_pos = m_pBuffer + row * m_Pitch;
- FX_LPBYTE dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
+ uint8_t* src_pos = m_pBuffer + row * m_Pitch;
+ uint8_t* dest_pos = pMask->GetBuffer() + row * pMask->GetPitch();
for (int col = 0; col < m_Width; col ++) {
*dest_pos ++ = FXRGB2GRAY(src_pos[2], src_pos[1], *src_pos);
src_pos += 4;
@@ -1007,7 +1007,7 @@ FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
break;
case FXDIB_8bppMask: {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch;
+ uint8_t* scan_line = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
scan_line[col] = scan_line[col] * alpha / 255;
}
@@ -1016,7 +1016,7 @@ FX_BOOL CFX_DIBitmap::MultiplyAlpha(int alpha)
}
case FXDIB_Argb: {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scan_line = m_pBuffer + row * m_Pitch + 3;
+ uint8_t* scan_line = m_pBuffer + row * m_Pitch + 3;
for (int col = 0; col < m_Width; col ++) {
*scan_line = (*scan_line) * alpha / 255;
scan_line += 4;
@@ -1047,7 +1047,7 @@ FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const
if (m_pBuffer == NULL) {
return 0;
}
- FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
+ uint8_t* pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
switch (GetFormat()) {
case FXDIB_1bppMask: {
if ((*pos) & (1 << (7 - x % 8))) {
@@ -1086,7 +1086,7 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
if (x < 0 || x >= m_Width || y < 0 || y >= m_Height) {
return;
}
- FX_LPBYTE pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
+ uint8_t* pos = m_pBuffer + y * m_Pitch + x * GetBPP() / 8;
switch (GetFormat()) {
case FXDIB_1bppMask:
if (color >> 24) {
@@ -1148,14 +1148,14 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
break;
}
}
-void CFX_DIBitmap::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+void CFX_DIBitmap::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
if (m_pBuffer == NULL) {
return;
}
int src_Bpp = m_bpp / 8;
- FX_LPBYTE scanline = m_pBuffer + line * m_Pitch;
+ uint8_t* scanline = m_pBuffer + line * m_Pitch;
if (src_Bpp == 0) {
for (int i = 0; i < clip_width; i ++) {
FX_DWORD dest_x = clip_left + i;
@@ -1264,7 +1264,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
if (isCmykImage) {
if (forecolor == 0xff && backcolor == 0x00) {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ uint8_t* scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
@@ -1279,7 +1279,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
}
} else if (forecolor == 0 && backcolor == 0xffffff) {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ uint8_t* scanline = m_pBuffer + row * m_Pitch;
int gap = m_bpp / 8 - 2;
for (int col = 0; col < m_Width; col ++) {
int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
@@ -1293,7 +1293,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
}
if (isCmykImage) {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ uint8_t* scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
@@ -1307,7 +1307,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
}
} else {
for (int row = 0; row < m_Height; row ++) {
- FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
+ uint8_t* scanline = m_pBuffer + row * m_Pitch;
int gap = m_bpp / 8 - 2;
for (int col = 0; col < m_Width; col ++) {
int gray = FXRGB2GRAY(scanline[2], scanline[1], scanline[0]);
@@ -1348,8 +1348,8 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_
}
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_LPBYTE scan = m_pBuffer + row * m_Pitch;
- FX_LPBYTE next_scan = m_pBuffer + (row + 1) * m_Pitch;
+ uint8_t* scan = m_pBuffer + row * m_Pitch;
+ uint8_t* next_scan = m_pBuffer + (row + 1) * m_Pitch;
for (int col = rect.left; col < rect.right; col ++) {
int src_pixel = scan[col];
int dest_pixel = translate[src_pixel];
@@ -1414,11 +1414,11 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
return NULL;
}
pFlipped->CopyPalette(m_pPalette);
- FX_LPBYTE pDestBuffer = pFlipped->GetBuffer();
+ uint8_t* pDestBuffer = pFlipped->GetBuffer();
int Bpp = m_bpp / 8;
for (int row = 0; row < m_Height; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row);
- FX_LPBYTE dest_scan = pDestBuffer + m_Pitch * (bYFlip ? (m_Height - row - 1) : row);
+ const uint8_t* src_scan = GetScanline(row);
+ uint8_t* dest_scan = pDestBuffer + m_Pitch * (bYFlip ? (m_Height - row - 1) : row);
if (!bXFlip) {
FXSYS_memcpy32(dest_scan, src_scan, m_Pitch);
continue;
@@ -1460,8 +1460,8 @@ CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
pDestBuffer = pFlipped->m_pAlphaMask->GetBuffer();
FX_DWORD dest_pitch = pFlipped->m_pAlphaMask->GetPitch();
for (int row = 0; row < m_Height; row ++) {
- FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row);
- FX_LPBYTE dest_scan = pDestBuffer + dest_pitch * (bYFlip ? (m_Height - row - 1) : row);
+ const uint8_t* src_scan = m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_scan = pDestBuffer + dest_pitch * (bYFlip ? (m_Height - row - 1) : row);
if (!bXFlip) {
FXSYS_memcpy32(dest_scan, src_scan, dest_pitch);
continue;
@@ -1528,12 +1528,12 @@ void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
m_pPalette = GetDestPalette();
m_pScanline = FX_Alloc(uint8_t, m_Pitch);
}
-FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const
+const uint8_t* CFX_FilteredDIB::GetScanline(int line) const
{
TranslateScanline(m_pScanline, m_pSrc->GetScanline(line));
return m_pScanline;
}
-void CFX_FilteredDIB::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
+void CFX_FilteredDIB::DownSampleScanline(int line, uint8_t* dest_scan, int dest_bpp,
int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
{
m_pSrc->DownSampleScanline(line, dest_scan, dest_bpp, dest_width, bFlipX, clip_left, clip_width);
@@ -1684,11 +1684,11 @@ void CFX_BitmapStorer::Replace(CFX_DIBitmap* pBitmap)
}
m_pBitmap = pBitmap;
}
-void CFX_BitmapStorer::ComposeScanline(int line, FX_LPCBYTE scanline, FX_LPCBYTE scan_extra_alpha)
+void CFX_BitmapStorer::ComposeScanline(int line, const uint8_t* scanline, const uint8_t* scan_extra_alpha)
{
- FX_LPBYTE dest_buf = (FX_LPBYTE)m_pBitmap->GetScanline(line);
- FX_LPBYTE dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
- (FX_LPBYTE)m_pBitmap->m_pAlphaMask->GetScanline(line) : NULL;
+ uint8_t* dest_buf = (uint8_t*)m_pBitmap->GetScanline(line);
+ uint8_t* dest_alpha_buf = m_pBitmap->m_pAlphaMask ?
+ (uint8_t*)m_pBitmap->m_pAlphaMask->GetScanline(line) : NULL;
if (dest_buf) {
FXSYS_memcpy32(dest_buf, scanline, m_pBitmap->GetPitch());
}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 7d91cdba4b..b8109756e7 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -74,7 +74,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC
}
pTransBitmap->CopyPalette(m_pPalette);
int dest_pitch = pTransBitmap->GetPitch();
- FX_LPBYTE dest_buf = pTransBitmap->GetBuffer();
+ uint8_t* dest_buf = pTransBitmap->GetBuffer();
int row_start = bXFlip ? m_Height - dest_clip.right : dest_clip.left;
int row_end = bXFlip ? m_Height - dest_clip.left : dest_clip.right;
int col_start = bYFlip ? m_Width - dest_clip.bottom : dest_clip.top;
@@ -82,9 +82,9 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC
if (GetBPP() == 1) {
FXSYS_memset8(dest_buf, 0xff, dest_pitch * result_height);
for (int row = row_start; row < row_end; row ++) {
- FX_LPCBYTE src_scan = GetScanline(row);
+ const uint8_t* src_scan = GetScanline(row);
int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf;
+ uint8_t* dest_scan = dest_buf;
if (bYFlip) {
dest_scan += (result_height - 1) * dest_pitch;
}
@@ -104,7 +104,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC
}
for (int row = row_start; row < row_end; row ++) {
int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf + dest_col * nBytes;
+ uint8_t* dest_scan = dest_buf + dest_col * nBytes;
if (bYFlip) {
dest_scan += (result_height - 1) * dest_pitch;
}
@@ -115,7 +115,7 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC
dest_scan += dest_step;
}
} else {
- FX_LPCBYTE src_scan = GetScanline(row) + col_start * nBytes;
+ const uint8_t* src_scan = GetScanline(row) + col_start * nBytes;
if (nBytes == 1)
for (int col = col_start; col < col_end; col ++) {
*dest_scan = *src_scan++;
@@ -137,11 +137,11 @@ CFX_DIBitmap* CFX_DIBSource::SwapXY(FX_BOOL bXFlip, FX_BOOL bYFlip, const FX_REC
int dest_step = bYFlip ? -dest_pitch : dest_pitch;
for (int row = row_start; row < row_end; row ++) {
int dest_col = (bXFlip ? dest_clip.right - (row - row_start) - 1 : row) - dest_clip.left;
- FX_LPBYTE dest_scan = dest_buf + dest_col;
+ uint8_t* dest_scan = dest_buf + dest_col;
if (bYFlip) {
dest_scan += (result_height - 1) * dest_pitch;
}
- FX_LPCBYTE src_scan = m_pAlphaMask->GetScanline(row) + col_start;
+ const uint8_t* src_scan = m_pAlphaMask->GetScanline(row) + col_start;
for (int col = col_start; col < col_end; col ++) {
*dest_scan = *src_scan++;
dest_scan += dest_step;
@@ -259,24 +259,24 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineM
m_Status = 3;
return TRUE;
}
-uint8_t _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
+uint8_t _bilinear_interpol(const uint8_t* buf, int row_offset_l, int row_offset_r,
int src_col_l, int src_col_r, int res_x, int res_y,
int bpp, int c_offset)
{
int i_resx = 255 - res_x;
int col_bpp_l = src_col_l * bpp;
int col_bpp_r = src_col_r * bpp;
- FX_LPCBYTE buf_u = buf + row_offset_l + c_offset;
- FX_LPCBYTE buf_d = buf + row_offset_r + c_offset;
- FX_LPCBYTE src_pos0 = buf_u + col_bpp_l;
- FX_LPCBYTE src_pos1 = buf_u + col_bpp_r;
- FX_LPCBYTE src_pos2 = buf_d + col_bpp_l;
- FX_LPCBYTE src_pos3 = buf_d + col_bpp_r;
+ const uint8_t* buf_u = buf + row_offset_l + c_offset;
+ const uint8_t* buf_d = buf + row_offset_r + c_offset;
+ const uint8_t* src_pos0 = buf_u + col_bpp_l;
+ const uint8_t* src_pos1 = buf_u + col_bpp_r;
+ const uint8_t* src_pos2 = buf_d + col_bpp_l;
+ const uint8_t* src_pos3 = buf_d + col_bpp_r;
uint8_t r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
uint8_t r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8;
}
-uint8_t _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
+uint8_t _bicubic_interpol(const uint8_t* buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
int bpp, int c_offset)
{
int s_result = 0;
@@ -361,8 +361,8 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (m_Storer.GetBitmap() == NULL) {
return FALSE;
}
- FX_LPCBYTE stretch_buf = m_Storer.GetBitmap()->GetBuffer();
- FX_LPCBYTE stretch_buf_mask = NULL;
+ const uint8_t* stretch_buf = m_Storer.GetBitmap()->GetBuffer();
+ const uint8_t* stretch_buf_mask = NULL;
if (m_Storer.GetBitmap()->m_pAlphaMask) {
stretch_buf_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetBuffer();
}
@@ -463,7 +463,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -492,7 +492,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -514,7 +514,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else {
CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_LPBYTE dest_scan = (FX_LPBYTE)pTransformed->GetScanline(row);
+ uint8_t* dest_scan = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);
@@ -525,7 +525,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (src_row == stretch_height) {
src_row --;
}
- FX_LPCBYTE src_pixel = stretch_buf + stretch_pitch * src_row + src_col;
+ const uint8_t* src_pixel = stretch_buf + stretch_pitch * src_row + src_col;
*dest_scan = *src_pixel;
}
dest_scan ++;
@@ -762,7 +762,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (src_row == stretch_height) {
src_row --;
}
- FX_LPCBYTE src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp;
+ const uint8_t* src_pos = stretch_buf + src_row * stretch_pitch + src_col * Bpp;
if (bHasAlpha) {
if (transformF != FXDIB_Argb) {
if (transformF == FXDIB_Rgba) {