diff options
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h')
-rw-r--r-- | Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h index 3dfc939ccc5..d03f44c0884 100644 --- a/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h +++ b/Build/source/libs/xpdf/xpdf-src/splash/SplashBitmap.h @@ -16,9 +16,22 @@ #endif #include <stdio.h> +#include <limits.h> +#include <stdint.h> #include "SplashTypes.h" //------------------------------------------------------------------------ + +// ssize_t isn't well-defined, so define our own +#if SIZE_MAX == UINT_MAX + typedef int SplashBitmapRowSize; +# define SplashBitmapRowSizeMax INT_MAX +#else + typedef long long SplashBitmapRowSize; +# define SplashBitmapRowSizeMax LLONG_MAX +#endif + +//------------------------------------------------------------------------ // SplashBitmap //------------------------------------------------------------------------ @@ -37,8 +50,8 @@ public: int getWidth() { return width; } int getHeight() { return height; } - int getRowSize() { return rowSize; } - int getAlphaRowSize() { return width; } + SplashBitmapRowSize getRowSize() { return rowSize; } + size_t getAlphaRowSize() { return alphaRowSize; } SplashColorMode getMode() { return mode; } SplashColorPtr getDataPtr() { return data; } Guchar *getAlphaPtr() { return alpha; } @@ -58,8 +71,9 @@ public: private: int width, height; // size of bitmap - int rowSize; // size of one row of data, in bytes + SplashBitmapRowSize rowSize; // size of one row of data, in bytes // - negative for bottom-up bitmaps + size_t alphaRowSize; // size of one row of alpha, in bytes SplashColorMode mode; // color mode SplashColorPtr data; // pointer to row zero of the color data Guchar *alpha; // pointer to row zero of the alpha data @@ -68,4 +82,5 @@ private: friend class Splash; }; + #endif |