diff options
Diffstat (limited to 'libs/freeimage/src/FreeImage/BitmapAccess.cpp')
-rw-r--r-- | libs/freeimage/src/FreeImage/BitmapAccess.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libs/freeimage/src/FreeImage/BitmapAccess.cpp b/libs/freeimage/src/FreeImage/BitmapAccess.cpp index e77344e1e1..4f5fea576a 100644 --- a/libs/freeimage/src/FreeImage/BitmapAccess.cpp +++ b/libs/freeimage/src/FreeImage/BitmapAccess.cpp @@ -85,7 +85,7 @@ FI_STRUCT (FREEIMAGEHEADER) { overall, but it requires quite some changes and it will render FreeImage_GetTransparencyTable obsolete in its current form; */ - BYTE transparent_table[256]; + uint8_t transparent_table[256]; /** number of transparent colors */ int transparency_count; /** TRUE if the image is transparent */ @@ -107,12 +107,12 @@ FI_STRUCT (FREEIMAGEHEADER) { /**@name external pixel buffer management */ //@{ /** pointer to user provided pixels, NULL otherwise */ - BYTE *external_bits; + uint8_t *external_bits; /** user provided pitch, 0 otherwise */ unsigned external_pitch; //@} - //BYTE filler[1]; // fill to 32-bit alignment + //uint8_t filler[1]; // fill to 32-bit alignment }; // ---------------------------------------------------------- @@ -201,7 +201,7 @@ This function includes a protection against malicious images, based on a KISS in @param height Image height @param bpp Number of bits-per-pixel @param need_masks We only store the masks (and allocate memory for them) for 16-bit images of type FIT_BITMAP -@return Returns a size in BYTE units +@return Returns a size in uint8_t units @see FreeImage_AllocateBitmap */ static size_t @@ -259,7 +259,7 @@ or NULL, if no masks are present (e.g. for 24 bit images). */ static FREEIMAGERGBMASKS * FreeImage_GetRGBMasks(FIBITMAP *dib) { - return FreeImage_HasRGBMasks(dib) ? (FREEIMAGERGBMASKS *)(((BYTE *)FreeImage_GetInfoHeader(dib)) + sizeof(BITMAPINFOHEADER)) : NULL; + return FreeImage_HasRGBMasks(dib) ? (FREEIMAGERGBMASKS *)(((uint8_t *)FreeImage_GetInfoHeader(dib)) + sizeof(BITMAPINFOHEADER)) : NULL; } /** @@ -288,7 +288,7 @@ like the ones used in low-level APIs like OpenCL or intrinsics. @return Returns the allocated FIBITMAP if successful, returns NULL otherwise */ static FIBITMAP * -FreeImage_AllocateBitmap(BOOL header_only, BYTE *ext_bits, unsigned ext_pitch, FREE_IMAGE_TYPE type, int width, int height, int bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask) { +FreeImage_AllocateBitmap(BOOL header_only, uint8_t *ext_bits, unsigned ext_pitch, FREE_IMAGE_TYPE type, int width, int height, int bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask) { // check input variables width = abs(width); @@ -381,7 +381,7 @@ FreeImage_AllocateBitmap(BOOL header_only, BYTE *ext_bits, unsigned ext_pitch, F return NULL; } - bitmap->data = (BYTE *)FreeImage_Aligned_Malloc(dib_size * sizeof(BYTE), FIBITMAP_ALIGNMENT); + bitmap->data = (uint8_t *)FreeImage_Aligned_Malloc(dib_size * sizeof(uint8_t), FIBITMAP_ALIGNMENT); if (bitmap->data != NULL) { memset(bitmap->data, 0, dib_size); @@ -438,9 +438,9 @@ FreeImage_AllocateBitmap(BOOL header_only, BYTE *ext_bits, unsigned ext_pitch, F // build a default greyscale palette (very useful for image processing) RGBQUAD *pal = FreeImage_GetPalette(bitmap); for(int i = 0; i < 256; i++) { - pal[i].rgbRed = (BYTE)i; - pal[i].rgbGreen = (BYTE)i; - pal[i].rgbBlue = (BYTE)i; + pal[i].rgbRed = (uint8_t)i; + pal[i].rgbGreen = (uint8_t)i; + pal[i].rgbBlue = (uint8_t)i; } } @@ -462,7 +462,7 @@ FreeImage_AllocateBitmap(BOOL header_only, BYTE *ext_bits, unsigned ext_pitch, F } FIBITMAP * DLL_CALLCONV -FreeImage_AllocateHeaderForBits(BYTE *ext_bits, unsigned ext_pitch, FREE_IMAGE_TYPE type, int width, int height, int bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask) { +FreeImage_AllocateHeaderForBits(uint8_t *ext_bits, unsigned ext_pitch, FREE_IMAGE_TYPE type, int width, int height, int bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask) { return FreeImage_AllocateBitmap(FALSE, ext_bits, ext_pitch, type, width, height, bpp, red_mask, green_mask, blue_mask); } @@ -538,7 +538,7 @@ FreeImage_Clone(FIBITMAP *dib) { unsigned bpp = FreeImage_GetBPP(dib); // if the FIBITMAP is a wrapper to a user provided pixel buffer, get a pointer to this buffer - const BYTE *ext_bits = ((FREEIMAGEHEADER *)dib->data)->external_bits; + const uint8_t *ext_bits = ((FREEIMAGEHEADER *)dib->data)->external_bits; // check for pixel availability ... BOOL header_only = FreeImage_HasPixels(dib) ? FALSE : TRUE; @@ -634,7 +634,7 @@ FreeImage_Clone(FIBITMAP *dib) { // ---------------------------------------------------------- -BYTE * DLL_CALLCONV +uint8_t * DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib) { if(!FreeImage_HasPixels(dib)) { return NULL; @@ -649,7 +649,7 @@ FreeImage_GetBits(FIBITMAP *dib) { lp += sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * FreeImage_GetColorsUsed(dib); lp += FreeImage_HasRGBMasks(dib) ? sizeof(DWORD) * 3 : 0; lp += (lp % FIBITMAP_ALIGNMENT ? FIBITMAP_ALIGNMENT - lp % FIBITMAP_ALIGNMENT : 0); - return (BYTE *)lp; + return (uint8_t *)lp; } // ---------------------------------------------------------- @@ -897,7 +897,7 @@ FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor) { if(bkgnd_color->rgbRed == pal[i].rgbRed) { if(bkgnd_color->rgbGreen == pal[i].rgbGreen) { if(bkgnd_color->rgbBlue == pal[i].rgbBlue) { - bkcolor->rgbReserved = (BYTE)i; + bkcolor->rgbReserved = (uint8_t)i; return TRUE; } } @@ -959,7 +959,7 @@ FreeImage_IsTransparent(FIBITMAP *dib) { return FALSE; } -BYTE * DLL_CALLCONV +uint8_t * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib) { return dib ? ((FREEIMAGEHEADER *)dib->data)->transparent_table : NULL; } @@ -981,7 +981,7 @@ FreeImage_GetTransparencyCount(FIBITMAP *dib) { } void DLL_CALLCONV -FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count) { +FreeImage_SetTransparencyTable(FIBITMAP *dib, uint8_t *table, int count) { if (dib) { count = MAX(0, MIN(count, 256)); if (FreeImage_GetBPP(dib) <= 8) { @@ -1022,7 +1022,7 @@ FreeImage_SetTransparentIndex(FIBITMAP *dib, int index) { if (dib) { int count = FreeImage_GetColorsUsed(dib); if (count) { - BYTE *new_tt = (BYTE *)malloc(count * sizeof(BYTE)); + uint8_t *new_tt = (uint8_t *)malloc(count * sizeof(uint8_t)); memset(new_tt, 0xFF, count); if ((index >= 0) && (index < count)) { new_tt[index] = 0x00; @@ -1049,7 +1049,7 @@ FreeImage_SetTransparentIndex(FIBITMAP *dib, int index) { int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib) { int count = FreeImage_GetTransparencyCount(dib); - BYTE *tt = FreeImage_GetTransparencyTable(dib); + uint8_t *tt = FreeImage_GetTransparencyTable(dib); for (int i = 0; i < count; i++) { if (tt[i] == 0) { return i; @@ -1140,7 +1140,7 @@ FreeImage_GetDIBSize(FIBITMAP *dib) { RGBQUAD * DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib) { - return (dib && FreeImage_GetBPP(dib) < 16) ? (RGBQUAD *)(((BYTE *)FreeImage_GetInfoHeader(dib)) + sizeof(BITMAPINFOHEADER)) : NULL; + return (dib && FreeImage_GetBPP(dib) < 16) ? (RGBQUAD *)(((uint8_t *)FreeImage_GetInfoHeader(dib)) + sizeof(BITMAPINFOHEADER)) : NULL; } unsigned DLL_CALLCONV @@ -1206,7 +1206,7 @@ FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag // calculate the size of a METADATAHEADER const size_t header_size = sizeof(METADATAHEADER); - handle->data = (BYTE *)malloc(header_size); + handle->data = (uint8_t *)malloc(header_size); if(handle->data) { memset(handle->data, 0, header_size); |