summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/freeimage/src/FreeImage.h28
-rw-r--r--libs/freeimage/src/FreeImage/BitmapAccess.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/Conversion.cpp12
-rw-r--r--libs/freeimage/src/FreeImage/Conversion16_555.cpp14
-rw-r--r--libs/freeimage/src/FreeImage/Conversion16_565.cpp14
-rw-r--r--libs/freeimage/src/FreeImage/Conversion24.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/Conversion32.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/Conversion4.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/Conversion8.cpp6
-rw-r--r--libs/freeimage/src/FreeImage/ConversionFloat.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionRGB16.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionRGBA16.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionRGBAF.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionRGBF.cpp2
-rw-r--r--libs/freeimage/src/FreeImage/ConversionUINT16.cpp10
-rw-r--r--libs/freeimage/src/FreeImage/MNGHelper.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/NNQuantizer.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/PixelAccess.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/PluginBMP.cpp20
-rw-r--r--libs/freeimage/src/FreeImage/PluginGIF.cpp38
-rw-r--r--libs/freeimage/src/FreeImage/PluginICO.cpp18
-rw-r--r--libs/freeimage/src/FreeImage/PluginJPEG.cpp4
-rw-r--r--libs/freeimage/src/FreeImage/WuQuantizer.cpp8
-rw-r--r--libs/freeimage/src/FreeImageToolkit/Background.cpp14
-rw-r--r--libs/freeimage/src/FreeImageToolkit/ClassicRotate.cpp8
-rw-r--r--libs/freeimage/src/FreeImageToolkit/Colors.cpp12
-rw-r--r--libs/freeimage/src/FreeImageToolkit/CopyPaste.cpp12
-rw-r--r--libs/freeimage/src/FreeImageToolkit/Display.cpp12
-rw-r--r--libs/freeimage/src/FreeImageToolkit/Flip.cpp4
-rw-r--r--libs/freeimage/src/FreeImageToolkit/Resize.cpp114
-rw-r--r--libs/freeimage/src/Metadata/Exif.cpp58
-rw-r--r--libs/freeimage/src/Metadata/FreeImageTag.cpp10
-rw-r--r--libs/freeimage/src/Metadata/IPTC.cpp8
-rw-r--r--libs/freeimage/src/Metadata/TagConversion.cpp2
-rw-r--r--libs/freeimage/src/Metadata/TagLib.cpp6
-rw-r--r--libs/freeimage/src/Quantizers.h2
-rw-r--r--libs/freeimage/src/Utilities.h22
-rw-r--r--libs/mTextControl/src/richeditutils.cpp2
38 files changed, 248 insertions, 248 deletions
diff --git a/libs/freeimage/src/FreeImage.h b/libs/freeimage/src/FreeImage.h
index 85f4680ca8..c96e579963 100644
--- a/libs/freeimage/src/FreeImage.h
+++ b/libs/freeimage/src/FreeImage.h
@@ -152,7 +152,7 @@ FI_STRUCT (FIMULTIBITMAP) { void *data; };
#include <inttypes.h>
typedef int32_t BOOL;
typedef uint8_t uint8_t;
-typedef uint16_t WORD;
+typedef uint16_t uint16_t;
typedef uint32_t DWORD;
typedef int32_t LONG;
typedef int64_t INT64;
@@ -161,7 +161,7 @@ typedef uint64_t UINT64;
// MS is not C99 ISO compliant
typedef long BOOL;
typedef unsigned char uint8_t;
-typedef unsigned short WORD;
+typedef unsigned short uint16_t;
typedef unsigned long DWORD;
typedef long LONG;
typedef signed __int64 INT64;
@@ -209,8 +209,8 @@ typedef struct tagBITMAPINFOHEADER{
DWORD biSize;
LONG biWidth;
LONG biHeight;
- WORD biPlanes;
- WORD biBitCount;
+ uint16_t biPlanes;
+ uint16_t biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
@@ -237,18 +237,18 @@ typedef struct tagBITMAPINFO {
/** 48-bit RGB
*/
typedef struct tagFIRGB16 {
- WORD red;
- WORD green;
- WORD blue;
+ uint16_t red;
+ uint16_t green;
+ uint16_t blue;
} FIRGB16;
/** 64-bit RGBA
*/
typedef struct tagFIRGBA16 {
- WORD red;
- WORD green;
- WORD blue;
- WORD alpha;
+ uint16_t red;
+ uint16_t green;
+ uint16_t blue;
+ uint16_t alpha;
} FIRGBA16;
/** 96-bit RGB Float
@@ -371,7 +371,7 @@ typedef struct tagFICOMPLEX {
#define FIICC_COLOR_IS_CMYK 0x01
FI_STRUCT (FIICCPROFILE) {
- WORD flags; //! info flag
+ uint16_t flags; //! info flag
DWORD size; //! profile's size measured in bytes
void *data; //! points to a block of contiguous memory containing the profile
};
@@ -1062,7 +1062,7 @@ DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag);
// tag getters and setters
DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag);
DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag);
-DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
+DLL_API uint16_t DLL_CALLCONV FreeImage_GetTagID(FITAG *tag);
DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag);
DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag);
DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag);
@@ -1070,7 +1070,7 @@ DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag);
DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key);
DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description);
-DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id);
+DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, uint16_t id);
DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type);
DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count);
DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length);
diff --git a/libs/freeimage/src/FreeImage/BitmapAccess.cpp b/libs/freeimage/src/FreeImage/BitmapAccess.cpp
index 4f5fea576a..62a1d216aa 100644
--- a/libs/freeimage/src/FreeImage/BitmapAccess.cpp
+++ b/libs/freeimage/src/FreeImage/BitmapAccess.cpp
@@ -428,7 +428,7 @@ FreeImage_AllocateBitmap(BOOL header_only, uint8_t *ext_bits, unsigned ext_pitch
bih->biHeight = height;
bih->biPlanes = 1;
bih->biCompression = need_masks ? BI_BITFIELDS : BI_RGB;
- bih->biBitCount = (WORD)bpp;
+ bih->biBitCount = (uint16_t)bpp;
bih->biClrUsed = CalculateUsedPaletteEntries(bpp);
bih->biClrImportant = bih->biClrUsed;
bih->biXPelsPerMeter = 2835; // 72 dpi
@@ -1379,7 +1379,7 @@ FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key,
FreeImage_OutputMessageProc(FIF_UNKNOWN, "IPTC: Invalid key '%s'", key);
}
*/
- FreeImage_SetTagID(tag, (WORD)id);
+ FreeImage_SetTagID(tag, (uint16_t)id);
}
break;
diff --git a/libs/freeimage/src/FreeImage/Conversion.cpp b/libs/freeimage/src/FreeImage/Conversion.cpp
index 7a700b2e48..e9481c5401 100644
--- a/libs/freeimage/src/FreeImage/Conversion.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion.cpp
@@ -87,7 +87,7 @@ BOOL SwapRedBlue32(FIBITMAP* dib) {
// ----------------------------------------------------------
static inline void
-assignRGB(WORD r, WORD g, WORD b, WORD* out) {
+assignRGB(uint16_t r, uint16_t g, uint16_t b, uint16_t* out) {
out[0] = r;
out[1] = g;
out[2] = b;
@@ -162,7 +162,7 @@ ConvertCMYKtoRGBA(FIBITMAP* dib) {
unsigned channelSize = 1;
if (image_type == FIT_RGBA16 || image_type == FIT_RGB16) {
- channelSize = sizeof(WORD);
+ channelSize = sizeof(uint16_t);
} else if (!(image_type == FIT_BITMAP && (bytesperpixel > 2))) {
return FALSE;
}
@@ -174,8 +174,8 @@ ConvertCMYKtoRGBA(FIBITMAP* dib) {
unsigned samplesperpixel = FreeImage_GetLine(dib) / width / channelSize;
- if(channelSize == sizeof(WORD)) {
- _convertCMYKtoRGBA<WORD>(width, height, line_start, pitch, samplesperpixel);
+ if(channelSize == sizeof(uint16_t)) {
+ _convertCMYKtoRGBA<uint16_t>(width, height, line_start, pitch, samplesperpixel);
} else {
_convertCMYKtoRGBA<uint8_t>(width, height, line_start, pitch, samplesperpixel);
}
@@ -311,7 +311,7 @@ ConvertLABtoRGB(FIBITMAP* dib) {
unsigned channelSize = 1;
if (image_type == FIT_RGBA16 || image_type == FIT_RGB16) {
- channelSize = sizeof(WORD);
+ channelSize = sizeof(uint16_t);
} else if (!(image_type == FIT_BITMAP && (bytesperpixel > 2))) {
return FALSE;
}
@@ -327,7 +327,7 @@ ConvertLABtoRGB(FIBITMAP* dib) {
_convertLABtoRGB<uint8_t>(width, height, line_start, pitch, samplesperpixel);
}
else {
- _convertLABtoRGB<WORD>(width, height, line_start, pitch, samplesperpixel);
+ _convertLABtoRGB<uint16_t>(width, height, line_start, pitch, samplesperpixel);
}
return TRUE;
diff --git a/libs/freeimage/src/FreeImage/Conversion16_555.cpp b/libs/freeimage/src/FreeImage/Conversion16_555.cpp
index ae0a4b6d1a..2caa76e9cf 100644
--- a/libs/freeimage/src/FreeImage/Conversion16_555.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion16_555.cpp
@@ -33,7 +33,7 @@
void DLL_CALLCONV
FreeImage_ConvertLine1To16_555(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
int index = (source[cols >> 3] & (0x80 >> (cols & 0x07))) != 0 ? 1 : 0;
@@ -44,7 +44,7 @@ FreeImage_ConvertLine1To16_555(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine4To16_555(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
BOOL lonibble = FALSE;
int x = 0;
@@ -65,7 +65,7 @@ FreeImage_ConvertLine4To16_555(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine8To16_555(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
RGBQUAD *grab_palette = palette + source[cols];
@@ -76,8 +76,8 @@ FreeImage_ConvertLine8To16_555(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine16_565_To16_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *src_bits = (WORD *)source;
- WORD *new_bits = (WORD *)target;
+ uint16_t *src_bits = (uint16_t *)source;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB555((((src_bits[cols] & FI16_565_BLUE_MASK) >> FI16_565_BLUE_SHIFT) * 0xFF) / 0x1F,
@@ -88,7 +88,7 @@ FreeImage_ConvertLine16_565_To16_555(uint8_t *target, uint8_t *source, int width
void DLL_CALLCONV
FreeImage_ConvertLine24To16_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB555(source[FI_RGBA_BLUE], source[FI_RGBA_GREEN], source[FI_RGBA_RED]);
@@ -99,7 +99,7 @@ FreeImage_ConvertLine24To16_555(uint8_t *target, uint8_t *source, int width_in_p
void DLL_CALLCONV
FreeImage_ConvertLine32To16_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB555(source[FI_RGBA_BLUE], source[FI_RGBA_GREEN], source[FI_RGBA_RED]);
diff --git a/libs/freeimage/src/FreeImage/Conversion16_565.cpp b/libs/freeimage/src/FreeImage/Conversion16_565.cpp
index e48d53b7ad..0a36fdaa8b 100644
--- a/libs/freeimage/src/FreeImage/Conversion16_565.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion16_565.cpp
@@ -29,7 +29,7 @@
void DLL_CALLCONV
FreeImage_ConvertLine1To16_565(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
int index = (source[cols >> 3] & (0x80 >> (cols & 0x07))) != 0 ? 1 : 0;
@@ -40,7 +40,7 @@ FreeImage_ConvertLine1To16_565(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine4To16_565(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
BOOL lonibble = FALSE;
int x = 0;
@@ -61,7 +61,7 @@ FreeImage_ConvertLine4To16_565(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine8To16_565(uint8_t *target, uint8_t *source, int width_in_pixels, RGBQUAD *palette) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
RGBQUAD *grab_palette = palette + source[cols];
@@ -72,8 +72,8 @@ FreeImage_ConvertLine8To16_565(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine16_555_To16_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *src_bits = (WORD *)source;
- WORD *new_bits = (WORD *)target;
+ uint16_t *src_bits = (uint16_t *)source;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB565((((src_bits[cols] & FI16_555_BLUE_MASK) >> FI16_555_BLUE_SHIFT) * 0xFF) / 0x1F,
@@ -84,7 +84,7 @@ FreeImage_ConvertLine16_555_To16_565(uint8_t *target, uint8_t *source, int width
void DLL_CALLCONV
FreeImage_ConvertLine24To16_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB565(source[FI_RGBA_BLUE], source[FI_RGBA_GREEN], source[FI_RGBA_RED]);
@@ -95,7 +95,7 @@ FreeImage_ConvertLine24To16_565(uint8_t *target, uint8_t *source, int width_in_p
void DLL_CALLCONV
FreeImage_ConvertLine32To16_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *new_bits = (WORD *)target;
+ uint16_t *new_bits = (uint16_t *)target;
for (int cols = 0; cols < width_in_pixels; cols++) {
new_bits[cols] = RGB565(source[FI_RGBA_BLUE], source[FI_RGBA_GREEN], source[FI_RGBA_RED]);
diff --git a/libs/freeimage/src/FreeImage/Conversion24.cpp b/libs/freeimage/src/FreeImage/Conversion24.cpp
index 9586d853dd..4520e6cae2 100644
--- a/libs/freeimage/src/FreeImage/Conversion24.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion24.cpp
@@ -78,7 +78,7 @@ FreeImage_ConvertLine8To24(uint8_t *target, uint8_t *source, int width_in_pixels
void DLL_CALLCONV
FreeImage_ConvertLine16To24_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
for (int cols = 0; cols < width_in_pixels; cols++) {
target[FI_RGBA_RED] = (uint8_t)((((bits[cols] & FI16_555_RED_MASK) >> FI16_555_RED_SHIFT) * 0xFF) / 0x1F);
@@ -91,7 +91,7 @@ FreeImage_ConvertLine16To24_555(uint8_t *target, uint8_t *source, int width_in_p
void DLL_CALLCONV
FreeImage_ConvertLine16To24_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
for (int cols = 0; cols < width_in_pixels; cols++) {
target[FI_RGBA_RED] = (uint8_t)((((bits[cols] & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F);
diff --git a/libs/freeimage/src/FreeImage/Conversion32.cpp b/libs/freeimage/src/FreeImage/Conversion32.cpp
index 43845e19aa..52b85d097d 100644
--- a/libs/freeimage/src/FreeImage/Conversion32.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion32.cpp
@@ -79,7 +79,7 @@ FreeImage_ConvertLine8To32(uint8_t *target, uint8_t *source, int width_in_pixels
void DLL_CALLCONV
FreeImage_ConvertLine16To32_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
for (int cols = 0; cols < width_in_pixels; cols++) {
target[FI_RGBA_RED] = (uint8_t)((((bits[cols] & FI16_555_RED_MASK) >> FI16_555_RED_SHIFT) * 0xFF) / 0x1F);
@@ -92,7 +92,7 @@ FreeImage_ConvertLine16To32_555(uint8_t *target, uint8_t *source, int width_in_p
void DLL_CALLCONV
FreeImage_ConvertLine16To32_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
for (int cols = 0; cols < width_in_pixels; cols++) {
target[FI_RGBA_RED] = (uint8_t)((((bits[cols] & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F);
diff --git a/libs/freeimage/src/FreeImage/Conversion4.cpp b/libs/freeimage/src/FreeImage/Conversion4.cpp
index c1527810d6..a96f6b8d5c 100644
--- a/libs/freeimage/src/FreeImage/Conversion4.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion4.cpp
@@ -59,7 +59,7 @@ FreeImage_ConvertLine8To4(uint8_t *target, uint8_t *source, int width_in_pixels,
void DLL_CALLCONV
FreeImage_ConvertLine16To4_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
BOOL hinibble = TRUE;
for (int cols = 0; cols < width_in_pixels; cols++) {
@@ -81,7 +81,7 @@ FreeImage_ConvertLine16To4_555(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine16To4_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- WORD *bits = (WORD *)source;
+ uint16_t *bits = (uint16_t *)source;
BOOL hinibble = TRUE;
for (int cols = 0; cols < width_in_pixels; cols++) {
diff --git a/libs/freeimage/src/FreeImage/Conversion8.cpp b/libs/freeimage/src/FreeImage/Conversion8.cpp
index 73820a4d66..e20fb0a756 100644
--- a/libs/freeimage/src/FreeImage/Conversion8.cpp
+++ b/libs/freeimage/src/FreeImage/Conversion8.cpp
@@ -55,7 +55,7 @@ FreeImage_ConvertLine4To8(uint8_t *target, uint8_t *source, int width_in_pixels)
void DLL_CALLCONV
FreeImage_ConvertLine16To8_555(uint8_t *target, uint8_t *source, int width_in_pixels) {
- const WORD *const bits = (WORD *)source;
+ const uint16_t *const bits = (uint16_t *)source;
for (unsigned cols = 0; cols < (unsigned)width_in_pixels; cols++) {
target[cols] = GREY((((bits[cols] & FI16_555_RED_MASK) >> FI16_555_RED_SHIFT) * 0xFF) / 0x1F,
(((bits[cols] & FI16_555_GREEN_MASK) >> FI16_555_GREEN_SHIFT) * 0xFF) / 0x1F,
@@ -65,7 +65,7 @@ FreeImage_ConvertLine16To8_555(uint8_t *target, uint8_t *source, int width_in_pi
void DLL_CALLCONV
FreeImage_ConvertLine16To8_565(uint8_t *target, uint8_t *source, int width_in_pixels) {
- const WORD *const bits = (WORD *)source;
+ const uint16_t *const bits = (uint16_t *)source;
for (unsigned cols = 0; cols < (unsigned)width_in_pixels; cols++) {
target[cols] = GREY((((bits[cols] & FI16_565_RED_MASK) >> FI16_565_RED_SHIFT) * 0xFF) / 0x1F,
(((bits[cols] & FI16_565_GREEN_MASK) >> FI16_565_GREEN_SHIFT) * 0xFF) / 0x3F,
@@ -204,7 +204,7 @@ FreeImage_ConvertTo8Bits(FIBITMAP *dib) {
uint8_t *dst_bits = FreeImage_GetBits(new_dib);
for (unsigned rows = 0; rows < height; rows++) {
- const WORD *const src_pixel = (WORD*)src_bits;
+ const uint16_t *const src_pixel = (uint16_t*)src_bits;
uint8_t *dst_pixel = (uint8_t*)dst_bits;
for(unsigned cols = 0; cols < width; cols++) {
dst_pixel[cols] = (uint8_t)(src_pixel[cols] >> 8);
diff --git a/libs/freeimage/src/FreeImage/ConversionFloat.cpp b/libs/freeimage/src/FreeImage/ConversionFloat.cpp
index ca551ab4ad..83fd777271 100644
--- a/libs/freeimage/src/FreeImage/ConversionFloat.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionFloat.cpp
@@ -104,7 +104,7 @@ FreeImage_ConvertToFloat(FIBITMAP *dib) {
case FIT_UINT16:
{
for(unsigned y = 0; y < height; y++) {
- const WORD *src_pixel = (WORD*)src_bits;
+ const uint16_t *src_pixel = (uint16_t*)src_bits;
float *dst_pixel = (float*)dst_bits;
for(unsigned x = 0; x < width; x++) {
diff --git a/libs/freeimage/src/FreeImage/ConversionRGB16.cpp b/libs/freeimage/src/FreeImage/ConversionRGB16.cpp
index 4852a58866..f748dd1155 100644
--- a/libs/freeimage/src/FreeImage/ConversionRGB16.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionRGB16.cpp
@@ -103,7 +103,7 @@ FreeImage_ConvertToRGB16(FIBITMAP *dib) {
case FIT_UINT16:
{
for(unsigned y = 0; y < height; y++) {
- const WORD *src_bits = (WORD*)FreeImage_GetScanLine(src, y);
+ const uint16_t *src_bits = (uint16_t*)FreeImage_GetScanLine(src, y);
FIRGB16 *dst_bits = (FIRGB16*)FreeImage_GetScanLine(dst, y);
for(unsigned x = 0; x < width; x++) {
// convert by copying greyscale channel to each R, G, B channels
diff --git a/libs/freeimage/src/FreeImage/ConversionRGBA16.cpp b/libs/freeimage/src/FreeImage/ConversionRGBA16.cpp
index c5ecfdf438..d28d842ab9 100644
--- a/libs/freeimage/src/FreeImage/ConversionRGBA16.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionRGBA16.cpp
@@ -104,7 +104,7 @@ FreeImage_ConvertToRGBA16(FIBITMAP *dib) {
case FIT_UINT16:
{
for(unsigned y = 0; y < height; y++) {
- const WORD *src_bits = (WORD*)FreeImage_GetScanLine(src, y);
+ const uint16_t *src_bits = (uint16_t*)FreeImage_GetScanLine(src, y);
FIRGBA16 *dst_bits = (FIRGBA16*)FreeImage_GetScanLine(dst, y);
for(unsigned x = 0; x < width; x++) {
// convert by copying greyscale channel to each R, G, B channels
diff --git a/libs/freeimage/src/FreeImage/ConversionRGBAF.cpp b/libs/freeimage/src/FreeImage/ConversionRGBAF.cpp
index 99ece4604d..b8979cc85b 100644
--- a/libs/freeimage/src/FreeImage/ConversionRGBAF.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionRGBAF.cpp
@@ -132,7 +132,7 @@ FreeImage_ConvertToRGBAF(FIBITMAP *dib) {
uint8_t *dst_bits = (uint8_t*)FreeImage_GetBits(dst);
for(unsigned y = 0; y < height; y++) {
- const WORD *src_pixel = (WORD*)src_bits;
+ const uint16_t *src_pixel = (uint16_t*)src_bits;
FIRGBAF *dst_pixel = (FIRGBAF*)dst_bits;
for(unsigned x = 0; x < width; x++) {
diff --git a/libs/freeimage/src/FreeImage/ConversionRGBF.cpp b/libs/freeimage/src/FreeImage/ConversionRGBF.cpp
index d1f7611caa..bc24ce2b51 100644
--- a/libs/freeimage/src/FreeImage/ConversionRGBF.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionRGBF.cpp
@@ -130,7 +130,7 @@ FreeImage_ConvertToRGBF(FIBITMAP *dib) {
uint8_t *dst_bits = (uint8_t*)FreeImage_GetBits(dst);
for(unsigned y = 0; y < height; y++) {
- const WORD *src_pixel = (WORD*)src_bits;
+ const uint16_t *src_pixel = (uint16_t*)src_bits;
FIRGBF *dst_pixel = (FIRGBF*)dst_bits;
for(unsigned x = 0; x < width; x++) {
diff --git a/libs/freeimage/src/FreeImage/ConversionUINT16.cpp b/libs/freeimage/src/FreeImage/ConversionUINT16.cpp
index 35f1e2fdd0..2c0562ce89 100644
--- a/libs/freeimage/src/FreeImage/ConversionUINT16.cpp
+++ b/libs/freeimage/src/FreeImage/ConversionUINT16.cpp
@@ -86,7 +86,7 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
{
for(unsigned y = 0; y < height; y++) {
const uint8_t *src_bits = (uint8_t*)FreeImage_GetScanLine(src, y);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for(unsigned x = 0; x < width; x++) {
dst_bits[x] = src_bits[x] << 8;
}
@@ -98,10 +98,10 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
{
for(unsigned y = 0; y < height; y++) {
const FIRGB16 *src_bits = (FIRGB16*)FreeImage_GetScanLine(src, y);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for(unsigned x = 0; x < width; x++) {
// convert to grey
- dst_bits[x] = (WORD)LUMA_REC709(src_bits[x].red, src_bits[x].green, src_bits[x].blue);
+ dst_bits[x] = (uint16_t)LUMA_REC709(src_bits[x].red, src_bits[x].green, src_bits[x].blue);
}
}
}
@@ -111,10 +111,10 @@ FreeImage_ConvertToUINT16(FIBITMAP *dib) {
{
for(unsigned y = 0; y < height; y++) {
const FIRGBA16 *src_bits = (FIRGBA16*)FreeImage_GetScanLine(src, y);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for(unsigned x = 0; x < width; x++) {
// convert to grey
- dst_bits[x] = (WORD)LUMA_REC709(src_bits[x].red, src_bits[x].green, src_bits[x].blue);
+ dst_bits[x] = (uint16_t)LUMA_REC709(src_bits[x].red, src_bits[x].green, src_bits[x].blue);
}
}
}
diff --git a/libs/freeimage/src/FreeImage/MNGHelper.cpp b/libs/freeimage/src/FreeImage/MNGHelper.cpp
index d89ec23c6b..865cbe38c7 100644
--- a/libs/freeimage/src/FreeImage/MNGHelper.cpp
+++ b/libs/freeimage/src/FreeImage/MNGHelper.cpp
@@ -241,7 +241,7 @@ mng_GetChunckType(const uint8_t *mChunkName) {
}
inline void
-mng_SwapShort(WORD *sp) {
+mng_SwapShort(uint16_t *sp) {
#ifndef FREEIMAGE_BIGENDIAN
SwapShort(sp);
#endif
@@ -786,7 +786,7 @@ mng_ReadChunks(int format_id, FreeImageIO *io, fi_handle handle, long Offset, in
DWORD res_x = 2835; // 72 dpi
DWORD res_y = 2835; // 72 dpi
RGBQUAD rgbBkColor = {0, 0, 0, 0};
- WORD bk_red, bk_green, bk_blue;
+ uint16_t bk_red, bk_green, bk_blue;
BOOL hasBkColor = FALSE;
BOOL mHasIDAT = FALSE;
diff --git a/libs/freeimage/src/FreeImage/NNQuantizer.cpp b/libs/freeimage/src/FreeImage/NNQuantizer.cpp
index 092bad23b8..c91d01b053 100644
--- a/libs/freeimage/src/FreeImage/NNQuantizer.cpp
+++ b/libs/freeimage/src/FreeImage/NNQuantizer.cpp
@@ -489,11 +489,11 @@ FIBITMAP* NNQuantizer::Quantize(FIBITMAP *dib, int ReserveSize, RGBQUAD *Reserve
// 6) Write output image using inxsearch(b,g,r)
- for (WORD rows = 0; rows < img_height; rows++) {
+ for (uint16_t rows = 0; rows < img_height; rows++) {
uint8_t *new_bits = FreeImage_GetScanLine(new_dib, rows);
uint8_t *bits = FreeImage_GetScanLine(dib_ptr, rows);
- for (WORD cols = 0; cols < img_width; cols++) {
+ for (uint16_t cols = 0; cols < img_width; cols++) {
new_bits[cols] = (uint8_t)inxsearch(bits[FI_RGBA_BLUE], bits[FI_RGBA_GREEN], bits[FI_RGBA_RED]);
bits += 3;
diff --git a/libs/freeimage/src/FreeImage/PixelAccess.cpp b/libs/freeimage/src/FreeImage/PixelAccess.cpp
index 185763c3ba..1a6b316980 100644
--- a/libs/freeimage/src/FreeImage/PixelAccess.cpp
+++ b/libs/freeimage/src/FreeImage/PixelAccess.cpp
@@ -77,7 +77,7 @@ FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
case 16:
{
bits += 2*x;
- WORD *pixel = (WORD *)bits;
+ uint16_t *pixel = (uint16_t *)bits;
if((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
value->rgbBlue = (uint8_t)((((*pixel & FI16_565_BLUE_MASK) >> FI16_565_BLUE_SHIFT) * 0xFF) / 0x1F);
value->rgbGreen = (uint8_t)((((*pixel & FI16_565_GREEN_MASK) >> FI16_565_GREEN_SHIFT) * 0xFF) / 0x3F);
@@ -159,7 +159,7 @@ FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value) {
case 16:
{
bits += 2*x;
- WORD *pixel = (WORD *)bits;
+ uint16_t *pixel = (uint16_t *)bits;
if((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK)) {
*pixel = ((value->rgbBlue >> 3) << FI16_565_BLUE_SHIFT) |
((value->rgbGreen >> 2) << FI16_565_GREEN_SHIFT) |
diff --git a/libs/freeimage/src/FreeImage/PluginBMP.cpp b/libs/freeimage/src/FreeImage/PluginBMP.cpp
index a27760a1ea..8734c51b9b 100644
--- a/libs/freeimage/src/FreeImage/PluginBMP.cpp
+++ b/libs/freeimage/src/FreeImage/PluginBMP.cpp
@@ -39,10 +39,10 @@ static const uint8_t BI_ALPHABITFIELDS = 6; // compression: Bit field (this valu
typedef struct tagBITMAPINFOOS2_1X_HEADER {
DWORD biSize;
- WORD biWidth;
- WORD biHeight;
- WORD biPlanes;
- WORD biBitCount;
+ uint16_t biWidth;
+ uint16_t biHeight;
+ uint16_t biPlanes;
+ uint16_t biBitCount;
} BITMAPINFOOS2_1X_HEADER, *PBITMAPINFOOS2_1X_HEADER;
// ==========================================================
@@ -136,7 +136,7 @@ LoadPixelData(FreeImageIO *io, fi_handle handle, FIBITMAP *dib, int height, unsi
#ifdef FREEIMAGE_BIGENDIAN
if (bit_count == 16) {
for(unsigned y = 0; y < FreeImage_GetHeight(dib); y++) {
- WORD *pixel = (WORD *)FreeImage_GetScanLine(dib, y);
+ uint16_t *pixel = (uint16_t *)FreeImage_GetScanLine(dib, y);
for(unsigned x = 0; x < FreeImage_GetWidth(dib); x++) {
SwapShort(pixel);
pixel++;
@@ -1383,15 +1383,15 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
free(buffer);
#ifdef FREEIMAGE_BIGENDIAN
} else if (bpp == 16) {
- int padding = dst_pitch - dst_width * sizeof(WORD);
- WORD pad = 0;
- WORD pixel;
+ int padding = dst_pitch - dst_width * sizeof(uint16_t);
+ uint16_t pad = 0;
+ uint16_t pixel;
for(unsigned y = 0; y < dst_height; y++) {
uint8_t *line = FreeImage_GetScanLine(dib, y);
for(unsigned x = 0; x < dst_width; x++) {
- pixel = ((WORD *)line)[x];
+ pixel = ((uint16_t *)line)[x];
SwapShort(&pixel);
- if (io->write_proc(&pixel, sizeof(WORD), 1, handle) != 1) {
+ if (io->write_proc(&pixel, sizeof(uint16_t), 1, handle) != 1) {
return FALSE;
}
}
diff --git a/libs/freeimage/src/FreeImage/PluginGIF.cpp b/libs/freeimage/src/FreeImage/PluginGIF.cpp
index b1c823bdc8..3ec9a1b280 100644
--- a/libs/freeimage/src/FreeImage/PluginGIF.cpp
+++ b/libs/freeimage/src/FreeImage/PluginGIF.cpp
@@ -64,10 +64,10 @@ struct GIFinfo {
struct PageInfo {
PageInfo(int d, int l, int t, int w, int h) {
- disposal_method = d; left = (WORD)l; top = (WORD)t; width = (WORD)w; height = (WORD)h;
+ disposal_method = d; left = (uint16_t)l; top = (uint16_t)t; width = (uint16_t)w; height = (uint16_t)h;
}
int disposal_method;
- WORD left, top, width, height;
+ uint16_t left, top, width, height;
};
//GIF defines a max of 12 bits per code
@@ -144,7 +144,7 @@ static int g_GifInterlaceIncrement[GIF_INTERLACE_PASSES] = {8, 8, 4, 2};
// ==========================================================
static BOOL
-FreeImage_SetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, WORD id, FREE_IMAGE_MDTYPE type, DWORD count, DWORD length, const void *value)
+FreeImage_SetMetadataEx(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, uint16_t id, FREE_IMAGE_MDTYPE type, DWORD count, DWORD length, const void *value)
{
BOOL bResult = FALSE;
FITAG *tag = FreeImage_CreateTag();
@@ -672,15 +672,15 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
try {
bool have_transparent = false, no_local_palette = false, interlaced = false;
int disposal_method = GIF_DISPOSAL_LEAVE, delay_time = 0, transparent_color = 0;
- WORD left, top, width, height;
+ uint16_t left, top, width, height;
uint8_t packed, b;
- WORD w;
+ uint16_t w;
//playback pages to generate what the user would see for this frame
if( (flags & GIF_PLAYBACK) == GIF_PLAYBACK ) {
//Logical Screen Descriptor
io->seek_proc(handle, 6, SEEK_SET);
- WORD logicalwidth, logicalheight;
+ uint16_t logicalwidth, logicalheight;
io->read_proc(&logicalwidth, 2, 1, handle);
io->read_proc(&logicalheight, 2, 1, handle);
#ifdef FREEIMAGE_BIGENDIAN
@@ -958,7 +958,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
//Logical Screen Descriptor
io->seek_proc(handle, 6, SEEK_SET);
- WORD logicalwidth, logicalheight;
+ uint16_t logicalwidth, logicalheight;
io->read_proc(&logicalwidth, 2, 1, handle);
io->read_proc(&logicalheight, 2, 1, handle);
#ifdef FREEIMAGE_BIGENDIAN
@@ -1083,7 +1083,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
try {
uint8_t packed, b;
- WORD w;
+ uint16_t w;
FITAG *tag;
int bpp = FreeImage_GetBPP(dib);
@@ -1093,13 +1093,13 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
bool have_transparent = false, no_local_palette = false, interlaced = false;
int disposal_method = GIF_DISPOSAL_BACKGROUND, delay_time = 100, transparent_color = 0;
- WORD left = 0, top = 0, width = (WORD)FreeImage_GetWidth(dib), height = (WORD)FreeImage_GetHeight(dib);
- WORD output_height = height;
+ uint16_t left = 0, top = 0, width = (uint16_t)FreeImage_GetWidth(dib), height = (uint16_t)FreeImage_GetHeight(dib);
+ uint16_t output_height = height;
if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameLeft", FIDT_SHORT, &tag) ) {
- left = *(WORD *)FreeImage_GetTagValue(tag);
+ left = *(uint16_t *)FreeImage_GetTagValue(tag);
}
if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "FrameTop", FIDT_SHORT, &tag) ) {
- top = *(WORD *)FreeImage_GetTagValue(tag);
+ top = *(uint16_t *)FreeImage_GetTagValue(tag);
}
if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "NoLocalPalette", FIDT_BYTE, &tag) ) {
no_local_palette = *(uint8_t *)FreeImage_GetTagValue(tag) ? true : false;
@@ -1124,16 +1124,16 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
if( page == 0 ) {
//gather some info
- WORD logicalwidth = width; // width has already been swapped...
+ uint16_t logicalwidth = width; // width has already been swapped...
if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalWidth", FIDT_SHORT, &tag) ) {
- logicalwidth = *(WORD *)FreeImage_GetTagValue(tag);
+ logicalwidth = *(uint16_t *)FreeImage_GetTagValue(tag);
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&logicalwidth);
#endif
}
- WORD logicalheight = height; // height has already been swapped...
+ uint16_t logicalheight = height; // height has already been swapped...
if( FreeImage_GetMetadataEx(FIMD_ANIMATION, dib, "LogicalHeight", FIDT_SHORT, &tag) ) {
- logicalheight = *(WORD *)FreeImage_GetTagValue(tag);
+ logicalheight = *(uint16_t *)FreeImage_GetTagValue(tag);
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&logicalheight);
#endif
@@ -1219,7 +1219,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
//the Netscape extension is really "repeats" not "loops"
if( loop > 1 ) loop--;
if( loop > 0xFFFF ) loop = 0xFFFF;
- w = (WORD)loop;
+ w = (uint16_t)loop;
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&w);
#endif
@@ -1275,7 +1275,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
//IE5/IE6 have a minimum and default of 100ms
//Mozilla/Firefox/Netscape 6+/Opera have a minimum of 20ms and a default of 100ms if <20ms is specified or the GCE is absent
//Netscape 4 has a minimum of 10ms if 0ms is specified, but will use 0ms if the GCE is absent
- w = (WORD)(delay_time / 10); //convert ms to cs
+ w = (uint16_t)(delay_time / 10); //convert ms to cs
#ifdef FREEIMAGE_BIGENDIAN
SwapShort(&w);
#endif
@@ -1344,7 +1344,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
}
size = (int)(bufptr - buf);
uint8_t last[4];
- w = (WORD)stringtable->CompressEnd(last);
+ w = (uint16_t)stringtable->CompressEnd(last);
if( size + w >= sizeof(buf) ) {
//one last full size sub-block
io->write_proc(&b, 1, 1, handle);
diff --git a/libs/freeimage/src/FreeImage/PluginICO.cpp b/libs/freeimage/src/FreeImage/PluginICO.cpp
index d34c49fde4..96db02ad3c 100644
--- a/libs/freeimage/src/FreeImage/PluginICO.cpp
+++ b/libs/freeimage/src/FreeImage/PluginICO.cpp
@@ -36,9 +36,9 @@
// in an ICO file.
typedef struct tagICONHEADER {
- WORD idReserved; // reserved
- WORD idType; // resource type (1 for icons)
- WORD idCount; // how many images?
+ uint16_t idReserved; // reserved
+ uint16_t idType; // resource type (1 for icons)
+ uint16_t idCount; // how many images?
} ICONHEADER;
typedef struct tagICONDIRECTORYENTRY {
@@ -46,8 +46,8 @@ typedef struct tagICONDIRECTORYENTRY {
uint8_t bHeight; // height of the image (times 2)
uint8_t bColorCount; // number of colors in image (0 if >=8bpp)
uint8_t bReserved; // reserved
- WORD wPlanes; // color Planes
- WORD wBitCount; // bits per pixel
+ uint16_t wPlanes; // color Planes
+ uint16_t wBitCount; // bits per pixel
DWORD dwBytesInRes; // how many bytes in this resource?
DWORD dwImageOffset; // where in the file is this image
} ICONDIRENTRY;
@@ -333,7 +333,7 @@ LoadStandardIcon(FreeImageIO *io, fi_handle handle, int flags, BOOL header_only)
#ifdef FREEIMAGE_BIGENDIAN
if (bit_count == 16) {
for(int y = 0; y < height; y++) {
- WORD *pixel = (WORD *)FreeImage_GetScanLine(dib, y);
+ uint16_t *pixel = (uint16_t *)FreeImage_GetScanLine(dib, y);
for(int x = 0; x < width; x++) {
SwapShort(pixel);
pixel++;
@@ -496,13 +496,13 @@ SaveStandardIcon(FreeImageIO *io, FIBITMAP *dib, fi_handle handle) {
// XOR mask
#ifdef FREEIMAGE_BIGENDIAN
if (bit_count == 16) {
- WORD pixel;
+ uint16_t pixel;
for(unsigned y = 0; y < FreeImage_GetHeight(dib); y++) {
uint8_t *line = FreeImage_GetScanLine(dib, y);
for(unsigned x = 0; x < FreeImage_GetWidth(dib); x++) {
- pixel = ((WORD *)line)[x];
+ pixel = ((uint16_t *)line)[x];
SwapShort(&pixel);
- if (io->write_proc(&pixel, sizeof(WORD), 1, handle) != 1)
+ if (io->write_proc(&pixel, sizeof(uint16_t), 1, handle) != 1)
return FALSE;
}
}
diff --git a/libs/freeimage/src/FreeImage/PluginJPEG.cpp b/libs/freeimage/src/FreeImage/PluginJPEG.cpp
index dc76574723..23c13deef2 100644
--- a/libs/freeimage/src/FreeImage/PluginJPEG.cpp
+++ b/libs/freeimage/src/FreeImage/PluginJPEG.cpp
@@ -1308,7 +1308,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
jpeg_read_scanlines(&cinfo, buffer, 1);
for(unsigned x = 0; x < cinfo.output_width; x++) {
- WORD K = (WORD)src[3];
+ uint16_t K = (uint16_t)src[3];
dst[FI_RGBA_RED] = (uint8_t)((K * src[0]) / 255); // C -> R
dst[FI_RGBA_GREEN] = (uint8_t)((K * src[1]) / 255); // M -> G
dst[FI_RGBA_BLUE] = (uint8_t)((K * src[2]) / 255); // Y -> B
@@ -1408,7 +1408,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void
const char *sError = "only 24-bit RGB, 8-bit greyscale/palette or 32-bit CMYK bitmaps can be saved as JPEG";
FREE_IMAGE_COLOR_TYPE color_type = FreeImage_GetColorType(dib);
- WORD bpp = (WORD)FreeImage_GetBPP(dib);
+ uint16_t bpp = (uint16_t)FreeImage_GetBPP(dib);
if ((bpp != 24) && (bpp != 8) && !(bpp == 32 && (color_type == FIC_CMYK))) {
throw sError;
diff --git a/libs/freeimage/src/FreeImage/WuQuantizer.cpp b/libs/freeimage/src/FreeImage/WuQuantizer.cpp
index c84f1c593e..bbf3fd0a7c 100644
--- a/libs/freeimage/src/FreeImage/WuQuantizer.cpp
+++ b/libs/freeimage/src/FreeImage/WuQuantizer.cpp
@@ -62,7 +62,7 @@ WuQuantizer::WuQuantizer(FIBITMAP *dib) {
mb = (LONG*)malloc(SIZE_3D * sizeof(LONG));
// Allocate Qadd
- Qadd = (WORD *)malloc(sizeof(WORD) * width * height);
+ Qadd = (uint16_t *)malloc(sizeof(uint16_t) * width * height);
if(!gm2 || !wt || !mr || !mg || !mb || !Qadd) {
if(gm2) free(gm2);
@@ -78,7 +78,7 @@ WuQuantizer::WuQuantizer(FIBITMAP *dib) {
memset(mr, 0, SIZE_3D * sizeof(LONG));
memset(mg, 0, SIZE_3D * sizeof(LONG));
memset(mb, 0, SIZE_3D * sizeof(LONG));
- memset(Qadd, 0, sizeof(WORD) * width * height);
+ memset(Qadd, 0, sizeof(uint16_t) * width * height);
}
WuQuantizer::~WuQuantizer() {
@@ -115,7 +115,7 @@ WuQuantizer::Hist3D(LONG *vwt, LONG *vmr, LONG *vmg, LONG *vmb, float *m2, int R
ing = (bits[FI_RGBA_GREEN] >> 3) + 1;
inb = (bits[FI_RGBA_BLUE] >> 3) + 1;
ind = INDEX(inr, ing, inb);
- Qadd[y*width + x] = (WORD)ind;
+ Qadd[y*width + x] = (uint16_t)ind;
// [inr][ing][inb]
vwt[ind]++;
vmr[ind] += bits[FI_RGBA_RED];
@@ -134,7 +134,7 @@ WuQuantizer::Hist3D(LONG *vwt, LONG *vmr, LONG *vmg, LONG *vmb, float *m2, int R
ing = (bits[FI_RGBA_GREEN] >> 3) + 1;
inb = (bits[FI_RGBA_BLUE] >> 3) + 1;
ind = INDEX(inr, ing, inb);
- Qadd[y*width + x] = (WORD)ind;
+ Qadd[y*width + x] = (uint16_t)ind;
// [inr][ing][inb]
vwt[ind]++;
vmr[ind] += bits[FI_RGBA_RED];
diff --git a/libs/freeimage/src/FreeImageToolkit/Background.cpp b/libs/freeimage/src/FreeImageToolkit/Background.cpp
index db4e679d87..86e6088149 100644
--- a/libs/freeimage/src/FreeImageToolkit/Background.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/Background.cpp
@@ -192,9 +192,9 @@ GetAlphaBlendedColor(const RGBQUAD *bgcolor, const RGBQUAD *fgcolor, RGBQUAD *bl
uint8_t alpha = fgcolor->rgbReserved;
uint8_t not_alpha = ~alpha;
- blended->rgbRed = (uint8_t)( ((WORD)fgcolor->rgbRed * alpha + not_alpha * (WORD)bgcolor->rgbRed) >> 8 );
- blended->rgbGreen = (uint8_t)( ((WORD)fgcolor->rgbGreen * alpha + not_alpha * (WORD)bgcolor->rgbGreen) >> 8) ;
- blended->rgbBlue = (uint8_t)( ((WORD)fgcolor->rgbBlue * alpha + not_alpha * (WORD)bgcolor->rgbBlue) >> 8 );
+ blended->rgbRed = (uint8_t)( ((uint16_t)fgcolor->rgbRed * alpha + not_alpha * (uint16_t)bgcolor->rgbRed) >> 8 );
+ blended->rgbGreen = (uint8_t)( ((uint16_t)fgcolor->rgbGreen * alpha + not_alpha * (uint16_t)bgcolor->rgbGreen) >> 8) ;
+ blended->rgbBlue = (uint8_t)( ((uint16_t)fgcolor->rgbBlue * alpha + not_alpha * (uint16_t)bgcolor->rgbBlue) >> 8 );
blended->rgbReserved = 0xFF;
return TRUE;
@@ -309,9 +309,9 @@ FillBackgroundBitmap(FIBITMAP *dib, const RGBQUAD *color, int options) {
break;
}
case 16: {
- WORD wcolor = RGBQUAD_TO_WORD(dib, color_intl);
+ uint16_t wcolor = RGBQUAD_TO_WORD(dib, color_intl);
for (unsigned x = 0; x < width; x++) {
- ((WORD *)dst_bits)[x] = wcolor;
+ ((uint16_t *)dst_bits)[x] = wcolor;
}
break;
}
@@ -626,8 +626,8 @@ FreeImage_AllocateExT(FREE_IMAGE_TYPE type, int width, int height, int bpp, cons
break;
}
case 16: {
- WORD wcolor = (type == FIT_BITMAP) ?
- RGBQUAD_TO_WORD(bitmap, ((RGBQUAD *)color)) : *((WORD *)color);
+ uint16_t wcolor = (type == FIT_BITMAP) ?
+ RGBQUAD_TO_WORD(bitmap, ((RGBQUAD *)color)) : *((uint16_t *)color);
if (wcolor != 0) {
FreeImage_FillBackground(bitmap, color, options);
}
diff --git a/libs/freeimage/src/FreeImageToolkit/ClassicRotate.cpp b/libs/freeimage/src/FreeImageToolkit/ClassicRotate.cpp
index 18088debff..2ccb25739b 100644
--- a/libs/freeimage/src/FreeImageToolkit/ClassicRotate.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/ClassicRotate.cpp
@@ -42,7 +42,7 @@
/**
Skews a row horizontally (with filtered weights).
Limited to 45 degree skewing only. Filters two adjacent pixels.
-Parameter T can be uint8_t, WORD of float.
+Parameter T can be uint8_t, uint16_t of float.
@param src Pointer to source image to rotate
@param dst Pointer to destination image
@param row Row index
@@ -160,7 +160,7 @@ HorizontalSkew(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double dWeigh
case FIT_UINT16:
case FIT_RGB16:
case FIT_RGBA16:
- HorizontalSkewT<WORD>(src, dst, row, iOffset, dWeight, bkcolor);
+ HorizontalSkewT<uint16_t>(src, dst, row, iOffset, dWeight, bkcolor);
break;
case FIT_FLOAT:
case FIT_RGBF:
@@ -173,7 +173,7 @@ HorizontalSkew(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double dWeigh
/**
Skews a column vertically (with filtered weights).
Limited to 45 degree skewing only. Filters two adjacent pixels.
-Parameter T can be uint8_t, WORD of float.
+Parameter T can be uint8_t, uint16_t of float.
@param src Pointer to source image to rotate
@param dst Pointer to destination image
@param col Column index
@@ -299,7 +299,7 @@ VerticalSkew(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double dWeight,
case FIT_UINT16:
case FIT_RGB16:
case FIT_RGBA16:
- VerticalSkewT<WORD>(src, dst, col, iOffset, dWeight, bkcolor);
+ VerticalSkewT<uint16_t>(src, dst, col, iOffset, dWeight, bkcolor);
break;
case FIT_FLOAT:
case FIT_RGBF:
diff --git a/libs/freeimage/src/FreeImageToolkit/Colors.cpp b/libs/freeimage/src/FreeImageToolkit/Colors.cpp
index cd67567c0c..c32f52fcc3 100644
--- a/libs/freeimage/src/FreeImageToolkit/Colors.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/Colors.cpp
@@ -109,10 +109,10 @@ FreeImage_Invert(FIBITMAP *src) {
}
else if((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) {
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(uint16_t);
for(y = 0; y < height; y++) {
- WORD *bits = (WORD*)FreeImage_GetScanLine(src, y);
+ uint16_t *bits = (uint16_t*)FreeImage_GetScanLine(src, y);
for(x = 0; x < width; x++) {
for(k = 0; k < wordspp; k++) {
bits[k] = ~bits[k];
@@ -704,12 +704,12 @@ FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolor
return result;
}
case 16: {
- WORD *src16 = (WORD *)malloc(sizeof(WORD) * count);
+ uint16_t *src16 = (uint16_t *)malloc(sizeof(uint16_t) * count);
if (NULL == src16) {
return 0;
}
- WORD *dst16 = (WORD *)malloc(sizeof(WORD) * count);
+ uint16_t *dst16 = (uint16_t *)malloc(sizeof(uint16_t) * count);
if (NULL == dst16) {
free(src16);
return 0;
@@ -722,9 +722,9 @@ FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolor
unsigned height = FreeImage_GetHeight(dib);
unsigned width = FreeImage_GetWidth(dib);
- WORD *a, *b;
+ uint16_t *a, *b;
for (unsigned y = 0; y < height; y++) {
- WORD *bits = (WORD *)FreeImage_GetScanLine(dib, y);
+ uint16_t *bits = (uint16_t *)FreeImage_GetScanLine(dib, y);
for (unsigned x = 0; x < width; x++, bits++) {
for (unsigned j = 0; j < count; j++) {
a = src16;
diff --git a/libs/freeimage/src/FreeImageToolkit/CopyPaste.cpp b/libs/freeimage/src/FreeImageToolkit/CopyPaste.cpp
index 3a9d555ba7..67c3771bcc 100644
--- a/libs/freeimage/src/FreeImageToolkit/CopyPaste.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/CopyPaste.cpp
@@ -115,11 +115,11 @@ Combine4(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned
// build a swap table for the closest color match from the source palette to the destination palette
for (int i = 0; i < 16; i++) {
- WORD min_diff = (WORD)-1;
+ uint16_t min_diff = (uint16_t)-1;
for (int j = 0; j < 16; j++) {
// calculates the color difference using a Manhattan distance
- WORD abs_diff = (WORD)(
+ uint16_t abs_diff = (uint16_t)(
abs(src_pal[i].rgbBlue - dst_pal[j].rgbBlue)
+ abs(src_pal[i].rgbGreen - dst_pal[j].rgbGreen)
+ abs(src_pal[i].rgbRed - dst_pal[j].rgbRed)
@@ -262,8 +262,8 @@ Combine16_555(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi
RGBTRIPLE color_s;
RGBTRIPLE color_t;
- WORD *tmp1 = (WORD *)&dst_bits[cols];
- WORD *tmp2 = (WORD *)&src_bits[cols];
+ uint16_t *tmp1 = (uint16_t *)&dst_bits[cols];
+ uint16_t *tmp2 = (uint16_t *)&src_bits[cols];
// convert 16-bit colors to 24-bit
@@ -322,8 +322,8 @@ Combine16_565(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi
RGBTRIPLE color_s;
RGBTRIPLE color_t;
- WORD *tmp1 = (WORD *)&dst_bits[cols];
- WORD *tmp2 = (WORD *)&src_bits[cols];
+ uint16_t *tmp1 = (uint16_t *)&dst_bits[cols];
+ uint16_t *tmp2 = (uint16_t *)&src_bits[cols];
// convert 16-bit colors to 24-bit
diff --git a/libs/freeimage/src/FreeImageToolkit/Display.cpp b/libs/freeimage/src/FreeImageToolkit/Display.cpp
index 5b879aa656..a6ca2ae3d4 100644
--- a/libs/freeimage/src/FreeImageToolkit/Display.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/Display.cpp
@@ -165,9 +165,9 @@ FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP
else {
// output = alpha * foreground + (1-alpha) * background
not_alpha = (uint8_t)~alpha;
- cp_bits[FI_RGBA_BLUE] = (uint8_t)((alpha * (WORD)fgc.rgbBlue + not_alpha * (WORD)bkc.rgbBlue) >> 8);
- cp_bits[FI_RGBA_GREEN] = (uint8_t)((alpha * (WORD)fgc.rgbGreen + not_alpha * (WORD)bkc.rgbGreen) >> 8);
- cp_bits[FI_RGBA_RED] = (uint8_t)((alpha * (WORD)fgc.rgbRed + not_alpha * (WORD)bkc.rgbRed) >> 8);
+ cp_bits[FI_RGBA_BLUE] = (uint8_t)((alpha * (uint16_t)fgc.rgbBlue + not_alpha * (uint16_t)bkc.rgbBlue) >> 8);
+ cp_bits[FI_RGBA_GREEN] = (uint8_t)((alpha * (uint16_t)fgc.rgbGreen + not_alpha * (uint16_t)bkc.rgbGreen) >> 8);
+ cp_bits[FI_RGBA_RED] = (uint8_t)((alpha * (uint16_t)fgc.rgbRed + not_alpha * (uint16_t)bkc.rgbRed) >> 8);
}
fg_bits += bytespp;
@@ -217,9 +217,9 @@ FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib) {
// color * 0xFF / 0xFF = color
continue;
} else {
- bits[FI_RGBA_BLUE] = (uint8_t)( (alpha * (WORD)bits[FI_RGBA_BLUE] + 127) / 255 );
- bits[FI_RGBA_GREEN] = (uint8_t)( (alpha * (WORD)bits[FI_RGBA_GREEN] + 127) / 255 );
- bits[FI_RGBA_RED] = (uint8_t)( (alpha * (WORD)bits[FI_RGBA_RED] + 127) / 255 );
+ bits[FI_RGBA_BLUE] = (uint8_t)( (alpha * (uint16_t)bits[FI_RGBA_BLUE] + 127) / 255 );
+ bits[FI_RGBA_GREEN] = (uint8_t)( (alpha * (uint16_t)bits[FI_RGBA_GREEN] + 127) / 255 );
+ bits[FI_RGBA_RED] = (uint8_t)( (alpha * (uint16_t)bits[FI_RGBA_RED] + 127) / 255 );
}
}
}
diff --git a/libs/freeimage/src/FreeImageToolkit/Flip.cpp b/libs/freeimage/src/FreeImageToolkit/Flip.cpp
index 3f7bcf972a..52a43d2f24 100644
--- a/libs/freeimage/src/FreeImageToolkit/Flip.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/Flip.cpp
@@ -86,8 +86,8 @@ FreeImage_FlipHorizontal(FIBITMAP *src) {
case 16:
{
- WORD *dst_data = (WORD*) bits;
- WORD *src_data = (WORD*) (new_bits + line - bytespp);
+ uint16_t *dst_data = (uint16_t*) bits;
+ uint16_t *src_data = (uint16_t*) (new_bits + line - bytespp);
for(unsigned c = 0; c < width; c++) {
*dst_data++ = *src_data--;
}
diff --git a/libs/freeimage/src/FreeImageToolkit/Resize.cpp b/libs/freeimage/src/FreeImageToolkit/Resize.cpp
index 9781be9788..7eac266cd0 100644
--- a/libs/freeimage/src/FreeImageToolkit/Resize.cpp
+++ b/libs/freeimage/src/FreeImageToolkit/Resize.cpp
@@ -981,14 +981,14 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
// image has 565 format
for (unsigned y = 0; y < height; y++) {
// scale each row
- const WORD * const src_bits = (WORD *)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(WORD);
+ const uint16_t * const src_bits = (uint16_t *)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(uint16_t);
uint8_t *dst_bits = FreeImage_GetScanLine(dst, y);
for (unsigned x = 0; x < dst_width; x++) {
// loop through row
const unsigned iLeft = weightsTable.getLeftBoundary(x); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(x) - iLeft; // retrieve right boundary
- const WORD *pixel = src_bits + iLeft;
+ const uint16_t *pixel = src_bits + iLeft;
double r = 0, g = 0, b = 0;
// for(i = iLeft to iRight)
@@ -1013,14 +1013,14 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
// image has 555 format
for (unsigned y = 0; y < height; y++) {
// scale each row
- const WORD * const src_bits = (WORD *)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x;
+ const uint16_t * const src_bits = (uint16_t *)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x;
uint8_t *dst_bits = FreeImage_GetScanLine(dst, y);
for (unsigned x = 0; x < dst_width; x++) {
// loop through row
const unsigned iLeft = weightsTable.getLeftBoundary(x); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(x) - iLeft; // retrieve right boundary
- const WORD *pixel = src_bits + iLeft;
+ const uint16_t *pixel = src_bits + iLeft;
double r = 0, g = 0, b = 0;
// for(i = iLeft to iRight)
@@ -1125,18 +1125,18 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
case FIT_UINT16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(uint16_t);
for (unsigned y = 0; y < height; y++) {
// scale each row
- const WORD *src_bits = (WORD*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(WORD);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ const uint16_t *src_bits = (uint16_t*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(uint16_t);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for (unsigned x = 0; x < dst_width; x++) {
// loop through row
const unsigned iLeft = weightsTable.getLeftBoundary(x); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(x) - iLeft; // retrieve right boundary
- const WORD *pixel = src_bits + iLeft * wordspp;
+ const uint16_t *pixel = src_bits + iLeft * wordspp;
double value = 0;
// for(i = iLeft to iRight)
@@ -1149,7 +1149,7 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(value + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(value + 0.5), 0, 0xFFFF);
dst_bits += wordspp;
}
}
@@ -1159,18 +1159,18 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
case FIT_RGB16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(uint16_t);
for (unsigned y = 0; y < height; y++) {
// scale each row
- const WORD *src_bits = (WORD*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(WORD);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ const uint16_t *src_bits = (uint16_t*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(uint16_t);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for (unsigned x = 0; x < dst_width; x++) {
// loop through row
const unsigned iLeft = weightsTable.getLeftBoundary(x); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(x) - iLeft; // retrieve right boundary
- const WORD *pixel = src_bits + iLeft * wordspp;
+ const uint16_t *pixel = src_bits + iLeft * wordspp;
double r = 0, g = 0, b = 0;
// for(i = iLeft to iRight)
@@ -1185,9 +1185,9 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
- dst_bits[1] = (WORD)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
- dst_bits[2] = (WORD)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
+ dst_bits[1] = (uint16_t)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
+ dst_bits[2] = (uint16_t)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
dst_bits += wordspp;
}
}
@@ -1197,18 +1197,18 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
case FIT_RGBA16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / src_width) / sizeof(uint16_t);
for (unsigned y = 0; y < height; y++) {
// scale each row
- const WORD *src_bits = (WORD*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(WORD);
- WORD *dst_bits = (WORD*)FreeImage_GetScanLine(dst, y);
+ const uint16_t *src_bits = (uint16_t*)FreeImage_GetScanLine(src, y + src_offset_y) + src_offset_x / sizeof(uint16_t);
+ uint16_t *dst_bits = (uint16_t*)FreeImage_GetScanLine(dst, y);
for (unsigned x = 0; x < dst_width; x++) {
// loop through row
const unsigned iLeft = weightsTable.getLeftBoundary(x); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(x) - iLeft; // retrieve right boundary
- const WORD *pixel = src_bits + iLeft * wordspp;
+ const uint16_t *pixel = src_bits + iLeft * wordspp;
double r = 0, g = 0, b = 0, a = 0;
// for(i = iLeft to iRight)
@@ -1224,10 +1224,10 @@ void CResizeEngine::horizontalFilter(FIBITMAP *const src, unsigned height, unsig
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
- dst_bits[1] = (WORD)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
- dst_bits[2] = (WORD)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
- dst_bits[3] = (WORD)CLAMP<int>((int)(a + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
+ dst_bits[1] = (uint16_t)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
+ dst_bits[2] = (uint16_t)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
+ dst_bits[3] = (uint16_t)CLAMP<int>((int)(a + 0.5), 0, 0xFFFF);
dst_bits += wordspp;
}
}
@@ -1781,8 +1781,8 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
case 16:
{
// transparently convert the 16-bit non-transparent image to 24 bpp
- const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(WORD);
- const WORD *const src_base = (WORD *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x;
+ const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(uint16_t);
+ const uint16_t *const src_base = (uint16_t *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x;
if (IS_FORMAT_RGB565(src)) {
// image has 565 format
@@ -1795,7 +1795,7 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
// loop through column
const unsigned iLeft = weightsTable.getLeftBoundary(y); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(y) - iLeft; // retrieve right boundary
- const WORD *src_bits = src_base + iLeft * src_pitch + x;
+ const uint16_t *src_bits = src_base + iLeft * src_pitch + x;
double r = 0, g = 0, b = 0;
for (unsigned i = 0; i < iLimit; i++) {
@@ -1826,7 +1826,7 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
// loop through column
const unsigned iLeft = weightsTable.getLeftBoundary(y); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(y) - iLeft; // retrieve right boundary
- const WORD *src_bits = src_base + iLeft * src_pitch + x;
+ const uint16_t *src_bits = src_base + iLeft * src_pitch + x;
double r = 0, g = 0, b = 0;
for (unsigned i = 0; i < iLimit; i++) {
@@ -1936,25 +1936,25 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
case FIT_UINT16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(uint16_t);
- const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(WORD);
- WORD *const dst_base = (WORD *)FreeImage_GetBits(dst);
+ const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(uint16_t);
+ uint16_t *const dst_base = (uint16_t *)FreeImage_GetBits(dst);
- const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(WORD);
- const WORD *const src_base = (WORD *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
+ const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(uint16_t);
+ const uint16_t *const src_base = (uint16_t *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
for (unsigned x = 0; x < width; x++) {
// work on column x in dst
const unsigned index = x * wordspp; // pixel index
- WORD *dst_bits = dst_base + index;
+ uint16_t *dst_bits = dst_base + index;
// scale each column
for (unsigned y = 0; y < dst_height; y++) {
// loop through column
const unsigned iLeft = weightsTable.getLeftBoundary(y); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(y) - iLeft; // retrieve right boundary
- const WORD *src_bits = src_base + iLeft * src_pitch + index;
+ const uint16_t *src_bits = src_base + iLeft * src_pitch + index;
double value = 0;
for (unsigned i = 0; i < iLimit; i++) {
@@ -1966,7 +1966,7 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(value + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(value + 0.5), 0, 0xFFFF);
dst_bits += dst_pitch;
}
@@ -1977,25 +1977,25 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
case FIT_RGB16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(uint16_t);
- const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(WORD);
- WORD *const dst_base = (WORD *)FreeImage_GetBits(dst);
+ const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(uint16_t);
+ uint16_t *const dst_base = (uint16_t *)FreeImage_GetBits(dst);
- const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(WORD);
- const WORD *const src_base = (WORD *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
+ const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(uint16_t);
+ const uint16_t *const src_base = (uint16_t *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
for (unsigned x = 0; x < width; x++) {
// work on column x in dst
const unsigned index = x * wordspp; // pixel index
- WORD *dst_bits = dst_base + index;
+ uint16_t *dst_bits = dst_base + index;
// scale each column
for (unsigned y = 0; y < dst_height; y++) {
// loop through column
const unsigned iLeft = weightsTable.getLeftBoundary(y); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(y) - iLeft; // retrieve right boundary
- const WORD *src_bits = src_base + iLeft * src_pitch + index;
+ const uint16_t *src_bits = src_base + iLeft * src_pitch + index;
double r = 0, g = 0, b = 0;
for (unsigned i = 0; i < iLimit; i++) {
@@ -2010,9 +2010,9 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
- dst_bits[1] = (WORD)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
- dst_bits[2] = (WORD)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
+ dst_bits[1] = (uint16_t)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
+ dst_bits[2] = (uint16_t)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
dst_bits += dst_pitch;
}
@@ -2023,25 +2023,25 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
case FIT_RGBA16:
{
// Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit)
- const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD);
+ const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(uint16_t);
- const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(WORD);
- WORD *const dst_base = (WORD *)FreeImage_GetBits(dst);
+ const unsigned dst_pitch = FreeImage_GetPitch(dst) / sizeof(uint16_t);
+ uint16_t *const dst_base = (uint16_t *)FreeImage_GetBits(dst);
- const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(WORD);
- const WORD *const src_base = (WORD *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
+ const unsigned src_pitch = FreeImage_GetPitch(src) / sizeof(uint16_t);
+ const uint16_t *const src_base = (uint16_t *)FreeImage_GetBits(src) + src_offset_y * src_pitch + src_offset_x * wordspp;
for (unsigned x = 0; x < width; x++) {
// work on column x in dst
const unsigned index = x * wordspp; // pixel index
- WORD *dst_bits = dst_base + index;
+ uint16_t *dst_bits = dst_base + index;
// scale each column
for (unsigned y = 0; y < dst_height; y++) {
// loop through column
const unsigned iLeft = weightsTable.getLeftBoundary(y); // retrieve left boundary
const unsigned iLimit = weightsTable.getRightBoundary(y) - iLeft; // retrieve right boundary
- const WORD *src_bits = src_base + iLeft * src_pitch + index;
+ const uint16_t *src_bits = src_base + iLeft * src_pitch + index;
double r = 0, g = 0, b = 0, a = 0;
for (unsigned i = 0; i < iLimit; i++) {
@@ -2057,10 +2057,10 @@ void CResizeEngine::verticalFilter(FIBITMAP *const src, unsigned width, unsigned
}
// clamp and place result in destination pixel
- dst_bits[0] = (WORD)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
- dst_bits[1] = (WORD)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
- dst_bits[2] = (WORD)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
- dst_bits[3] = (WORD)CLAMP<int>((int)(a + 0.5), 0, 0xFFFF);
+ dst_bits[0] = (uint16_t)CLAMP<int>((int)(r + 0.5), 0, 0xFFFF);
+ dst_bits[1] = (uint16_t)CLAMP<int>((int)(g + 0.5), 0, 0xFFFF);
+ dst_bits[2] = (uint16_t)CLAMP<int>((int)(b + 0.5), 0, 0xFFFF);
+ dst_bits[3] = (uint16_t)CLAMP<int>((int)(a + 0.5), 0, 0xFFFF);
dst_bits += dst_pitch;
}
diff --git a/libs/freeimage/src/Metadata/Exif.cpp b/libs/freeimage/src/Metadata/Exif.cpp
index 9fbaf3b1af..1b7dad3916 100644
--- a/libs/freeimage/src/Metadata/Exif.cpp
+++ b/libs/freeimage/src/Metadata/Exif.cpp
@@ -121,15 +121,15 @@ ReadInt32(BOOL msb_order, const void *buffer) {
return value;
}
-static WORD
+static uint16_t
ReadUint16(BOOL msb_order, const void *buffer) {
- WORD value;
+ uint16_t value;
if(msb_order) {
- value = (WORD) ((((uint8_t*) buffer)[0] << 8) | ((uint8_t*) buffer)[1]);
+ value = (uint16_t) ((((uint8_t*) buffer)[0] << 8) | ((uint8_t*) buffer)[1]);
return value;
}
- value = (WORD) ((((uint8_t*) buffer)[1] << 8) | ((uint8_t*) buffer)[0]);
+ value = (uint16_t) ((((uint8_t*) buffer)[1] << 8) | ((uint8_t*) buffer)[0]);
return value;
}
@@ -310,7 +310,7 @@ processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
DWORD startIndex = 0;
TagLib& s = TagLib::instance();
- WORD tag_id = FreeImage_GetTagID(tag);
+ uint16_t tag_id = FreeImage_GetTagID(tag);
int subTagTypeBase = 0;
@@ -361,7 +361,7 @@ processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
}
- WORD *pvalue = (WORD*)FreeImage_GetTagValue(tag);
+ uint16_t *pvalue = (uint16_t*)FreeImage_GetTagValue(tag);
// create a tag
FITAG *canonTag = FreeImage_CreateTag();
@@ -370,7 +370,7 @@ processCanonMakerNoteTag(FIBITMAP *dib, FITAG *tag) {
// we intentionally skip the first array member (if needed)
for (DWORD i = startIndex; i < FreeImage_GetTagCount(tag); i++) {
- tag_id = (WORD)(subTagTypeBase + i);
+ tag_id = (uint16_t)(subTagTypeBase + i);
FreeImage_SetTagID(canonTag, tag_id);
FreeImage_SetTagType(canonTag, FIDT_SHORT);
@@ -418,9 +418,9 @@ processExifTag(FIBITMAP *dib, FITAG *tag, char *pval, BOOL msb_order, TagLib::MD
case FIDT_SHORT:
{
- WORD *value = (WORD*)&exif_value[0];
+ uint16_t *value = (uint16_t*)&exif_value[0];
for(i = 0; i < FreeImage_GetTagCount(tag); i++) {
- value[i] = ReadUint16(msb_order, pval + i * sizeof(WORD));
+ value[i] = ReadUint16(msb_order, pval + i * sizeof(uint16_t));
}
FreeImage_SetTagValue(tag, value);
break;
@@ -494,7 +494,7 @@ processExifTag(FIBITMAP *dib, FITAG *tag, char *pval, BOOL msb_order, TagLib::MD
else {
TagLib& s = TagLib::instance();
- WORD tag_id = FreeImage_GetTagID(tag);
+ uint16_t tag_id = FreeImage_GetTagID(tag);
// get the tag key and description
const char *key = s.getTagFieldName(md_model, tag_id, defaultKey);
@@ -528,9 +528,9 @@ Process Exif directory
*/
static BOOL
jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWORD dwLength, DWORD dwProfileOffset, BOOL msb_order, TagLib::MDMODEL starting_md_model) {
- WORD de, nde;
+ uint16_t de, nde;
- std::stack<WORD> destack; // directory entries stack
+ std::stack<uint16_t> destack; // directory entries stack
std::stack<const uint8_t*> ifdstack; // IFD stack
std::stack<TagLib::MDMODEL> modelstack; // metadata model stack
@@ -595,11 +595,11 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
pde = (char*) DIR_ENTRY_ADDR(ifdp, de);
// get the tag ID
- WORD tag_id = ReadUint16(msb_order, pde);
+ uint16_t tag_id = ReadUint16(msb_order, pde);
FreeImage_SetTagID(tag, tag_id);
// get the tag type
- WORD tag_type = (WORD)ReadUint16(msb_order, pde + 2);
+ uint16_t tag_type = (uint16_t)ReadUint16(msb_order, pde + 2);
if((tag_type - 1) >= EXIF_NUM_FORMATS) {
// a problem occured : delete the tag (not free'd after)
FreeImage_DeleteTag(tag);
@@ -718,7 +718,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
// --- handle thumbnail data ---
//
- const WORD entriesCount0th = ReadUint16(msb_order, ifd0th);
+ const uint16_t entriesCount0th = ReadUint16(msb_order, ifd0th);
DWORD next_offset = ReadUint32(msb_order, DIR_ENTRY_ADDR(ifd0th, entriesCount0th));
if((next_offset == 0) || (next_offset >= dwLength)) {
@@ -726,7 +726,7 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
}
const uint8_t* const ifd1st = (uint8_t*)tiffp + next_offset;
- const WORD entriesCount1st = ReadUint16(msb_order, ifd1st);
+ const uint16_t entriesCount1st = ReadUint16(msb_order, ifd1st);
unsigned thCompression = 0;
unsigned thOffset = 0;
@@ -745,13 +745,13 @@ jpeg_read_exif_dir(FIBITMAP *dib, const uint8_t *tiffp, DWORD dwOffsetIfd0, DWOR
}
// get the tag ID
- WORD tag = ReadUint16(msb_order, base);
+ uint16_t tag = ReadUint16(msb_order, base);
// get the tag type
- /*WORD type = */ReadUint16(msb_order, base + sizeof(WORD));
+ /*uint16_t type = */ReadUint16(msb_order, base + sizeof(uint16_t));
// get number of components
- /*DWORD count = */ReadUint32(msb_order, base + sizeof(WORD) + sizeof(WORD));
+ /*DWORD count = */ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t));
// get the tag value
- DWORD offset = ReadUint32(msb_order, base + sizeof(WORD) + sizeof(WORD) + sizeof(DWORD));
+ DWORD offset = ReadUint32(msb_order, base + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(DWORD));
switch(tag) {
case TAG_COMPRESSION:
@@ -973,7 +973,7 @@ RotateExif(FIBITMAP **dib) {
FITAG *tag = NULL;
FreeImage_GetMetadata(FIMD_EXIF_MAIN, *dib, "Orientation", &tag);
if((tag != NULL) && (FreeImage_GetTagID(tag) == TAG_ORIENTATION)) {
- const WORD orientation = *((WORD *)FreeImage_GetTagValue(tag));
+ const uint16_t orientation = *((uint16_t *)FreeImage_GetTagValue(tag));
switch (orientation) {
case 1: // "top, left side" => 0°
break;
@@ -1024,8 +1024,8 @@ RotateExif(FIBITMAP **dib) {
class PredicateTagIDCompare {
public:
bool operator()(FITAG *a, FITAG *b) {
- WORD tag_id_a = FreeImage_GetTagID(a);
- WORD tag_id_b = FreeImage_GetTagID(b);
+ uint16_t tag_id_a = FreeImage_GetTagID(a);
+ uint16_t tag_id_b = FreeImage_GetTagID(b);
return (tag_id_a < tag_id_b);
}
};
@@ -1056,7 +1056,7 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
std::vector<FITAG*> vTagList;
TagLib::MDMODEL internal_md_model;
- DWORD ifd_offset = 0; // WORD-aligned IFD value offset
+ DWORD ifd_offset = 0; // uint16_t-aligned IFD value offset
const uint8_t empty_byte = 0;
@@ -1105,7 +1105,7 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
int tag_id = s.getTagID(internal_md_model, key);
if(tag_id != -1) {
// this is a known tag, set the tag ID
- FreeImage_SetTagID(tag, (WORD)tag_id);
+ FreeImage_SetTagID(tag, (uint16_t)tag_id);
// record the tag
vTagList.push_back(tag);
}
@@ -1145,17 +1145,17 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
// 3) write each IFD entry in tag id ascending order
// number of directory entries
- WORD nde = (WORD)metadata_count;
+ uint16_t nde = (uint16_t)metadata_count;
FreeImage_WriteMemory(&nde, 1, 2, hmem);
// for each entry ...
for(unsigned i = 0; i < metadata_count; i++) {
FITAG *tag = vTagList[i];
// tag id
- WORD tag_id = FreeImage_GetTagID(tag);
+ uint16_t tag_id = FreeImage_GetTagID(tag);
FreeImage_WriteMemory(&tag_id, 1, 2, hmem);
// tag type (compliant with TIFF specification)
- WORD tag_type = (WORD)FreeImage_GetTagType(tag);
+ uint16_t tag_type = (uint16_t)FreeImage_GetTagType(tag);
FreeImage_WriteMemory(&tag_type, 1, 2, hmem);
// tag count
DWORD tag_count = FreeImage_GetTagCount(tag);
@@ -1177,7 +1177,7 @@ tiff_write_ifd(FIBITMAP *dib, FREE_IMAGE_MDMODEL md_model, FIMEMORY *hmem) {
FreeImage_SeekMemory(hmem, ifd_offset, SEEK_SET);
FreeImage_WriteMemory(FreeImage_GetTagValue(tag), 1, tag_length, hmem);
if(tag_length & 1) {
- // align to the next WORD boundary
+ // align to the next uint16_t boundary
FreeImage_WriteMemory(&empty_byte, 1, 1, hmem);
}
// next offset to use
diff --git a/libs/freeimage/src/Metadata/FreeImageTag.cpp b/libs/freeimage/src/Metadata/FreeImageTag.cpp
index 1f4f709010..ceaec666f1 100644
--- a/libs/freeimage/src/Metadata/FreeImageTag.cpp
+++ b/libs/freeimage/src/Metadata/FreeImageTag.cpp
@@ -34,8 +34,8 @@
FI_STRUCT (FITAGHEADER) {
char *key; // tag field name
char *description; // tag description
- WORD id; // tag ID
- WORD type; // tag data type (see FREE_IMAGE_MDTYPE)
+ uint16_t id; // tag ID
+ uint16_t type; // tag data type (see FREE_IMAGE_MDTYPE)
DWORD count; // number of components (in 'tag data types' units)
DWORD length; // value length in bytes
void *value; // tag value
@@ -158,7 +158,7 @@ FreeImage_GetTagDescription(FITAG *tag) {
return tag ? ((FITAGHEADER *)tag->data)->description : 0;
}
-WORD DLL_CALLCONV
+uint16_t DLL_CALLCONV
FreeImage_GetTagID(FITAG *tag) {
return tag ? ((FITAGHEADER *)tag->data)->id : 0;
}
@@ -208,7 +208,7 @@ FreeImage_SetTagDescription(FITAG *tag, const char *description) {
}
BOOL DLL_CALLCONV
-FreeImage_SetTagID(FITAG *tag, WORD id) {
+FreeImage_SetTagID(FITAG *tag, uint16_t id) {
if(tag) {
FITAGHEADER *tag_header = (FITAGHEADER *)tag->data;
tag_header->id = id;
@@ -221,7 +221,7 @@ BOOL DLL_CALLCONV
FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type) {
if(tag) {
FITAGHEADER *tag_header = (FITAGHEADER *)tag->data;
- tag_header->type = (WORD)type;
+ tag_header->type = (uint16_t)type;
return TRUE;
}
return FALSE;
diff --git a/libs/freeimage/src/Metadata/IPTC.cpp b/libs/freeimage/src/Metadata/IPTC.cpp
index c8884e4b32..149ecc9b33 100644
--- a/libs/freeimage/src/Metadata/IPTC.cpp
+++ b/libs/freeimage/src/Metadata/IPTC.cpp
@@ -46,7 +46,7 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
std::string Keywords;
std::string SupplementalCategory;
- WORD tag_id;
+ uint16_t tag_id;
if(!dataptr || (datalen == 0)) {
return FALSE;
@@ -107,7 +107,7 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
// process the tag
- tag_id = (WORD)(tagType | (directoryType << 8));
+ tag_id = (uint16_t)(tagType | (directoryType << 8));
FreeImage_SetTagID(tag, tag_id);
FreeImage_SetTagLength(tag, tagByteCount);
@@ -222,7 +222,7 @@ read_iptc_profile(FIBITMAP *dib, const uint8_t *dataptr, unsigned int datalen) {
// --------------------------------------------------------------------------
static uint8_t*
-append_iptc_tag(uint8_t *profile, unsigned *profile_size, WORD id, DWORD length, const void *value) {
+append_iptc_tag(uint8_t *profile, unsigned *profile_size, uint16_t id, DWORD length, const void *value) {
uint8_t *buffer = NULL;
// calculate the new buffer size
@@ -271,7 +271,7 @@ write_iptc_profile(FIBITMAP *dib, uint8_t **profile, unsigned *profile_size) {
if(mdhandle) {
do {
- WORD tag_id = FreeImage_GetTagID(tag);
+ uint16_t tag_id = FreeImage_GetTagID(tag);
// append the tag to the profile
diff --git a/libs/freeimage/src/Metadata/TagConversion.cpp b/libs/freeimage/src/Metadata/TagConversion.cpp
index 02743d929d..6d2ca14e2d 100644
--- a/libs/freeimage/src/Metadata/TagConversion.cpp
+++ b/libs/freeimage/src/Metadata/TagConversion.cpp
@@ -896,7 +896,7 @@ ConvertExifTag(FITAG *tag) {
case TAG_COMPRESSION:
{
- WORD compression = *((WORD*)FreeImage_GetTagValue(tag));
+ uint16_t compression = *((uint16_t*)FreeImage_GetTagValue(tag));
switch(compression) {
case TAG_COMPRESSION_NONE:
sprintf(format, "dump mode (%d)", compression);
diff --git a/libs/freeimage/src/Metadata/TagLib.cpp b/libs/freeimage/src/Metadata/TagLib.cpp
index cc496dd58a..dfec8a4dcd 100644
--- a/libs/freeimage/src/Metadata/TagLib.cpp
+++ b/libs/freeimage/src/Metadata/TagLib.cpp
@@ -1515,7 +1515,7 @@ TagLib& TagLib::instance() {
}
const TagInfo*
-TagLib::getTagInfo(MDMODEL md_model, WORD tagID) {
+TagLib::getTagInfo(MDMODEL md_model, uint16_t tagID) {
if(_table_map.find(md_model) != _table_map.end()) {
@@ -1528,7 +1528,7 @@ TagLib::getTagInfo(MDMODEL md_model, WORD tagID) {
}
const char*
-TagLib::getTagFieldName(MDMODEL md_model, WORD tagID, char *defaultKey) {
+TagLib::getTagFieldName(MDMODEL md_model, uint16_t tagID, char *defaultKey) {
const TagInfo *info = getTagInfo(md_model, tagID);
if(NULL == info) {
@@ -1544,7 +1544,7 @@ TagLib::getTagFieldName(MDMODEL md_model, WORD tagID, char *defaultKey) {
}
const char*
-TagLib::getTagDescription(MDMODEL md_model, WORD tagID) {
+TagLib::getTagDescription(MDMODEL md_model, uint16_t tagID) {
const TagInfo *info = getTagInfo(md_model, tagID);
if(info) {
diff --git a/libs/freeimage/src/Quantizers.h b/libs/freeimage/src/Quantizers.h
index 71627361f6..289f237bbb 100644
--- a/libs/freeimage/src/Quantizers.h
+++ b/libs/freeimage/src/Quantizers.h
@@ -50,7 +50,7 @@ typedef struct tagBox {
protected:
float *gm2;
LONG *wt, *mr, *mg, *mb;
- WORD *Qadd;
+ uint16_t *Qadd;
// DIB data
unsigned width, height;
diff --git a/libs/freeimage/src/Utilities.h b/libs/freeimage/src/Utilities.h
index c783ba44e9..5c8331eea3 100644
--- a/libs/freeimage/src/Utilities.h
+++ b/libs/freeimage/src/Utilities.h
@@ -288,11 +288,11 @@ AssignPixel(uint8_t* dst, const uint8_t* src, unsigned bytesperpixel) {
break;
case 2: // FIT_UINT16 / FIT_INT16 / 16-bit
- *(reinterpret_cast<WORD*>(dst)) = *(reinterpret_cast<const WORD*> (src));
+ *(reinterpret_cast<uint16_t*>(dst)) = *(reinterpret_cast<const uint16_t*> (src));
break;
case 3: // FIT_BITMAP (24-bit)
- *(reinterpret_cast<WORD*>(dst)) = *(reinterpret_cast<const WORD*> (src));
+ *(reinterpret_cast<uint16_t*>(dst)) = *(reinterpret_cast<const uint16_t*> (src));
dst[2] = src[2];
break;
@@ -302,7 +302,7 @@ AssignPixel(uint8_t* dst, const uint8_t* src, unsigned bytesperpixel) {
case 6: // FIT_RGB16 (3 x 16-bit)
*(reinterpret_cast<DWORD*>(dst)) = *(reinterpret_cast<const DWORD*> (src));
- *(reinterpret_cast<WORD*>(dst + 4)) = *(reinterpret_cast<const WORD*> (src + 4));
+ *(reinterpret_cast<uint16_t*>(dst + 4)) = *(reinterpret_cast<const uint16_t*> (src + 4));
break;
// the rest can be speeded up with int64
@@ -370,20 +370,20 @@ void RotateExif(FIBITMAP **dib);
// Big Endian / Little Endian utility functions
// ==========================================================
-inline WORD
-__SwapUInt16(WORD arg) {
+inline uint16_t
+__SwapUInt16(uint16_t arg) {
#if defined(_MSC_VER) && _MSC_VER >= 1310
return _byteswap_ushort(arg);
#elif defined(__i386__) && defined(__GNUC__)
__asm__("xchgb %b0, %h0" : "+q" (arg));
return arg;
#elif defined(__ppc__) && defined(__GNUC__)
- WORD result;
+ uint16_t result;
__asm__("lhbrx %0,0,%1" : "=r" (result) : "r" (&arg), "m" (arg));
return result;
#else
// swap bytes
- WORD result;
+ uint16_t result;
result = ((arg << 8) & 0xFF00) | ((arg >> 8) & 0x00FF);
return result;
#endif
@@ -409,7 +409,7 @@ __SwapUInt32(DWORD arg) {
}
inline void
-SwapShort(WORD *sp) {
+SwapShort(uint16_t *sp) {
*sp = __SwapUInt16(*sp);
}
@@ -452,10 +452,10 @@ A Standard Default Color Space for the Internet - sRGB.
#define GREY(r, g, b) (uint8_t)(LUMA_REC709(r, g, b) + 0.5F)
/*
-#define GREY(r, g, b) (uint8_t)(((WORD)r * 77 + (WORD)g * 150 + (WORD)b * 29) >> 8) // .299R + .587G + .114B
+#define GREY(r, g, b) (uint8_t)(((uint16_t)r * 77 + (uint16_t)g * 150 + (uint16_t)b * 29) >> 8) // .299R + .587G + .114B
*/
/*
-#define GREY(r, g, b) (uint8_t)(((WORD)r * 169 + (WORD)g * 256 + (WORD)b * 87) >> 9) // .33R + 0.5G + .17B
+#define GREY(r, g, b) (uint8_t)(((uint16_t)r * 169 + (uint16_t)g * 256 + (uint16_t)b * 87) >> 9) // .33R + 0.5G + .17B
*/
/**
@@ -474,7 +474,7 @@ Returns TRUE if the format of a dib is RGB565
#define IS_FORMAT_RGB565(dib) ((FreeImage_GetRedMask(dib) == FI16_565_RED_MASK) && (FreeImage_GetGreenMask(dib) == FI16_565_GREEN_MASK) && (FreeImage_GetBlueMask(dib) == FI16_565_BLUE_MASK))
/**
-Convert a RGB565 or RGB555 RGBQUAD pixel to a WORD
+Convert a RGB565 or RGB555 RGBQUAD pixel to a uint16_t
*/
#define RGBQUAD_TO_WORD(dib, color) (IS_FORMAT_RGB565(dib) ? RGB565((color)->rgbBlue, (color)->rgbGreen, (color)->rgbRed) : RGB555((color)->rgbBlue, (color)->rgbGreen, (color)->rgbRed))
diff --git a/libs/mTextControl/src/richeditutils.cpp b/libs/mTextControl/src/richeditutils.cpp
index 29f05e17e6..310b19c67f 100644
--- a/libs/mTextControl/src/richeditutils.cpp
+++ b/libs/mTextControl/src/richeditutils.cpp
@@ -55,7 +55,7 @@ public:
return E_NOTIMPL;
}
- HRESULT STDMETHODCALLTYPE GetContextMenu(WORD, LPOLEOBJECT, CHARRANGE *, HMENU *)
+ HRESULT STDMETHODCALLTYPE GetContextMenu(uint16_t, LPOLEOBJECT, CHARRANGE *, HMENU *)
{
return E_INVALIDARG;
}