diff options
Diffstat (limited to 'src/image.hh')
-rw-r--r-- | src/image.hh | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/image.hh b/src/image.hh index 73b0e5e7..a66edaae 100644 --- a/src/image.hh +++ b/src/image.hh @@ -12,12 +12,24 @@ extern "C" { #include "bitvec.h" #include "url.h" +/* + * Defines + */ + +/* Arbitrary maximum for image size (to avoid image size-crafting attacks). */ +#define IMAGE_MAX_AREA (6000 * 6000) + +/* + * Types + */ + typedef struct _DilloImage DilloImage; typedef enum { DILLO_IMG_TYPE_INDEXED, DILLO_IMG_TYPE_RGB, DILLO_IMG_TYPE_GRAY, + DILLO_IMG_TYPE_CMYK_INV, DILLO_IMG_TYPE_NOTSET /* Initial value */ } DilloImgType; @@ -38,11 +50,7 @@ struct _DilloImage { uint_t width; uint_t height; - const uchar_t *cmap; /* Color map (only for indexed) */ - DilloImgType in_type; /* Image Type */ int32_t bg_color; /* Background color */ - - int ProcessedBytes; /* Amount of bytes already decoded */ bitvec_t *BitVec; /* Bit vector for decoded rows */ uint_t ScanNumber; /* Current decoding scan */ ImageState State; /* Processing status */ @@ -54,24 +62,16 @@ struct _DilloImage { /* * Function prototypes */ -DilloImage *a_Image_new(int width, int height, - const char *alt_text, int32_t bg_color); +DilloImage *a_Image_new(const char *alt_text, int32_t bg_color); void a_Image_ref(DilloImage *Image); void a_Image_unref(DilloImage *Image); void a_Image_set_parms(DilloImage *Image, void *v_imgbuf, DilloUrl *url, int version, uint_t width, uint_t height, DilloImgType type); -void a_Image_set_cmap(DilloImage *Image, const uchar_t *cmap); -void a_Image_new_scan(DilloImage *image, void *v_imgbuf); -void a_Image_write(DilloImage *Image, void *v_imgbuf, - const uchar_t *buf, uint_t y, int decode); +void a_Image_write(DilloImage *Image, uint_t y); void a_Image_close(DilloImage *Image); -void a_Image_imgbuf_ref(void *v_imgbuf); -void a_Image_imgbuf_unref(void *v_imgbuf); -void *a_Image_imgbuf_new(void *v_dw, int img_type, int width, int height) ; -int a_Image_imgbuf_last_reference(void *v_imgbuf); #ifdef __cplusplus } |