summaryrefslogtreecommitdiff
path: root/core/src/fxge/dib
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxge/dib')
-rw-r--r--core/src/fxge/dib/fx_dib_composite.cpp328
-rw-r--r--core/src/fxge/dib/fx_dib_convert.cpp66
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp86
-rw-r--r--core/src/fxge/dib/fx_dib_main.cpp62
-rw-r--r--core/src/fxge/dib/fx_dib_transform.cpp64
5 files changed, 303 insertions, 303 deletions
diff --git a/core/src/fxge/dib/fx_dib_composite.cpp b/core/src/fxge/dib/fx_dib_composite.cpp
index e385bc9ffe..970325a2d4 100644
--- a/core/src/fxge/dib/fx_dib_composite.cpp
+++ b/core/src/fxge/dib/fx_dib_composite.cpp
@@ -7,7 +7,7 @@
#include "../../../include/fxge/fx_ge.h"
#include "../../../include/fxcodec/fx_codec.h"
#include "dib_int.h"
-const FX_BYTE g_GammaRamp[256] = {
+const uint8_t g_GammaRamp[256] = {
0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7,
@@ -25,7 +25,7 @@ const FX_BYTE g_GammaRamp[256] = {
190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220,
222, 224, 226, 229, 231, 233, 235, 237, 239, 242, 244, 246, 248, 250, 253, 255,
};
-const FX_BYTE g_GammaInverse[256] = {
+const uint8_t g_GammaInverse[256] = {
0, 13, 22, 28, 34, 38, 42, 46, 50, 53, 56, 59, 61, 64, 66, 69,
71, 73, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 93, 95, 96, 98,
99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 117, 118, 119,
@@ -43,7 +43,7 @@ const FX_BYTE g_GammaInverse[256] = {
241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 246, 247, 247, 248,
248, 249, 249, 250, 250, 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255,
};
-const FX_BYTE _color_sqrt[256] = {
+const uint8_t _color_sqrt[256] = {
0x00, 0x03, 0x07, 0x0B, 0x0F, 0x12, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x26, 0x29, 0x2C, 0x2F, 0x32,
0x35, 0x37, 0x3A, 0x3C, 0x3F, 0x41, 0x43, 0x46, 0x48, 0x4A, 0x4C, 0x4E, 0x50, 0x52, 0x54, 0x56,
0x57, 0x59, 0x5B, 0x5C, 0x5E, 0x60, 0x61, 0x63, 0x64, 0x65, 0x67, 0x68, 0x69, 0x6B, 0x6C, 0x6D,
@@ -227,7 +227,7 @@ static _RGB _SetSat(_RGB color, int s)
}
return color;
}
-void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, FX_BYTE* dest_scan, int results[3])
+void _RGB_Blend(int blend_mode, FX_LPCBYTE src_scan, uint8_t* dest_scan, int results[3])
{
_RGB src, back, result;
src.red = src_scan[2];
@@ -262,7 +262,7 @@ inline void _CompositeRow_Argb2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -279,7 +279,7 @@ void _CompositeRow_Rgba2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_alpha_scan, int
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -312,7 +312,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
int blended_color;
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
@@ -331,7 +331,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 3;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -343,7 +343,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -360,7 +360,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
} else
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = src_scan[3];
if (clip_scan) {
@@ -379,7 +379,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 4;
continue;
}
- FX_BYTE src_alpha = src_scan[3];
+ uint8_t src_alpha = src_scan[3];
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -391,7 +391,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -406,7 +406,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
@@ -425,7 +425,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 3;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -437,7 +437,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -450,7 +450,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
} else
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dst_alpha_scan;
+ uint8_t back_alpha = *dst_alpha_scan;
if (back_alpha == 0) {
int src_alpha = src_scan[3];
if (clip_scan) {
@@ -469,7 +469,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
src_scan += 4;
continue;
}
- FX_BYTE src_alpha = src_scan[3];
+ uint8_t src_alpha = src_scan[3];
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -481,7 +481,7 @@ void _CompositeRow_Argb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixe
}
*dst_alpha_scan = FXDIB_ALPHA_UNION(back_alpha, src_alpha);
int alpha_ratio = src_alpha * 255 / (*dst_alpha_scan);
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -498,7 +498,7 @@ inline void _CompositeRow_Argb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, in
FX_LPCBYTE src_alpha_scan, void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
@@ -589,7 +589,7 @@ inline void _CompositeRow_Rgb2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
void* pIccTransform)
{
ICodec_IccModule* pIccModule = NULL;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
}
@@ -665,10 +665,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -707,10 +707,10 @@ void _CompositeRow_Rgb2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int src_B
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
- FX_BYTE gray;
+ uint8_t gray;
if (pIccTransform) {
pIccModule->TranslateScanline(pIccTransform, &gray, src_scan, 1);
} else {
@@ -728,7 +728,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
if (dest_alpha_scan == NULL) {
if (src_alpha_scan == NULL) {
- FX_BYTE back_alpha = 0;
+ uint8_t back_alpha = 0;
for (int col = 0; col < pixel_count; col ++) {
back_alpha = dest_scan[3];
if (back_alpha == 0) {
@@ -742,7 +742,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -753,7 +753,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -776,7 +776,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
}
} else {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -789,7 +789,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -800,7 +800,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan += 3;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -824,7 +824,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
} else {
if (src_alpha_scan) {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -842,7 +842,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -854,7 +854,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -875,7 +875,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
}
} else {
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -893,7 +893,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
src_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -905,7 +905,7 @@ void _CompositeRow_Argb2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int pixel
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -936,7 +936,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
int src_gap = src_Bpp - 3;
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (src_Bpp == 4) {
FXARGB_SETDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
@@ -964,7 +964,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -998,7 +998,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
if (dest_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -1012,7 +1012,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1033,7 +1033,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
} else {
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan++ = *src_scan++;
*dest_scan++ = *src_scan++;
@@ -1048,7 +1048,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE sr
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1088,7 +1088,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -1117,7 +1117,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -1161,7 +1161,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1188,7 +1188,7 @@ inline void _CompositeRow_Argb2Rgb_Blend(FX_LPBYTE dest_scan, FX_LPCBYTE src_sca
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -1220,7 +1220,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s
int dest_gap = dest_Bpp - 3;
if (src_alpha_scan == NULL) {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1249,7 +1249,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_s
}
} else {
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -1306,7 +1306,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip(FX_LPBYTE dest_scan, FX_LPCBYTE src
int dest_gap = dest_Bpp - 3;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
+ uint8_t src_alpha = *clip_scan ++;
if (src_alpha == 0) {
dest_scan += dest_Bpp;
src_scan += src_Bpp;
@@ -1396,7 +1396,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -1414,7 +1414,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -1427,7 +1427,7 @@ void _CompositeRow_Argb2Argb_Transform(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1527,7 +1527,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_Transform(FX_LPBYTE dest_scan, FX_LPCBY
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1566,7 +1566,7 @@ inline void _CompositeRow_Argb2Rgb_NoBlend_Transform(FX_LPBYTE dest_scan, FX_LPC
int dest_gap = dest_Bpp - 3;
for (int col = 0; col < width; col ++) {
pIccModule->TranslateScanline(pIccTransform, src_cache_scan, src_scan, 1);
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -1669,7 +1669,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
@@ -1689,7 +1689,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
int src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
@@ -1707,7 +1707,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
if (bNonseparableBlend) {
blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
}
@@ -1723,7 +1723,7 @@ inline void _CompositeRow_8bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
if (clip_scan && clip_scan[col] < 255) {
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
} else {
@@ -1743,9 +1743,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan ++;
if (clip_scan) {
@@ -1759,7 +1759,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -1781,9 +1781,9 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
int src_alpha = *src_alpha_scan ++;
if (clip_scan) {
@@ -1797,7 +1797,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha = *src_alpha_scan++;
+ uint8_t src_alpha = *src_alpha_scan++;
if (clip_scan) {
src_alpha = clip_scan[col] * src_alpha / 255;
}
@@ -1817,7 +1817,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
@@ -1831,7 +1831,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1844,7 +1844,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = pPalette[*src_scan];
+ uint8_t gray = pPalette[*src_scan];
src_scan ++;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
@@ -1858,7 +1858,7 @@ inline void _CompositeRow_8bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
@@ -1875,7 +1875,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (bNonseparableBlend) {
blended_color = blend_type == FXDIB_BLEND_LUMINOSITY ? gray : *dest_scan;
}
@@ -1890,7 +1890,7 @@ inline void _CompositeRow_1bppPal2Gray(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan,
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan && clip_scan[col] < 255) {
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, clip_scan[col]);
} else {
@@ -1909,7 +1909,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int blended_color;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
*dest_alpha_scan ++ = 255;
@@ -1922,7 +1922,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
@@ -1935,7 +1935,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
return;
}
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
+ uint8_t gray = (src_scan[(col + src_left) / 8] & (1 << (7 - (col + src_left) % 8))) ? set_gray : reset_gray;
if (clip_scan == NULL || clip_scan[col] == 255) {
*dest_scan++ = gray;
*dest_alpha_scan ++ = 255;
@@ -1948,7 +1948,7 @@ inline void _CompositeRow_1bppPal2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, gray, alpha_ratio);
@@ -1968,7 +1968,7 @@ inline void _CompositeRow_8bppRgb2Rgb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE sr
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
src_scan ++;
- FX_BYTE src_alpha = 0;
+ uint8_t src_alpha = 0;
if (clip_scan) {
src_alpha = (*src_alpha_scan++) * (*clip_scan++) / 255;
} else {
@@ -2069,7 +2069,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
int src_r = FXARGB_R(argb);
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -2081,7 +2081,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan ++;
} else {
@@ -2091,7 +2091,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2123,7 +2123,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2147,7 +2147,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
int src_r = FXARGB_R(argb);
int src_g = FXARGB_G(argb);
int src_b = FXARGB_B(argb);
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * (*src_alpha_scan) / 255;
@@ -2161,7 +2161,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
src_alpha_scan ++;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = *src_alpha_scan++;
} else {
@@ -2172,7 +2172,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2204,7 +2204,7 @@ void _CompositeRow_8bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2251,7 +2251,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE s
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2300,7 +2300,7 @@ void _CompositeRow_1bppRgb2Rgba_NoBlend(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan
continue;
}
int back_alpha = *dest_alpha_scan;
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_b, alpha_ratio);
@@ -2321,7 +2321,7 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
@@ -2331,12 +2331,12 @@ void _CompositeRow_ByteMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2379,7 +2379,7 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_b;
*dest_scan ++ = src_g;
@@ -2392,12 +2392,12 @@ void _CompositeRow_ByteMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2447,7 +2447,7 @@ void _CompositeRow_ByteMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2486,7 +2486,7 @@ void _CompositeRow_ByteMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -2522,7 +2522,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_gray;
*dest_alpha_scan ++ = src_alpha;
@@ -2533,7 +2533,7 @@ void _CompositeRow_ByteMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
@@ -2564,18 +2564,18 @@ void _CompositeRow_BitMask2Argb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2636,7 +2636,7 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
*dest_scan ++ = src_b;
*dest_scan ++ = src_g;
@@ -2644,12 +2644,12 @@ void _CompositeRow_BitMask2Rgba(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
*dest_alpha_scan ++ = mask_alpha;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2714,7 +2714,7 @@ void _CompositeRow_BitMask2Rgb(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int mas
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
+ uint8_t src_scan[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -2757,7 +2757,7 @@ void _CompositeRow_BitMask2Mask(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int ma
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = *dest_scan;
+ uint8_t back_alpha = *dest_scan;
if (!back_alpha) {
*dest_scan = src_alpha;
} else if (src_alpha) {
@@ -2802,7 +2802,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = *dest_alpha_scan;
+ uint8_t back_alpha = *dest_alpha_scan;
if (back_alpha == 0) {
*dest_scan ++ = src_gray;
*dest_alpha_scan ++ = src_alpha;
@@ -2813,7 +2813,7 @@ void _CompositeRow_BitMask2Graya(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int m
dest_alpha_scan ++;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_alpha_scan++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, src_gray, alpha_ratio);
@@ -2825,7 +2825,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < pixel_count; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (clip_scan) {
int src_alpha = clip_scan[col] * src_scan[3] / 255;
@@ -2840,7 +2840,7 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
src_scan += 4;
continue;
}
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan == NULL) {
src_alpha = src_scan[3];
} else {
@@ -2851,11 +2851,11 @@ void _CompositeRow_Argb2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_sc
src_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2883,7 +2883,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
if (src_Bpp == 4) {
FXARGB_SETRGBORDERDIB(dest_scan, 0xff000000 | FXARGB_GETDIB(src_scan));
@@ -2896,7 +2896,7 @@ void _CompositeRow_Rgb2Argb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
}
dest_scan[3] = 0xff;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2919,7 +2919,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
int blended_colors[3];
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -2931,7 +2931,7 @@ inline void _CompositeRow_Argb2Rgb_Blend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LP
continue;
}
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2968,7 +2968,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan,
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -2990,7 +2990,7 @@ inline void _CompositeRow_Rgb2Rgb_Blend_NoClip_RgbByteOrder(FX_LPBYTE dest_scan,
inline void _CompositeRow_Argb2Rgb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan, int width, int dest_Bpp, FX_LPCBYTE clip_scan)
{
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha;
+ uint8_t src_alpha;
if (clip_scan) {
src_alpha = src_scan[3] * (*clip_scan++) / 255;
} else {
@@ -3035,7 +3035,7 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
int src_alpha = *clip_scan ++;
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
dest_scan[2] = FX_GAMMA(*src_scan++);
dest_scan[1] = FX_GAMMA(*src_scan++);
@@ -3049,11 +3049,11 @@ inline void _CompositeRow_Rgb2Argb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan,
src_scan += src_Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -3078,14 +3078,14 @@ inline void _CompositeRow_Rgb2Rgb_Blend_Clip_RgbByteOrder(FX_LPBYTE dest_scan, F
FX_BOOL bNonseparableBlend = blend_type >= FXDIB_BLEND_NONSEPARABLE;
int src_gap = src_Bpp - 3;
for (int col = 0; col < width; col ++) {
- FX_BYTE src_alpha = *clip_scan ++;
+ uint8_t src_alpha = *clip_scan ++;
if (src_alpha == 0) {
dest_scan += dest_Bpp;
src_scan += src_Bpp;
continue;
}
if (bNonseparableBlend) {
- FX_BYTE dest_scan_o[3];
+ uint8_t dest_scan_o[3];
dest_scan_o[0] = dest_scan[2];
dest_scan_o[1] = dest_scan[1];
dest_scan_o[2] = dest_scan[0];
@@ -3124,7 +3124,7 @@ inline void _CompositeRow_Rgb2Argb_NoBlend_Clip_RgbByteOrder(FX_LPBYTE dest_scan
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for (int color = 0; color < 3; color ++) {
@@ -3247,7 +3247,7 @@ inline void _CompositeRow_8bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
@@ -3298,7 +3298,7 @@ inline void _CompositeRow_1bppRgb2Argb_NoBlend_RgbByteOrder(FX_LPBYTE dest_scan,
continue;
}
int back_alpha = dest_scan[3];
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
dest_scan[2] = FXDIB_ALPHA_MERGE(dest_scan[2], FX_GAMMA(src_b), alpha_ratio);
@@ -3317,7 +3317,7 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr
} else {
src_alpha = mask_alpha * src_scan[col] / 255;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
@@ -3327,13 +3327,13 @@ void _CompositeRow_ByteMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE sr
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3378,8 +3378,8 @@ void _CompositeRow_ByteMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3429,19 +3429,19 @@ void _CompositeRow_BitMask2Argb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src
} else {
src_alpha = mask_alpha;
}
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETRGBORDERDIB(dest_scan, FXARGB_MAKE(src_alpha, src_r, src_g, src_b));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
dest_scan[3] = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3501,8 +3501,8 @@ void _CompositeRow_BitMask2Rgb_RgbByteOrder(FX_LPBYTE dest_scan, FX_LPCBYTE src_
}
if (blend_type >= FXDIB_BLEND_NONSEPARABLE) {
int blended_colors[3];
- FX_BYTE src_scan[3];
- FX_BYTE dest_scan_o[3];
+ uint8_t src_scan[3];
+ uint8_t dest_scan_o[3];
src_scan[0] = src_b;
src_scan[1] = src_g;
src_scan[2] = src_r;
@@ -3559,7 +3559,7 @@ inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format, int
mask_red = dest_format & 0x0400 ? FX_CCOLOR(gray_p[0]) : gray_p[0];
} else {
if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(mask_red, mask_green, mask_blue, mask_black,
r, g, b);
mask_red = FXRGB2GRAY(r, g, b);
@@ -3600,7 +3600,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (pSrcPalette) {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
pDestPalette = (FX_DWORD*)gray_pal;
for (int i = 0; i < pal_count; i ++) {
FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i]) : FXARGB_TODIB(pSrcPalette[i]);
@@ -3618,7 +3618,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
}
} else {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3643,12 +3643,12 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (pSrcPalette) {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
pDestPalette = (FX_DWORD*)gray_pal;
if (isSrcCmyk) {
for (int i = 0; i < pal_count; i ++) {
FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
*gray_pal ++ = FXRGB2GRAY(r, g, b);
@@ -3666,7 +3666,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
} else {
for (int i = 0; i < palsize; i ++) {
FX_CMYK cmyk = pSrcPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -3676,7 +3676,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
} else {
if ((dest_format & 0xff) == 8) {
int pal_count = 1 << (src_format & 0xff);
- FX_LPBYTE gray_pal = FX_Alloc(FX_BYTE, pal_count);
+ FX_LPBYTE gray_pal = FX_Alloc(uint8_t, pal_count);
if (pal_count == 2) {
gray_pal[0] = 0;
gray_pal[1] = 255;
@@ -3700,7 +3700,7 @@ inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format, FXDIB
if (isSrcCmyk != isDstCmyk) {
for (int i = 0; i < palsize; i ++) {
FX_CMYK cmyk = pDestPalette[i];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(cmyk), FXSYS_GetMValue(cmyk), FXSYS_GetYValue(cmyk), FXSYS_GetKValue(cmyk),
r, g, b);
pDestPalette[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -3727,7 +3727,7 @@ CFX_ScanlineCompositor::~CFX_ScanlineCompositor()
FX_Free(m_pCacheScanline);
}
}
-FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, FX_INT32 width, FX_DWORD* pSrcPalette,
+FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format, FXDIB_Format src_format, int32_t width, FX_DWORD* pSrcPalette,
FX_DWORD mask_color, int blend_type, FX_BOOL bClip, FX_BOOL bRgbByteOrder, int alpha_flag, void* pIccTransform)
{
m_SrcFormat = src_format;
@@ -3861,7 +3861,7 @@ void CFX_ScanlineCompositor::CompositeRgbBitmapLine(FX_LPBYTE dest_scan, FX_LPCB
} else {
int dest_Size = width * dest_Bpp + 4;
if (dest_Size > m_CacheSize) {
- m_pCacheScanline = FX_Realloc(FX_BYTE, m_pCacheScanline, dest_Size);
+ m_pCacheScanline = FX_Realloc(uint8_t, m_pCacheScanline, dest_Size);
if (!m_pCacheScanline) {
return;
}
@@ -4158,7 +4158,7 @@ FX_BOOL CFX_DIBitmap::CompositeMask(int dest_left, int dest_top, int width, int
if (width == 0 || height == 0) {
return TRUE;
}
- int src_alpha = (FX_BYTE)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
+ int src_alpha = (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
if (src_alpha == 0) {
return TRUE;
}
@@ -4214,19 +4214,19 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
FX_LPBYTE color_p = (FX_LPBYTE)&dst_color;
if (m_bpp == 8) {
- FX_BYTE gray = 255;
+ uint8_t gray = 255;
if (!IsAlphaMask()) {
if (pIccTransform && CFX_GEModule::Get()->GetCodecModule() && CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
pIccModule->TranslateScanline(pIccTransform, &gray, color_p, 1);
} else {
if (alpha_flag >> 8) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(color_p[0], color_p[1], color_p[2], color_p[3],
r, g, b);
gray = FXRGB2GRAY(r, g, b);
} else {
- gray = (FX_BYTE)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
+ gray = (uint8_t)FXRGB2GRAY((int)color_p[2], color_p[1], color_p[0]);
}
}
if (IsCmykImage()) {
@@ -4245,13 +4245,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
return TRUE;
} else if (m_bpp == 1) {
- ASSERT(!IsCmykImage() && (FX_BYTE)(alpha_flag >> 8) == 0);
+ ASSERT(!IsCmykImage() && (uint8_t)(alpha_flag >> 8) == 0);
int left_shift = rect.left % 8;
int right_shift = rect.right % 8;
int width = rect.right / 8 - rect.left / 8;
int index = 0;
if (m_pPalette == NULL) {
- index = ((FX_BYTE)color == 0xff) ? 1 : 0;
+ index = ((uint8_t)color == 0xff) ? 1 : 0;
} else {
for (int i = 0; i < 2; i ++)
if (m_pPalette[i] == color) {
@@ -4259,10 +4259,10 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
}
for (int row = rect.top; row < rect.bottom; row ++) {
- FX_BYTE* dest_scan_top = (FX_BYTE*)GetScanline(row) + rect.left / 8;
- FX_BYTE* dest_scan_top_r = (FX_BYTE*)GetScanline(row) + rect.right / 8;
- FX_BYTE left_flag = *dest_scan_top & (255 << (8 - left_shift));
- FX_BYTE right_flag = *dest_scan_top_r & (255 >> right_shift);
+ uint8_t* dest_scan_top = (uint8_t*)GetScanline(row) + rect.left / 8;
+ uint8_t* dest_scan_top_r = (uint8_t*)GetScanline(row) + rect.right / 8;
+ uint8_t left_flag = *dest_scan_top & (255 << (8 - left_shift));
+ uint8_t right_flag = *dest_scan_top_r & (255 >> right_shift);
if (width) {
FXSYS_memset8(dest_scan_top + 1, index ? 255 : 0, width - 1);
if (!index) {
@@ -4298,7 +4298,7 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
}
}
if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)src_alpha;
+ color_p[3] = (uint8_t)src_alpha;
}
int Bpp = m_bpp / 8;
FX_BOOL bAlpha = HasAlpha();
@@ -4330,13 +4330,13 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
if (bAlpha) {
if (bArgb) {
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = dest_scan[3];
+ uint8_t back_alpha = dest_scan[3];
if (back_alpha == 0) {
FXARGB_SETDIB(dest_scan, FXARGB_MAKE(src_alpha, color_p[2], color_p[1], color_p[0]));
dest_scan += 4;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
int alpha_ratio = src_alpha * 255 / dest_alpha;
*dest_scan = FXDIB_ALPHA_MERGE(*dest_scan, color_p[0], alpha_ratio);
dest_scan ++;
@@ -4349,14 +4349,14 @@ FX_BOOL CFX_DIBitmap::CompositeRect(int left, int top, int width, int height, FX
} else {
FX_LPBYTE dest_scan_alpha = (FX_LPBYTE)m_pAlphaMask->GetScanline(row) + rect.left;
for (int col = 0; col < width; col ++) {
- FX_BYTE back_alpha = *dest_scan_alpha;
+ uint8_t back_alpha = *dest_scan_alpha;
if (back_alpha == 0) {
*dest_scan_alpha++ = src_alpha;
FXSYS_memcpy32(dest_scan, color_p, Bpp);
dest_scan += Bpp;
continue;
}
- FX_BYTE dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
+ uint8_t dest_alpha = back_alpha + src_alpha - back_alpha * src_alpha / 255;
*dest_scan_alpha ++ = dest_alpha;
int alpha_ratio = src_alpha * 255 / dest_alpha;
for(int comps = 0; comps < Bpp; comps ++) {
@@ -4437,14 +4437,14 @@ FX_BOOL CFX_BitmapComposer::SetInfo(int width, int height, FXDIB_Format src_form
return FALSE;
}
if (m_bVertical) {
- m_pScanlineV = FX_Alloc(FX_BYTE, m_pBitmap->GetBPP() / 8 * width + 4);
- m_pClipScanV = FX_Alloc(FX_BYTE, m_pBitmap->GetHeight());
+ m_pScanlineV = FX_Alloc(uint8_t, m_pBitmap->GetBPP() / 8 * width + 4);
+ m_pClipScanV = FX_Alloc(uint8_t, m_pBitmap->GetHeight());
if (m_pBitmap->m_pAlphaMask) {
- m_pScanlineAlphaV = FX_Alloc(FX_BYTE, width + 4);
+ m_pScanlineAlphaV = FX_Alloc(uint8_t, width + 4);
}
}
if (m_BitmapAlpha < 255) {
- m_pAddClipScan = FX_Alloc(FX_BYTE, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
+ m_pAddClipScan = FX_Alloc(uint8_t, m_bVertical ? m_pBitmap->GetHeight() : m_pBitmap->GetWidth());
}
return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index 7ab2417a57..b4fdd3a1ba 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -117,7 +117,7 @@ public:
{
return m_aLut;
}
- FX_INT32 Getlut()const
+ int32_t Getlut()const
{
return m_lut;
}
@@ -159,11 +159,11 @@ void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r)
_Qsort(alut, clut, pI + 1, r);
}
}
-void _ColorDecode(FX_DWORD pal_v, FX_BYTE& r, FX_BYTE& g, FX_BYTE& b)
+void _ColorDecode(FX_DWORD pal_v, uint8_t& r, uint8_t& g, uint8_t& b)
{
- r = (FX_BYTE)((pal_v & 0xf00) >> 4);
- g = (FX_BYTE)(pal_v & 0x0f0);
- b = (FX_BYTE)((pal_v & 0x00f) << 4);
+ r = (uint8_t)((pal_v & 0xf00) >> 4);
+ g = (uint8_t)(pal_v & 0x0f0);
+ b = (uint8_t)((pal_v & 0x00f) << 4);
}
void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type, FX_DWORD* win_mac_pal, FX_DWORD lut)
{
@@ -176,7 +176,7 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type
lut_offset += 256;
}
FX_DWORD color = cLut[lut_offset];
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(color, r, g, b);
dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000;
aLut[lut_offset] = row;
@@ -187,15 +187,15 @@ void _Obtain_Pal(FX_DWORD* aLut, FX_DWORD*cLut, FX_DWORD* dest_pal, int pal_type
if (lut_offset < 0) {
lut_offset += 256;
}
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(cLut[lut_offset], r, g, b);
int error, min_error = 1000000;
int c_index = 0;
for (col = 0; col < 256; col++) {
FX_DWORD p_color = win_mac_pal[col];
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)p_color;
+ int d_r = r - (uint8_t)(p_color >> 16);
+ int d_g = g - (uint8_t)(p_color >> 8);
+ int d_b = b - (uint8_t)p_color;
error = d_r * d_r + d_g * d_g + d_b * d_b;
if (error < min_error) {
min_error = error;
@@ -252,9 +252,9 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
int row, col;
m_lut = 0;
for (row = 0; row < height; row++) {
- FX_BYTE* scan_line = (FX_BYTE*)pBitmap->GetScanline(row);
+ uint8_t* scan_line = (uint8_t*)pBitmap->GetScanline(row);
for (col = 0; col < width; col++) {
- FX_BYTE* src_port = scan_line + col * bpp;
+ uint8_t* src_port = scan_line + col * bpp;
FX_DWORD b = src_port[0] & 0xf0;
FX_DWORD g = src_port[1] & 0xf0;
FX_DWORD r = src_port[2] & 0xf0;
@@ -282,7 +282,7 @@ FX_BOOL CFX_Palette::BuildPalette(const CFX_DIBSource* pBitmap, int pal_type)
FX_BOOL _ConvertBuffer_1bppMask2Gray(FX_LPBYTE dest_buf, int dest_pitch, int width, int height,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
- FX_BYTE set_gray, reset_gray;
+ uint8_t set_gray, reset_gray;
set_gray = 0xff;
reset_gray = 0x00;
for (int row = 0; row < height; row ++) {
@@ -312,7 +312,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[2];
+ uint8_t gray[2];
if (pIccTransform) {
FX_DWORD plt[2];
if (pSrcBitmap->IsCmykImage()) {
@@ -330,7 +330,7 @@ FX_BOOL _ConvertBuffer_1bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 2);
} else {
- FX_BYTE reset_r, reset_g, reset_b,
+ uint8_t reset_r, reset_g, reset_b,
set_r, set_g, set_b;
if (pSrcBitmap->IsCmykImage()) {
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[0]), FXSYS_GetMValue(src_plt[0]), FXSYS_GetYValue(src_plt[0]), FXSYS_GetKValue(src_plt[0]),
@@ -365,7 +365,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top, void* pIccTransform)
{
FX_DWORD* src_plt = pSrcBitmap->GetPalette();
- FX_BYTE gray[256];
+ uint8_t gray[256];
if (pIccTransform) {
FX_DWORD plt[256];
if (pSrcBitmap->IsCmykImage()) {
@@ -384,7 +384,7 @@ FX_BOOL _ConvertBuffer_8bppPlt2Gray(FX_LPBYTE dest_buf, int dest_pitch, int widt
pIccModule->TranslateScanline(pIccTransform, gray, (FX_LPCBYTE)plt, 256);
} else {
if (pSrcBitmap->IsCmykImage()) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
for (int i = 0; i < 256; i ++) {
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
r, g, b);
@@ -433,7 +433,7 @@ FX_BOOL _ConvertBuffer_RgbOrCmyk2Gray(FX_LPBYTE dest_buf, int dest_pitch, int wi
FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
for (int col = 0; col < width; col ++) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]), FXSYS_GetMValue((FX_DWORD)src_scan[1]), FXSYS_GetYValue((FX_DWORD)src_scan[2]), FXSYS_GetKValue((FX_DWORD)src_scan[3]),
r, g, b);
*dest_scan++ = FXRGB2GRAY(r, g, b);
@@ -506,7 +506,7 @@ FX_BOOL _ConvertBuffer_Plt2PltRgb8(FX_LPBYTE dest_buf, int dest_pitch, int width
} else {
if (pSrcBitmap->IsCmykImage()) {
for (int i = 0; i < plt_size; i ++) {
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(src_plt[i]), FXSYS_GetMValue(src_plt[i]), FXSYS_GetYValue(src_plt[i]), FXSYS_GetKValue(src_plt[i]),
r, g, b);
dst_plt[i] = FXARGB_MAKE(0xff, r, g, b);
@@ -536,14 +536,14 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de
int lut_256 = lut - 256;
for (row = 0; row < lut_256; row++) {
min_err = 1000000;
- FX_BYTE r, g, b;
+ uint8_t r, g, b;
_ColorDecode(cLut[row], r, g, b);
int clrindex = 0;
for (int col = 0; col < 256; col++) {
FX_DWORD p_color = *(pPalette + col);
- int d_r = r - (FX_BYTE)(p_color >> 16);
- int d_g = g - (FX_BYTE)(p_color >> 8);
- int d_b = b - (FX_BYTE)(p_color);
+ int d_r = r - (uint8_t)(p_color >> 16);
+ int d_g = g - (uint8_t)(p_color >> 8);
+ int d_b = b - (uint8_t)(p_color);
err = d_r * d_r + d_g * d_g + d_b * d_b;
if (err < min_err) {
min_err = err;
@@ -553,19 +553,19 @@ inline FX_BOOL _ConvertBuffer_Rgb2PltRgb8_NoTransform(FX_LPBYTE dest_buf, int de
aLut[row] = clrindex;
}
}
- FX_INT32 lut_1 = lut - 1;
+ int32_t lut_1 = lut - 1;
for (row = 0; row < height; row ++) {
- FX_BYTE* src_scan = (FX_BYTE*)pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE* dest_scan = dest_buf + row * dest_pitch;
+ uint8_t* src_scan = (uint8_t*)pSrcBitmap->GetScanline(src_top + row) + src_left;
+ uint8_t* dest_scan = dest_buf + row * dest_pitch;
for (col = 0; col < width; col++) {
- FX_BYTE* src_port = src_scan + col * bpp;
+ uint8_t* src_port = src_scan + col * bpp;
int r = src_port[2] & 0xf0;
int g = src_port[1] & 0xf0;
int b = src_port[0] & 0xf0;
FX_DWORD clrindex = (r << 4) + g + (b >> 4);
for (int i = lut_1; i >= 0; i--)
if (clrindex == cLut[i]) {
- *(dest_scan + col) = (FX_BYTE)(aLut[i]);
+ *(dest_scan + col) = (uint8_t)(aLut[i]);
break;
}
}
@@ -596,7 +596,7 @@ FX_BOOL _ConvertBuffer_1bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
const CFX_DIBSource* pSrcBitmap, int src_left, int src_top)
{
int comps = (dst_format & 0xff) / 8;
- FX_BYTE set_gray, reset_gray;
+ uint8_t set_gray, reset_gray;
set_gray = 0xff;
reset_gray = 0x00;
for (int row = 0; row < height; row ++) {
@@ -624,7 +624,7 @@ FX_BOOL _ConvertBuffer_8bppMask2Rgb(FXDIB_Format dst_format, FX_LPBYTE dest_buf,
for (int row = 0; row < height; row ++) {
FX_LPBYTE dest_scan = dest_buf + row * dest_pitch;
FX_LPCBYTE src_scan = pSrcBitmap->GetScanline(src_top + row) + src_left;
- FX_BYTE src_pixel;
+ uint8_t src_pixel;
for (int col = 0; col < width; col ++) {
src_pixel = *src_scan++;
*dest_scan++ = src_pixel;
@@ -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(FX_BYTE, dest_pitch * m_Height + 4);
+ FX_LPBYTE dest_buf = FX_TryAlloc(uint8_t, dest_pitch * m_Height + 4);
if (dest_buf == NULL) {
return FALSE;
}
@@ -1068,8 +1068,8 @@ FX_BOOL CFX_DIBitmap::ConvertFormat(FXDIB_Format dest_format, void* pIccTransfor
}
m_bExtBuf = FALSE;
m_pBuffer = dest_buf;
- m_bpp = (FX_BYTE)dest_format;
- m_AlphaFlag = (FX_BYTE)(dest_format >> 8);
+ m_bpp = (uint8_t)dest_format;
+ m_AlphaFlag = (uint8_t)(dest_format >> 8);
m_Pitch = dest_pitch;
return TRUE;
}
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index 6f8621e2a5..e0b21d2f59 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -28,7 +28,7 @@ void CWeightTable::Calc(int dest_len, int dest_min, int dest_max, int src_len, i
if ((dest_max - dest_min) > (int)((1U << 30) - 4) / m_ItemSize) {
return;
}
- m_pWeightTables = FX_TryAlloc(FX_BYTE, (dest_max - dest_min) * m_ItemSize + 4);
+ m_pWeightTables = FX_TryAlloc(uint8_t, (dest_max - dest_min) * m_ItemSize + 4);
if (m_pWeightTables == NULL) {
return;
}
@@ -202,7 +202,7 @@ CStretchEngine::CStretchEngine(IFX_ScanlineComposer* pDestBitmap, FXDIB_Format d
}
size += 31;
size = size / 32 * 4;
- m_pDestScanline = FX_TryAlloc(FX_BYTE, size);
+ m_pDestScanline = FX_TryAlloc(uint8_t, size);
if (m_pDestScanline == NULL) {
return;
}
@@ -373,7 +373,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ *dest_scan++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -388,7 +388,7 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_a >> 16);
+ *dest_scan++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -406,8 +406,8 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_r = dest_r < 0 ? 0 : dest_r > 16711680 ? 16711680 : dest_r;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_r >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan++ = (uint8_t)(dest_r >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
break;
}
@@ -419,13 +419,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
int pixel_weight = pPixelWeights->m_Weights[j - pPixelWeights->m_SrcStart];
unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
if (m_DestFormat == FXDIB_Rgb) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)argb_cmyk;
} else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8);
}
}
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
@@ -433,9 +433,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
}
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
+ *dest_scan++ = (uint8_t)(dest_b_c >> 16);
+ *dest_scan++ = (uint8_t)(dest_g_m >> 16);
+ *dest_scan++ = (uint8_t)(dest_r_y >> 16);
}
break;
}
@@ -448,13 +448,13 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
pixel_weight = pixel_weight * src_scan_mask[j] / 255;
unsigned long argb_cmyk = m_pSrcPalette[src_scan[j]];
if (m_DestFormat == FXDIB_Rgba) {
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
- dest_b_c += pixel_weight * (FX_BYTE)argb_cmyk;
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)argb_cmyk;
} else {
- dest_b_c += pixel_weight * (FX_BYTE)(argb_cmyk >> 24);
- dest_g_m += pixel_weight * (FX_BYTE)(argb_cmyk >> 16);
- dest_r_y += pixel_weight * (FX_BYTE)(argb_cmyk >> 8);
+ dest_b_c += pixel_weight * (uint8_t)(argb_cmyk >> 24);
+ dest_g_m += pixel_weight * (uint8_t)(argb_cmyk >> 16);
+ dest_r_y += pixel_weight * (uint8_t)(argb_cmyk >> 8);
}
dest_a += pixel_weight;
}
@@ -464,10 +464,10 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)(dest_b_c >> 16);
- *dest_scan++ = (FX_BYTE)(dest_g_m >> 16);
- *dest_scan++ = (FX_BYTE)(dest_r_y >> 16);
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan++ = (uint8_t)(dest_b_c >> 16);
+ *dest_scan++ = (uint8_t)(dest_g_m >> 16);
+ *dest_scan++ = (uint8_t)(dest_r_y >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
break;
}
@@ -487,9 +487,9 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_r_y = dest_r_y < 0 ? 0 : dest_r_y > 16711680 ? 16711680 : dest_r_y;
}
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ *dest_scan++ = (uint8_t)((dest_b_c) >> 16);
+ *dest_scan++ = (uint8_t)((dest_g_m) >> 16);
+ *dest_scan++ = (uint8_t)((dest_r_y) >> 16);
dest_scan += Bpp - 3;
}
break;
@@ -517,14 +517,14 @@ FX_BOOL CStretchEngine::ContinueStretchHorz(IFX_Pause* pPause)
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
dest_a = dest_a < 0 ? 0 : dest_a > 65536 ? 65536 : dest_a;
}
- *dest_scan++ = (FX_BYTE)((dest_b_c) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_g_m) >> 16);
- *dest_scan++ = (FX_BYTE)((dest_r_y) >> 16);
+ *dest_scan++ = (uint8_t)((dest_b_c) >> 16);
+ *dest_scan++ = (uint8_t)((dest_g_m) >> 16);
+ *dest_scan++ = (uint8_t)((dest_r_y) >> 16);
if (m_DestFormat == FXDIB_Argb) {
- *dest_scan = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan = (uint8_t)((dest_a * 255) >> 16);
}
if (dest_scan_mask) {
- *dest_scan_mask++ = (FX_BYTE)((dest_a * 255) >> 16);
+ *dest_scan_mask++ = (uint8_t)((dest_a * 255) >> 16);
}
dest_scan += Bpp - 3;
}
@@ -564,7 +564,7 @@ void CStretchEngine::StretchVert()
if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan = (FX_BYTE)(dest_a >> 16);
+ *dest_scan = (uint8_t)(dest_a >> 16);
dest_scan += DestBpp;
}
break;
@@ -583,9 +583,9 @@ void CStretchEngine::StretchVert()
dest_k = dest_k < 0 ? 0 : dest_k > 16711680 ? 16711680 : dest_k;
dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
}
- *dest_scan = (FX_BYTE)(dest_k >> 16);
+ *dest_scan = (uint8_t)(dest_k >> 16);
dest_scan += DestBpp;
- *dest_sacn_mask++ = (FX_BYTE)(dest_a >> 16);
+ *dest_sacn_mask++ = (uint8_t)(dest_a >> 16);
}
break;
}
@@ -606,9 +606,9 @@ void CStretchEngine::StretchVert()
dest_g_m = dest_g_m < 0 ? 0 : dest_g_m > 16711680 ? 16711680 : dest_g_m;
dest_b_c = dest_b_c < 0 ? 0 : dest_b_c > 16711680 ? 16711680 : dest_b_c;
}
- dest_scan[0] = (FX_BYTE)((dest_b_c) >> 16);
- dest_scan[1] = (FX_BYTE)((dest_g_m) >> 16);
- dest_scan[2] = (FX_BYTE)((dest_r_y) >> 16);
+ dest_scan[0] = (uint8_t)((dest_b_c) >> 16);
+ dest_scan[1] = (uint8_t)((dest_g_m) >> 16);
+ dest_scan[2] = (uint8_t)((dest_r_y) >> 16);
dest_scan += DestBpp;
}
break;
@@ -653,9 +653,9 @@ void CStretchEngine::StretchVert()
dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r;
}
if (m_DestFormat == FXDIB_Argb) {
- dest_scan[3] = (FX_BYTE)((dest_a) >> 16);
+ dest_scan[3] = (uint8_t)((dest_a) >> 16);
} else {
- *dest_sacn_mask = (FX_BYTE)((dest_a) >> 16);
+ *dest_sacn_mask = (uint8_t)((dest_a) >> 16);
}
dest_scan += DestBpp;
if (dest_sacn_mask) {
@@ -798,9 +798,9 @@ FX_BOOL CFX_ImageStretcher::StartQuickStretch()
return FALSE;
}
size *= m_DestBPP;
- m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4);
+ m_pScanline = FX_Alloc(uint8_t, (size / 8 + 3) / 4 * 4);
if (m_pSource->m_pAlphaMask) {
- m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4);
+ m_pMaskScanline = FX_Alloc(uint8_t, (m_ClipRect.Width() + 3) / 4 * 4);
}
if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
ContinueQuickStretch(NULL);
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index 12812b2f8d..74c4276695 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -62,8 +62,8 @@ CFX_DIBitmap::CFX_DIBitmap()
FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBYTE pBuffer, int pitch)
{
m_pBuffer = NULL;
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
+ m_bpp = (uint8_t)format;
+ m_AlphaFlag = (uint8_t)(format >> 8);
m_Width = m_Height = m_Pitch = 0;
if (width <= 0 || height <= 0 || pitch < 0) {
return FALSE;
@@ -84,12 +84,12 @@ FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBY
int size = pitch * height + 4;
int oomlimit = _MAX_OOM_LIMIT_;
if (oomlimit >= 0 && size >= oomlimit) {
- m_pBuffer = FX_TryAlloc(FX_BYTE, size);
+ m_pBuffer = FX_TryAlloc(uint8_t, size);
if (m_pBuffer == NULL) {
return FALSE;
}
} else {
- m_pBuffer = FX_Alloc(FX_BYTE, size);
+ m_pBuffer = FX_Alloc(uint8_t, size);
}
}
m_Width = width;
@@ -273,14 +273,14 @@ int CFX_DIBSource::FindPalette(FX_DWORD color) const
if (m_pPalette == NULL) {
if (IsCmykImage()) {
if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 0 : 1;
+ return ((uint8_t)color == 0xff) ? 0 : 1;
}
- return 0xff - (FX_BYTE)color;
+ return 0xff - (uint8_t)color;
}
if (GetBPP() == 1) {
- return ((FX_BYTE)color == 0xff) ? 1 : 0;
+ return ((uint8_t)color == 0xff) ? 1 : 0;
}
- return (FX_BYTE)color;
+ return (uint8_t)color;
}
int palsize = (1 << GetBPP());
for (int i = 0; i < palsize; i ++)
@@ -463,7 +463,7 @@ FX_BOOL CFX_DIBitmap::TransferMask(int dest_left, int dest_top, int width, int h
}
}
if(!IsCmykImage()) {
- color_p[3] = (FX_BYTE)alpha;
+ color_p[3] = (uint8_t)alpha;
}
if (GetFormat() == FXDIB_Argb) {
for (int row = 0; row < height; row ++) {
@@ -886,12 +886,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
if (m_pPalette == NULL) {
return FALSE;
}
- FX_BYTE gray[2];
+ uint8_t gray[2];
for (int i = 0; i < 2; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ int r = (uint8_t)(m_pPalette[i] >> 16);
+ int g = (uint8_t)(m_pPalette[i] >> 8);
+ int b = (uint8_t)m_pPalette[i];
+ gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
if (!pMask) {
@@ -920,12 +920,12 @@ FX_BOOL CFX_DIBitmap::GetGrayData(void* pIccTransform)
if (m_pPalette == NULL) {
return FALSE;
}
- FX_BYTE gray[256];
+ uint8_t gray[256];
for (int i = 0; i < 256; i ++) {
- int r = (FX_BYTE)(m_pPalette[i] >> 16);
- int g = (FX_BYTE)(m_pPalette[i] >> 8);
- int b = (FX_BYTE)m_pPalette[i];
- gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
+ int r = (uint8_t)(m_pPalette[i] >> 16);
+ int g = (uint8_t)(m_pPalette[i] >> 8);
+ int b = (uint8_t)m_pPalette[i];
+ gray[i] = (uint8_t)FXRGB2GRAY(r, g, b);
}
CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
if (!pMask) {
@@ -1111,13 +1111,13 @@ void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color)
}
break;
case FXDIB_8bppMask:
- *pos = (FX_BYTE)(color >> 24);
+ *pos = (uint8_t)(color >> 24);
break;
case FXDIB_8bppRgb: {
if (m_pPalette) {
for (int i = 0; i < 256; i ++) {
if (m_pPalette[i] == color) {
- *pos = (FX_BYTE)i;
+ *pos = (uint8_t)i;
return;
}
}
@@ -1246,7 +1246,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
int size = 1 << m_bpp;
if (isCmykImage) {
for (int i = 0; i < size; i ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(FXSYS_GetCValue(m_pPalette[i]), FXSYS_GetMValue(m_pPalette[i]), FXSYS_GetYValue(m_pPalette[i]), FXSYS_GetKValue(m_pPalette[i]),
r, g, b);
int gray = 255 - FXRGB2GRAY(r, g, b);
@@ -1266,7 +1266,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
for (int row = 0; row < m_Height; row ++) {
FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
r, g, b);
*scanline ++ = 0;
@@ -1295,7 +1295,7 @@ FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor)
for (int row = 0; row < m_Height; row ++) {
FX_LPBYTE scanline = m_pBuffer + row * m_Pitch;
for (int col = 0; col < m_Width; col ++) {
- FX_BYTE b, g, r;
+ uint8_t b, g, r;
AdobeCMYK_to_sRGB1(scanline[0], scanline[1], scanline[2], scanline[3],
r, g, b);
int gray = 255 - FXRGB2GRAY(r, g, b);
@@ -1335,11 +1335,11 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_
if (pRect) {
rect.Intersect(*pRect);
}
- FX_BYTE translate[256];
+ uint8_t translate[256];
for (int i = 0; i < 256; i ++) {
int err2 = 65536;
for (int j = 0; j < pal_size; j ++) {
- FX_BYTE entry = (FX_BYTE)pPalette[j];
+ uint8_t entry = (uint8_t)pPalette[j];
int err = (int)entry - i;
if (err * err < err2) {
err2 = err * err;
@@ -1353,7 +1353,7 @@ FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette, int pal_size, const FX_
for (int col = rect.left; col < rect.right; col ++) {
int src_pixel = scan[col];
int dest_pixel = translate[src_pixel];
- scan[col] = (FX_BYTE)dest_pixel;
+ scan[col] = (uint8_t)dest_pixel;
int error = -dest_pixel + src_pixel;
if (col < rect.right - 1) {
int src = scan[col + 1];
@@ -1522,11 +1522,11 @@ void CFX_FilteredDIB::LoadSrc(const CFX_DIBSource* pSrc, FX_BOOL bAutoDropSrc)
m_Width = pSrc->GetWidth();
m_Height = pSrc->GetHeight();
FXDIB_Format format = GetDestFormat();
- m_bpp = (FX_BYTE)format;
- m_AlphaFlag = (FX_BYTE)(format >> 8);
+ m_bpp = (uint8_t)format;
+ m_AlphaFlag = (uint8_t)(format >> 8);
m_Pitch = (m_Width * (format & 0xff) + 31) / 32 * 4;
m_pPalette = GetDestPalette();
- m_pScanline = FX_Alloc(FX_BYTE, m_Pitch);
+ m_pScanline = FX_Alloc(uint8_t, m_Pitch);
}
FX_LPCBYTE CFX_FilteredDIB::GetScanline(int line) const
{
@@ -1641,7 +1641,7 @@ FX_BOOL CFX_ImageRenderer::Continue(IFX_Pause* pPause)
if (pBitmap->IsAlphaMask()) {
if (m_BitmapAlpha != 255) {
if (m_AlphaFlag >> 8) {
- m_AlphaFlag = (((FX_BYTE)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
+ m_AlphaFlag = (((uint8_t)((m_AlphaFlag & 0xff) * m_BitmapAlpha / 255)) | ((m_AlphaFlag >> 8) << 8));
} else {
m_MaskColor = FXARGB_MUL_ALPHA(m_MaskColor, m_BitmapAlpha);
}
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index a9a1e66d99..7d91cdba4b 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -259,7 +259,7 @@ FX_BOOL CFX_ImageTransformer::Start(const CFX_DIBSource* pSrc, const CFX_AffineM
m_Status = 3;
return TRUE;
}
-FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
+uint8_t _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
int src_col_l, int src_col_r, int res_x, int res_y,
int bpp, int c_offset)
{
@@ -272,23 +272,23 @@ FX_BYTE _bilinear_interpol(FX_LPCBYTE buf, int row_offset_l, int row_offset_r,
FX_LPCBYTE src_pos1 = buf_u + col_bpp_r;
FX_LPCBYTE src_pos2 = buf_d + col_bpp_l;
FX_LPCBYTE src_pos3 = buf_d + col_bpp_r;
- FX_BYTE r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
- FX_BYTE r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
+ uint8_t r_pos_0 = (*src_pos0 * i_resx + *src_pos1 * res_x) >> 8;
+ uint8_t r_pos_1 = (*src_pos2 * i_resx + *src_pos3 * res_x) >> 8;
return (r_pos_0 * (255 - res_y) + r_pos_1 * res_y) >> 8;
}
-FX_BYTE _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
+uint8_t _bicubic_interpol(FX_LPCBYTE buf, int pitch, int pos_pixel[], int u_w[], int v_w[], int res_x, int res_y,
int bpp, int c_offset)
{
int s_result = 0;
for (int i = 0; i < 4; i ++) {
int a_result = 0;
for (int j = 0; j < 4; j ++) {
- a_result += u_w[j] * (*(FX_BYTE*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
+ a_result += u_w[j] * (*(uint8_t*)(buf + pos_pixel[i + 4] * pitch + pos_pixel[j] * bpp + c_offset));
}
s_result += a_result * v_w[i];
}
s_result >>= 16;
- return (FX_BYTE)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
+ return (uint8_t)(s_result < 0 ? 0 : s_result > 255 ? 255 : s_result);
}
void _bicubic_get_pos_weight(int pos_pixel[], int u_w[], int v_w[], int src_col_l, int src_row_l,
int res_x, int res_y, int stretch_width, int stretch_height)
@@ -390,7 +390,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -419,7 +419,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -441,7 +441,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else {
CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos_mask = (FX_BYTE*)pTransformed->m_pAlphaMask->GetScanline(row);
+ uint8_t* dest_pos_mask = (uint8_t*)pTransformed->m_pAlphaMask->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);
@@ -555,7 +555,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -578,9 +578,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
int row_offset_r = src_row_r * stretch_pitch;
FX_DWORD r_bgra_cmyk = argb[_bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, 1, 0)];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -591,7 +591,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -607,9 +607,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
_bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
FX_DWORD r_bgra_cmyk = argb[_bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, 1, 0)];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -620,7 +620,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else {
CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);
@@ -633,9 +633,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
FX_DWORD r_bgra_cmyk = argb[stretch_buf[src_row * stretch_pitch + src_col]];
if (transformF == FXDIB_Rgba) {
- dest_pos[0] = (FX_BYTE)(r_bgra_cmyk >> 24);
- dest_pos[1] = (FX_BYTE)(r_bgra_cmyk >> 16);
- dest_pos[2] = (FX_BYTE)(r_bgra_cmyk >> 8);
+ dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
+ dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
+ dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
} else {
*(FX_DWORD*)dest_pos = r_bgra_cmyk;
}
@@ -650,7 +650,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
if (!(m_Flags & FXDIB_DOWNSAMPLE) && !(m_Flags & FXDIB_BICUBIC_INTERPOL)) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -671,9 +671,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
}
int row_offset_l = src_row_l * stretch_pitch;
int row_offset_r = src_row_r * stretch_pitch;
- FX_BYTE r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
+ uint8_t r_pos_red_y_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 2);
+ uint8_t r_pos_green_m_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 1);
+ uint8_t r_pos_blue_c_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 0);
if (bHasAlpha) {
if (transformF != FXDIB_Argb) {
if (transformF == FXDIB_Rgba) {
@@ -685,7 +685,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
*(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
}
} else {
- FX_BYTE r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
+ uint8_t r_pos_a_r = _bilinear_interpol(stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r, res_x, res_y, Bpp, 3);
*(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
}
} else {
@@ -704,7 +704,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else if (m_Flags & FXDIB_BICUBIC_INTERPOL) {
CFX_BilinearMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col_l, src_row_l, res_x, res_y, r_pos_k_r = 0;
result2stretch_fix.Transform(col, row, src_col_l, src_row_l, res_x, res_y);
@@ -718,9 +718,9 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
src_row_l--;
}
_bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l, res_x, res_y, stretch_width, stretch_height);
- FX_BYTE r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
- FX_BYTE r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
- FX_BYTE r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
+ uint8_t r_pos_red_y_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 2);
+ uint8_t r_pos_green_m_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 1);
+ uint8_t r_pos_blue_c_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 0);
if (bHasAlpha) {
if (transformF != FXDIB_Argb) {
if (transformF == FXDIB_Rgba) {
@@ -732,7 +732,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
*(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r, r_pos_red_y_r, r_pos_k_r));
}
} else {
- FX_BYTE r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
+ uint8_t r_pos_a_r = _bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel, u_w, v_w, res_x, res_y, Bpp, 3);
*(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r, r_pos_blue_c_r));
}
} else {
@@ -751,7 +751,7 @@ FX_BOOL CFX_ImageTransformer::Continue(IFX_Pause* pPause)
} else {
CPDF_FixedMatrix result2stretch_fix(result2stretch, 8);
for (int row = 0; row < m_ResultHeight; row ++) {
- FX_BYTE* dest_pos = (FX_BYTE*)pTransformed->GetScanline(row);
+ uint8_t* dest_pos = (uint8_t*)pTransformed->GetScanline(row);
for (int col = 0; col < m_ResultWidth; col ++) {
int src_col, src_row;
result2stretch_fix.Transform(col, row, src_col, src_row);