mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
Replace uint* (which are not defined on all systems) with the appropriate PRUint* types. Submitted by Jerry L. Kirk <Jerry.Kirk@Nexwarecorp.com>
This commit is contained in:
parent
f684b0c776
commit
fb429ede90
@ -141,44 +141,44 @@ typedef struct
|
||||
gif_struct {
|
||||
/* Parsing state machine */
|
||||
gstate state; /* Curent decoder master state */
|
||||
uint8 *hold; /* Accumulation buffer */
|
||||
PRUint8 *hold; /* Accumulation buffer */
|
||||
int32 hold_size; /* Capacity, in bytes, of accumulation buffer */
|
||||
uint8 *gather_head; /* Next byte to read in accumulation buffer */
|
||||
PRUint8 *gather_head; /* Next byte to read in accumulation buffer */
|
||||
int32 gather_request_size; /* Number of bytes to accumulate */
|
||||
int32 gathered; /* bytes accumulated so far*/
|
||||
gstate post_gather_state; /* State after requested bytes accumulated */
|
||||
int32 requested_buffer_fullness; /* For netscape application extension */
|
||||
|
||||
/* LZW decoder state machine */
|
||||
uint8 *stack; /* Base of decoder stack */
|
||||
uint8 *stackp; /* Current stack pointer */
|
||||
uint16 *prefix;
|
||||
uint8 *suffix;
|
||||
PRUint8 *stack; /* Base of decoder stack */
|
||||
PRUint8 *stackp; /* Current stack pointer */
|
||||
PRUint16 *prefix;
|
||||
PRUint8 *suffix;
|
||||
int datasize;
|
||||
int codesize;
|
||||
int codemask;
|
||||
int clear_code; /* Codeword used to trigger dictionary reset */
|
||||
int avail; /* Index of next available slot in dictionary */
|
||||
int oldcode;
|
||||
uint8 firstchar;
|
||||
PRUint8 firstchar;
|
||||
int count; /* Remaining # bytes in sub-block */
|
||||
int bits; /* Number of unread bits in "datum" */
|
||||
int32 datum; /* 32-bit input buffer */
|
||||
|
||||
/* Output state machine */
|
||||
int ipass; /* Interlace pass; Ranges 1-4 if interlaced. */
|
||||
uint rows_remaining; /* Rows remaining to be output */
|
||||
uint irow; /* Current output row, starting at zero */
|
||||
uint8 *rgbrow; /* Temporary storage for dithering/mapping */
|
||||
uint8 *rowbuf; /* Single scanline temporary buffer */
|
||||
uint8 *rowend; /* Pointer to end of rowbuf */
|
||||
uint8 *rowp; /* Current output pointer */
|
||||
PRUintn rows_remaining; /* Rows remaining to be output */
|
||||
PRUintn irow; /* Current output row, starting at zero */
|
||||
PRUint8 *rgbrow; /* Temporary storage for dithering/mapping */
|
||||
PRUint8 *rowbuf; /* Single scanline temporary buffer */
|
||||
PRUint8 *rowend; /* Pointer to end of rowbuf */
|
||||
PRUint8 *rowp; /* Current output pointer */
|
||||
|
||||
/* Image parameters */
|
||||
uint x_offset, y_offset; /* With respect to "screen" origin */
|
||||
uint height, width;
|
||||
uint last_x_offset, last_y_offset; /* With respect to "screen" origin */
|
||||
uint last_height, last_width;
|
||||
PRUintn x_offset, y_offset; /* With respect to "screen" origin */
|
||||
PRUintn height, width;
|
||||
PRUintn last_x_offset, last_y_offset; /* With respect to "screen" origin */
|
||||
PRUintn last_height, last_width;
|
||||
int interlaced; /* TRUE, if scanlines arrive interlaced order */
|
||||
int tpixel; /* Index of transparent pixel */
|
||||
int is_transparent; /* TRUE, if tpixel is valid */
|
||||
@ -189,14 +189,14 @@ gif_struct {
|
||||
IL_RGB *local_colormap; /* Per-image colormap */
|
||||
int local_colormap_size; /* Size of local colormap array. */
|
||||
int progressive_display; /* If TRUE, do Haeberli interlace hack */
|
||||
uint32 delay_time; /* Display time, in milliseconds,
|
||||
PRUint32 delay_time; /* Display time, in milliseconds,
|
||||
for this image in a multi-image GIF */
|
||||
|
||||
/* Global (multi-image) state */
|
||||
int screen_bgcolor; /* Logical screen background color */
|
||||
int version; /* Either 89 for GIF89 or 87 for GIF87 */
|
||||
uint screen_width; /* Logical screen width & height */
|
||||
uint screen_height;
|
||||
PRUintn screen_width; /* Logical screen width & height */
|
||||
PRUintn screen_height;
|
||||
IL_RGB *global_colormap; /* Default colormap if local not supplied */
|
||||
int global_colormap_size; /* Size of global colormap array. */
|
||||
int images_decoded; /* Counts images for multi-part GIFs */
|
||||
@ -270,7 +270,7 @@ output_row(gif_struct *gs)
|
||||
*/
|
||||
if (gs->progressive_display && gs->interlaced && (gs->ipass < 4))
|
||||
{
|
||||
uint row_dup=0, row_shift=0;
|
||||
PRUintn row_dup=0, row_shift=0;
|
||||
|
||||
switch (gs->ipass) {
|
||||
case 1:
|
||||
@ -300,7 +300,7 @@ output_row(gif_struct *gs)
|
||||
/* Clamp first and last rows to upper and lower edge of image. */
|
||||
if (drow_start < 0)
|
||||
drow_start = 0;
|
||||
if ((uint)drow_end >= gs->height)
|
||||
if ((PRUintn)drow_end >= gs->height)
|
||||
drow_end = gs->height - 1;
|
||||
}
|
||||
|
||||
@ -382,11 +382,11 @@ output_row(gif_struct *gs)
|
||||
|
||||
/* Perform Lempel-Ziv-Welch decoding */
|
||||
static int
|
||||
do_lzw(gif_struct *gs, const uint8 *q)
|
||||
do_lzw(gif_struct *gs, const PRUint8 *q)
|
||||
{
|
||||
int code;
|
||||
int incode;
|
||||
const uint8 *ch;
|
||||
const PRUint8 *ch;
|
||||
|
||||
/* Copy all the decoder state variables into locals so the compiler
|
||||
* won't worry about them being aliased. The locals will be homed
|
||||
@ -399,15 +399,15 @@ do_lzw(gif_struct *gs, const uint8 *q)
|
||||
int count = gs->count;
|
||||
int oldcode = gs->oldcode;
|
||||
int clear_code = gs->clear_code;
|
||||
uint8 firstchar = gs->firstchar;
|
||||
PRUint8 firstchar = gs->firstchar;
|
||||
int32 datum = gs->datum;
|
||||
uint16 *prefix = gs->prefix;
|
||||
uint8 *stackp = gs->stackp;
|
||||
uint8 *suffix = gs->suffix;
|
||||
uint8 *stack = gs->stack;
|
||||
uint8 *rowp = gs->rowp;
|
||||
uint8 *rowend = gs->rowend;
|
||||
uint rows_remaining = gs->rows_remaining;
|
||||
PRUint16 *prefix = gs->prefix;
|
||||
PRUint8 *stackp = gs->stackp;
|
||||
PRUint8 *suffix = gs->suffix;
|
||||
PRUint8 *stack = gs->stack;
|
||||
PRUint8 *rowp = gs->rowp;
|
||||
PRUint8 *rowend = gs->rowend;
|
||||
PRUintn rows_remaining = gs->rows_remaining;
|
||||
|
||||
|
||||
#define OUTPUT_ROW(gs) \
|
||||
@ -611,10 +611,10 @@ il_gif_destroy_transparency(il_container *ic)
|
||||
int
|
||||
il_gif_compute_percentage_complete(int row, il_container *ic)
|
||||
{
|
||||
uint percent_height;
|
||||
PRUintn percent_height;
|
||||
int percent_done = 0;
|
||||
|
||||
percent_height = (uint)(row * (uint32)100 / ic->image->header.height);
|
||||
percent_height = (PRUintn)(row * (PRUint32)100 / ic->image->header.height);
|
||||
switch(ic->pass) {
|
||||
case 0: percent_done = percent_height; /* non-interlaced GIF */
|
||||
break;
|
||||
@ -662,10 +662,10 @@ process_buffered_gif_input_data(gif_struct* gs)
|
||||
{
|
||||
gstate state;
|
||||
il_container *ic = gs->ic;
|
||||
uint8 err = 0;
|
||||
PRUint8 err = 0;
|
||||
|
||||
/* Force any data we've buffered up to be processed. */
|
||||
err = il_gif_write(ic, (uint8 *) "", 0);
|
||||
err = il_gif_write(ic, (PRUint8 *) "", 0);
|
||||
|
||||
/* The stream has already finished delivering data and the stream
|
||||
completion routine has been called sometime in the past. Now that
|
||||
@ -724,7 +724,7 @@ gif_delay_time_callback(void *closure)
|
||||
static int
|
||||
gif_clear_screen(gif_struct *gs)
|
||||
{
|
||||
uint erase_width=0, erase_height=0, erase_x_offset=0, erase_y_offset=0;
|
||||
PRUintn erase_width=0, erase_height=0, erase_x_offset=0, erase_y_offset=0;
|
||||
PRBool erase;
|
||||
il_container *ic = gs->ic;
|
||||
|
||||
@ -761,9 +761,9 @@ gif_clear_screen(gif_struct *gs)
|
||||
|
||||
if (erase)
|
||||
{
|
||||
uint i;
|
||||
PRUintn i;
|
||||
int src_trans_pixel_index;
|
||||
uint8 *rowbuf = gs->rowbuf;
|
||||
PRUint8 *rowbuf = gs->rowbuf;
|
||||
NI_PixmapHeader *src_header = ic->src_header;
|
||||
IL_IRGB *saved_src_trans_pixel, *saved_img_trans_pixel;
|
||||
|
||||
@ -813,13 +813,13 @@ gif_clear_screen(gif_struct *gs)
|
||||
*/
|
||||
|
||||
int
|
||||
il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
il_gif_write(il_container *ic, const PRUint8 *buf, int32 len)
|
||||
{
|
||||
int status;
|
||||
gif_struct *gs = (gif_struct *)ic->ds;
|
||||
NI_PixmapHeader *src_header = ic->src_header;
|
||||
NI_ColorMap *cmap = &src_header->color_space->cmap;
|
||||
const uint8 *q, *p=buf,*ep=buf+len;
|
||||
const PRUint8 *q, *p=buf,*ep=buf+len;
|
||||
|
||||
|
||||
/* If this assert fires, chances are the netlib flubbed and
|
||||
@ -892,11 +892,11 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
gs->datum = gs->bits = 0;
|
||||
|
||||
if (!gs->prefix)
|
||||
gs->prefix = (uint16 *)PR_Calloc(sizeof(uint16), MAX_BITS);
|
||||
gs->prefix = (PRUint16 *)PR_Calloc(sizeof(PRUint16), MAX_BITS);
|
||||
if (!gs->suffix)
|
||||
gs->suffix = ( uint8 *)PR_Calloc(sizeof(uint8), MAX_BITS);
|
||||
gs->suffix = ( PRUint8 *)PR_Calloc(sizeof(PRUint8), MAX_BITS);
|
||||
if (!gs->stack)
|
||||
gs->stack = ( uint8 *)PR_Calloc(sizeof(uint8), MAX_BITS);
|
||||
gs->stack = ( PRUint8 *)PR_Calloc(sizeof(PRUint8), MAX_BITS);
|
||||
|
||||
if( !gs->prefix || !gs->suffix || !gs->stack)
|
||||
{
|
||||
@ -1225,7 +1225,7 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
|
||||
case gif_image_header:
|
||||
{
|
||||
uint height, width;
|
||||
PRUintn height, width;
|
||||
|
||||
/* Get image offsets, with respect to the screen origin */
|
||||
gs->x_offset = GETINT16(q);
|
||||
@ -1266,8 +1266,8 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
/* than the screen size, we need to reallocate buffers. */
|
||||
if (gs->screen_width < width) {
|
||||
|
||||
gs->rgbrow = (uint8*)PR_REALLOC(gs->rgbrow, 3 * width);
|
||||
gs->rowbuf = (uint8*)PR_REALLOC(gs->rowbuf, width);
|
||||
gs->rgbrow = (PRUint8*)PR_REALLOC(gs->rgbrow, 3 * width);
|
||||
gs->rowbuf = (PRUint8*)PR_REALLOC(gs->rowbuf, width);
|
||||
|
||||
if((!gs->rgbrow)||(!gs->rowbuf)){
|
||||
gs->state = gif_oom;
|
||||
@ -1309,10 +1309,10 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
}
|
||||
else{
|
||||
if (!gs->rgbrow)
|
||||
gs->rgbrow = (uint8*)PR_MALLOC(3 * gs->screen_width);
|
||||
gs->rgbrow = (PRUint8*)PR_MALLOC(3 * gs->screen_width);
|
||||
|
||||
if (!gs->rowbuf)
|
||||
gs->rowbuf = (uint8*)PR_MALLOC(gs->screen_width);
|
||||
gs->rowbuf = (PRUint8*)PR_MALLOC(gs->screen_width);
|
||||
}
|
||||
|
||||
if (!gs->rowbuf || !gs->rgbrow)
|
||||
@ -1549,7 +1549,7 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
{ /* finish a prior gather */
|
||||
char *hold = (char*)gs->hold;
|
||||
BlockAllocCat(hold, gs->gathered, (char*)p, gather_remaining);
|
||||
gs->hold = (uint8*)hold;
|
||||
gs->hold = (PRUint8*)hold;
|
||||
q = gs->gather_head = gs->hold;
|
||||
gs->gathered = 0;
|
||||
}
|
||||
@ -1564,7 +1564,7 @@ il_gif_write(il_container *ic, const uint8 *buf, int32 len)
|
||||
{
|
||||
char *hold = (char*)gs->hold;
|
||||
BlockAllocCat(hold, gs->gathered, (char*)p, ep - p);
|
||||
gs->hold = (uint8*)hold;
|
||||
gs->hold = (PRUint8*)hold;
|
||||
gs->gather_head = gs->hold;
|
||||
gs->gathered += ep-p;
|
||||
return 0;
|
||||
|
@ -24,7 +24,7 @@
|
||||
/* gif.h */
|
||||
|
||||
extern PRBool il_gif_init(il_container *ic);
|
||||
extern int il_gif_write(il_container *, const uint8 *, int32);
|
||||
extern int il_gif_write(il_container *, const PRUint8 *, int32);
|
||||
extern void il_gif_complete(il_container *ic);
|
||||
extern PRUint8 il_gif_write_ready(il_container *ic);
|
||||
extern void il_gif_abort(il_container *ic);
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/*
|
||||
* jpeg.c --- Glue code to Independent JPEG Group decoder library
|
||||
* $Id: jpeg.cpp,v 1.10 1999/11/06 03:31:12 dmose%mozilla.org Exp $
|
||||
* $Id: jpeg.cpp,v 1.11 1999/11/13 22:37:31 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ PR_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* Normal JFIF markers can't have more bytes than this. */
|
||||
#define MAX_JPEG_MARKER_LENGTH (((uint32)1 << 16) - 1)
|
||||
#define MAX_JPEG_MARKER_LENGTH (((PRUint32)1 << 16) - 1)
|
||||
|
||||
/*
|
||||
* States that the jpeg decoder might be in
|
||||
@ -123,7 +123,7 @@ typedef struct {
|
||||
enum data_source_state state;
|
||||
|
||||
JOCTET *netlib_buffer; /* next buffer for fill_input_buffer */
|
||||
uint32 netlib_buflen;
|
||||
PRUint32 netlib_buflen;
|
||||
|
||||
/*
|
||||
* Buffer of "remaining" characters left over after a call to
|
||||
@ -206,7 +206,7 @@ fill_input_buffer (j_decompress_ptr jd)
|
||||
{
|
||||
il_source_mgr *src = (il_source_mgr *)jd->src;
|
||||
enum data_source_state src_state = src->state;
|
||||
uint32 bytesToSkip, new_backtrack_buflen, new_buflen, roundup_buflen;
|
||||
PRUint32 bytesToSkip, new_backtrack_buflen, new_buflen, roundup_buflen;
|
||||
unsigned char *new_buffer;
|
||||
|
||||
ILTRACE(5,("il:jpeg: fill, state=%d, nib=0x%x, bib=%d", src_state,
|
||||
@ -448,7 +448,7 @@ setup_jpeg_src (j_decompress_ptr jd, jpeg_struct *js)
|
||||
boolean PR_CALLBACK
|
||||
il_jpeg_COM_handler (j_decompress_ptr cinfo)
|
||||
{
|
||||
uint length;
|
||||
PRUintn length;
|
||||
char *comment;
|
||||
unsigned int ch;
|
||||
|
||||
@ -586,7 +586,7 @@ output_jpeg_scanlines(il_container *ic, int num_scanlines)
|
||||
int pass;
|
||||
|
||||
#ifdef DEBUG
|
||||
uint start_scanline = jd->output_scanline;
|
||||
PRUintn start_scanline = jd->output_scanline;
|
||||
#endif
|
||||
|
||||
if (js->state == JPEG_FINAL_PROGRESSIVE_SCAN_OUTPUT)
|
||||
@ -660,7 +660,7 @@ output_jpeg_scanlines(il_container *ic, int num_scanlines)
|
||||
static void
|
||||
jpeg_timeout_callback(void *closure)
|
||||
{
|
||||
uint32 delay;
|
||||
PRUint32 delay;
|
||||
jpeg_struct *js = (jpeg_struct *)closure;
|
||||
j_decompress_ptr jd = &js->jd;
|
||||
|
||||
@ -753,7 +753,7 @@ il_jpeg_write(il_container *ic, const unsigned char *buf, int32 len)
|
||||
|
||||
/* Register new buffer contents with data source manager. */
|
||||
src->netlib_buffer = (JOCTET*)buf;
|
||||
src->netlib_buflen = (uint32)len;
|
||||
src->netlib_buflen = (PRUint32)len;
|
||||
|
||||
input_exhausted = 0;
|
||||
while (! input_exhausted) {
|
||||
@ -857,7 +857,7 @@ il_jpeg_write(il_container *ic, const unsigned char *buf, int32 len)
|
||||
* instead. Thus, the decoder adapts to the data arrival rate.
|
||||
*/
|
||||
if (js->timeout == NULL) {
|
||||
uint32 delay;
|
||||
PRUint32 delay;
|
||||
|
||||
/*
|
||||
* First time around, display the scan a little
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
extern int il_jpeg_init(il_container *ic);
|
||||
extern int il_jpeg_write(il_container *, const uint8 *, int32);
|
||||
extern int il_jpeg_write(il_container *, const PRUint8 *, int32);
|
||||
extern void il_jpeg_complete(il_container *ic);
|
||||
//extern unsigned int il_jpeg_write_ready(il_container *ic);
|
||||
extern void il_jpeg_abort(il_container *ic);
|
||||
|
@ -305,9 +305,9 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
#define CRUDE_SHORTTERM_SCALE_CPP_WORKAROUND
|
||||
|
||||
#ifdef CRUDE_SHORTTERM_SCALE_CPP_WORKAROUND
|
||||
ipng_p->rgbrow = (uint8 *)PR_MALLOC(4*width);
|
||||
ipng_p->rgbrow = (PRUint8 *)PR_MALLOC(4*width);
|
||||
#else
|
||||
ipng_p->rgbrow = (uint8 *)PR_MALLOC(3*width);
|
||||
ipng_p->rgbrow = (PRUint8 *)PR_MALLOC(3*width);
|
||||
#endif
|
||||
if (!ipng_p->rgbrow) {
|
||||
ILTRACE(0, ("il:png: MEM row"));
|
||||
@ -317,7 +317,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
if (channels > 3) {
|
||||
#ifndef CRUDE_SHORTTERM_SCALE_CPP_WORKAROUND
|
||||
ipng_p->alpharow = (uint8 *)PR_MALLOC(width);
|
||||
ipng_p->alpharow = (PRUint8 *)PR_MALLOC(width);
|
||||
if (!ipng_p->alpharow) {
|
||||
ILTRACE(0, ("il:png: MEM row"));
|
||||
PR_FREEIF(ipng_p->rgbrow);
|
||||
@ -388,9 +388,9 @@ row_callback(png_structp png_ptr, png_bytep new_row,
|
||||
#ifdef CRUDE_SHORTTERM_SCALE_CPP_WORKAROUND
|
||||
memcpy(ipng_p->rgbrow, new_row, 4*ipng_p->width);
|
||||
#else
|
||||
uint32 i = ipng_p->width;
|
||||
uint8 *rgb = ipng_p->rgbrow;
|
||||
uint8 *a = ipng_p->alpharow;
|
||||
PRUint32 i = ipng_p->width;
|
||||
PRUint8 *rgb = ipng_p->rgbrow;
|
||||
PRUint8 *a = ipng_p->alpharow;
|
||||
png_byte *src = new_row;
|
||||
|
||||
while (i--) {
|
||||
|
@ -38,16 +38,16 @@ typedef struct ipng_str {
|
||||
|
||||
/* int rows_per_chunk; NOT USED (similar variable in jpeg_struct) */
|
||||
void *delay_timeout;
|
||||
uint32 delay_time;
|
||||
PRUint32 delay_time;
|
||||
|
||||
png_structp pngs_p;
|
||||
png_infop info_p;
|
||||
jmp_buf jmpbuf; /* use ours, not libpng's, for consistency */
|
||||
uint32 width;
|
||||
uint32 height;
|
||||
PRUint32 width;
|
||||
PRUint32 height;
|
||||
int channels; /* color channels (3 or 4) */
|
||||
uint8 *rgbrow; /* RGB row buffer (3*width bytes) */
|
||||
uint8 *alpharow; /* alpha row buffer (width bytes) */
|
||||
PRUint8 *rgbrow; /* RGB row buffer (3*width bytes) */
|
||||
PRUint8 *alpharow; /* alpha row buffer (width bytes) */
|
||||
|
||||
/* One scanline's worth of post-processed sample data */
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
/* pngdec.h */
|
||||
|
||||
extern int il_png_init(il_container *ic);
|
||||
extern int il_png_write(il_container *, const uint8 *, int32);
|
||||
extern int il_png_write(il_container *, const PRUint8 *, int32);
|
||||
extern int il_png_complete(il_container *ic);
|
||||
extern int il_png_abort(il_container *ic);
|
||||
//extern unsigned int il_png_write_ready(il_container *ic);
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/* -*- Mode: C; tab-width: 4 -*-
|
||||
* il_types.h --- Image library data types and structures.
|
||||
* $Id: il_types.h,v 3.4 1999/11/06 03:31:20 dmose%mozilla.org Exp $
|
||||
* $Id: il_types.h,v 3.5 1999/11/13 22:37:34 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -54,10 +54,10 @@
|
||||
|
||||
/* A rectangle structure. */
|
||||
typedef struct _IL_Rect {
|
||||
uint16 x_origin;
|
||||
uint16 y_origin;
|
||||
uint16 width;
|
||||
uint16 height;
|
||||
PRUint16 x_origin;
|
||||
PRUint16 y_origin;
|
||||
PRUint16 width;
|
||||
PRUint16 height;
|
||||
} IL_Rect;
|
||||
|
||||
/* Pixmap control messages issued by the imagelib to indicate that it
|
||||
@ -85,17 +85,17 @@ typedef void IL_ColorSpace; /* Colorspace. */
|
||||
|
||||
/* An indexed RGB triplet. */
|
||||
typedef struct _IL_IRGB {
|
||||
uint8 index;
|
||||
uint8 red, green, blue;
|
||||
PRUint8 index;
|
||||
PRUint8 red, green, blue;
|
||||
} IL_IRGB;
|
||||
|
||||
/* A RGB triplet representing a single pixel in the image's colormap
|
||||
(if present.) */
|
||||
typedef struct _IL_RGB
|
||||
{
|
||||
uint8 red, green, blue, pad; /* Windows requires the fourth byte &
|
||||
PRUint8 red, green, blue, pad; /* Windows requires the fourth byte &
|
||||
many compilers pad it anyway. */
|
||||
uint16 hist_count; /* Histogram frequency count. */
|
||||
PRUint16 hist_count; /* Histogram frequency count. */
|
||||
} IL_RGB;
|
||||
|
||||
#else /* Image Library and Front Ends. */
|
||||
@ -202,15 +202,15 @@ typedef struct {
|
||||
with a percent_progress value of 100. */
|
||||
|
||||
/* Data for IL_DIMENSIONS message. */
|
||||
uint16 width; /* Image width. */
|
||||
uint16 height; /* Image height. */
|
||||
PRUint16 width; /* Image width. */
|
||||
PRUint16 height; /* Image height. */
|
||||
|
||||
/* Data for IL_INTERNAL_IMAGE message, or for error messages which require
|
||||
an icon to be displayed: IL_ERROR_NO_DATA, IL_ERROR_IMAGE_DATA_CORRUPT,
|
||||
IL_ERROR_IMAGE_DATA_TRUNCATED, IL_ERROR_IMAGE_DATA_ILLEGAL or
|
||||
IL_ERROR_INTERNAL. */
|
||||
uint16 icon_width; /* Icon width. */
|
||||
uint16 icon_height; /* Icon height. */
|
||||
PRUint16 icon_width; /* Icon width. */
|
||||
PRUint16 icon_height; /* Icon height. */
|
||||
int32 icon_number; /* Icon number. */
|
||||
|
||||
} IL_MessageData;
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* -*- Mode: C; tab-width: 4 -*-
|
||||
* il_util.h Colormap and colorspace utilities.
|
||||
*
|
||||
* $Id: il_util.h,v 3.4 1999/11/06 03:31:21 dmose%mozilla.org Exp $
|
||||
* $Id: il_util.h,v 3.5 1999/11/13 22:37:34 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -47,15 +47,15 @@ XP_BEGIN_PROTOS
|
||||
be replaced when the Image Library has the capability to dither to an
|
||||
arbitrary palette. */
|
||||
IL_EXTERN(IL_ColorMap *)
|
||||
IL_NewCubeColorMap(IL_RGB *reserved_colors, uint16 num_reserved_colors,
|
||||
uint16 num_colors);
|
||||
IL_NewCubeColorMap(IL_RGB *reserved_colors, PRUint16 num_reserved_colors,
|
||||
PRUint16 num_colors);
|
||||
|
||||
/* Create an optimal fixed palette of the specified size, starting with
|
||||
the given set of reserved colors.
|
||||
XXX - This will not be implemented initially. */
|
||||
IL_EXTERN(IL_ColorMap *)
|
||||
IL_NewOptimalColorMap(IL_RGB *reserved_colors, uint16 num_reserved_colors,
|
||||
uint16 num_colors);
|
||||
IL_NewOptimalColorMap(IL_RGB *reserved_colors, PRUint16 num_reserved_colors,
|
||||
PRUint16 num_colors);
|
||||
|
||||
/* Create an empty colormap. The caller is responsible for filling in the
|
||||
colormap entries. */
|
||||
@ -87,7 +87,7 @@ IL_DestroyColorMap (IL_ColorMap *cmap);
|
||||
indices to the new indices.
|
||||
XXX Is this really necessary? */
|
||||
IL_EXTERN(void)
|
||||
IL_ReorderColorMap(IL_ColorMap *cmap, uint16 *new_order);
|
||||
IL_ReorderColorMap(IL_ColorMap *cmap, PRUint16 *new_order);
|
||||
|
||||
|
||||
/************************** Colorspace utilities *****************************/
|
||||
@ -99,7 +99,7 @@ IL_ReorderColorMap(IL_ColorMap *cmap, uint16 *new_order);
|
||||
contents of the IL_RGBBits structure will be copied, so they need not be
|
||||
preserved after the call to IL_CreateTrueColorSpace. */
|
||||
IL_EXTERN(IL_ColorSpace *)
|
||||
IL_CreateTrueColorSpace(IL_RGBBits *rgb, uint8 pixmap_depth);
|
||||
IL_CreateTrueColorSpace(IL_RGBBits *rgb, PRUint8 pixmap_depth);
|
||||
|
||||
/* Create a new Pseudo-colorspace using the given colormap and set the
|
||||
reference count to 1. The index_depth is the bit-depth of the colormap
|
||||
@ -113,15 +113,15 @@ IL_CreateTrueColorSpace(IL_RGBBits *rgb, uint8 pixmap_depth);
|
||||
IL_ColorSpace. Memory associated with the colormap will be freed by
|
||||
IL_ReleaseColorSpace when the reference count reaches zero. */
|
||||
IL_EXTERN(IL_ColorSpace *)
|
||||
IL_CreatePseudoColorSpace(IL_ColorMap *cmap, uint8 index_depth,
|
||||
uint8 pixmap_depth);
|
||||
IL_CreatePseudoColorSpace(IL_ColorMap *cmap, PRUint8 index_depth,
|
||||
PRUint8 pixmap_depth);
|
||||
|
||||
/* Create a new Greyscale-colorspace of depth specified by index_depth and
|
||||
set the reference count to 1. The pixmap_depth is the index_depth plus
|
||||
any additional allowance that might be necessary e.g. for an alpha channel,
|
||||
or for alignment. */
|
||||
IL_EXTERN(PRBool)
|
||||
IL_CreateGreyScaleColorSpace(uint8 index_depth, uint8 pixmap_depth, IL_ColorSpace **color_space);
|
||||
IL_CreateGreyScaleColorSpace(PRUint8 index_depth, PRUint8 pixmap_depth, IL_ColorSpace **color_space);
|
||||
|
||||
/* Decrements the reference count for an IL_ColorSpace. If the reference
|
||||
count reaches zero, all memory associated with the colorspace (including
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/* -*- Mode: C; tab-width: 4 -*-
|
||||
* libimg.h --- API calls to the Image Library.
|
||||
* $Id: libimg.h,v 3.5 1999/11/06 03:31:21 dmose%mozilla.org Exp $
|
||||
* $Id: libimg.h,v 3.6 1999/11/13 22:37:35 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -145,8 +145,8 @@ IL_GetImage(const char* url,
|
||||
IL_GroupContext *image_context,
|
||||
XP_ObserverList observer_list,
|
||||
IL_IRGB *background_color,
|
||||
uint32 width, uint32 height,
|
||||
uint32 flags,
|
||||
PRUint32 width, PRUint32 height,
|
||||
PRUint32 flags,
|
||||
void *net_context);
|
||||
|
||||
/* Release a reference to an image lib request. If there are no other
|
||||
@ -246,7 +246,7 @@ IL_GetNaturalDimensions(IL_ImageReq *image_req, int *width, int *height);
|
||||
- progressive_display - Toggle for progressive image display.
|
||||
- dither_mode - IL_ClosestColor, IL_Dither or IL_Auto. */
|
||||
IL_EXTERN(void)
|
||||
IL_SetDisplayMode(IL_GroupContext *image_context, uint32 display_flags,
|
||||
IL_SetDisplayMode(IL_GroupContext *image_context, PRUint32 display_flags,
|
||||
IL_DisplayData *display_data);
|
||||
|
||||
|
||||
@ -262,7 +262,7 @@ IL_Type(const char *buf, int32 len);
|
||||
/* Set limit on approximate size, in bytes, of all pixmap storage used by the
|
||||
Image Library. */
|
||||
IL_EXTERN(void)
|
||||
IL_SetCacheSize(uint32 new_size);
|
||||
IL_SetCacheSize(PRUint32 new_size);
|
||||
|
||||
|
||||
/************************ Memory management **********************************/
|
||||
@ -270,7 +270,7 @@ IL_SetCacheSize(uint32 new_size);
|
||||
/* Free num_bytes of memory by flushing the Least Recently Used (LRU) images
|
||||
from the image cache. */
|
||||
IL_EXTERN(void)
|
||||
IL_FreeMemory(IL_GroupContext *image_context, uint32 num_bytes);
|
||||
IL_FreeMemory(IL_GroupContext *image_context, PRUint32 num_bytes);
|
||||
|
||||
|
||||
/********************** Mac-specific memory-management ***********************/
|
||||
@ -286,7 +286,7 @@ IL_UnCache(IL_Pixmap *pixmap);
|
||||
cache. This may not always be possible either because all images
|
||||
in the cache are in use or because the cache is empty. Returns the
|
||||
new approximate size of the imagelib cache. */
|
||||
IL_EXTERN(uint32)
|
||||
IL_EXTERN(PRUint32)
|
||||
IL_ShrinkCache(void);
|
||||
|
||||
/* Remove as many images as possible from the image cache. The only
|
||||
@ -295,7 +295,7 @@ IL_EXTERN(void)
|
||||
IL_FlushCache(void);
|
||||
|
||||
/* Return the approximate storage consumed by the imagelib cache, in bytes */
|
||||
IL_EXTERN(uint32)
|
||||
IL_EXTERN(PRUint32)
|
||||
IL_GetCacheSize(void);
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
/*
|
||||
* ni_pixmp.h --- Cross platform pixmap data structure.
|
||||
* $Id: ni_pixmp.h,v 3.4 1999/11/06 03:31:21 dmose%mozilla.org Exp $
|
||||
* $Id: ni_pixmp.h,v 3.5 1999/11/13 22:37:35 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -68,19 +68,19 @@ typedef enum _NI_ColorSpaceType
|
||||
|
||||
/* RGB bit allocation and offsets. */
|
||||
typedef struct _NI_RGBBits {
|
||||
uint8 red_bits; /* Number of bits assigned to red channel. */
|
||||
uint8 red_shift; /* Offset for red channel bits. */
|
||||
uint8 green_bits; /* Number of bits assigned to green channel. */
|
||||
uint8 green_shift; /* Offset for green channel bits. */
|
||||
uint8 blue_bits; /* Number of bits assigned to blue channel. */
|
||||
uint8 blue_shift; /* Offset for blue channel bits. */
|
||||
PRUint8 red_bits; /* Number of bits assigned to red channel. */
|
||||
PRUint8 red_shift; /* Offset for red channel bits. */
|
||||
PRUint8 green_bits; /* Number of bits assigned to green channel. */
|
||||
PRUint8 green_shift; /* Offset for green channel bits. */
|
||||
PRUint8 blue_bits; /* Number of bits assigned to blue channel. */
|
||||
PRUint8 blue_shift; /* Offset for blue channel bits. */
|
||||
} NI_RGBBits;
|
||||
|
||||
|
||||
/* An indexed RGB triplet. */
|
||||
typedef struct _NI_IRGB {
|
||||
uint8 index;
|
||||
uint8 red, green, blue;
|
||||
PRUint8 index;
|
||||
PRUint8 red, green, blue;
|
||||
} NI_IRGB;
|
||||
|
||||
|
||||
@ -88,9 +88,9 @@ typedef struct _NI_IRGB {
|
||||
(if present.) */
|
||||
typedef struct _NI_RGB
|
||||
{
|
||||
uint8 red, green, blue, pad; /* Windows requires the fourth byte &
|
||||
PRUint8 red, green, blue, pad; /* Windows requires the fourth byte &
|
||||
many compilers pad it anyway. */
|
||||
uint16 hist_count; /* Histogram frequency count. */
|
||||
PRUint16 hist_count; /* Histogram frequency count. */
|
||||
} NI_RGB;
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ typedef struct _NI_ColorMap {
|
||||
A negative value can be used to denote a
|
||||
possibly non-unique set. */
|
||||
NI_RGB *map; /* Colormap colors. */
|
||||
uint8 *index; /* NULL, if map is in index order. Otherwise
|
||||
PRUint8 *index; /* NULL, if map is in index order. Otherwise
|
||||
specifies the indices of the map entries. */
|
||||
void *table; /* Lookup table for this colormap. Private to
|
||||
the Image Library. */
|
||||
@ -121,9 +121,9 @@ typedef struct _NI_ColorSpace {
|
||||
/* The dimensions of the colorspace. */
|
||||
union {
|
||||
NI_RGBBits rgb; /* For TrueColor. */
|
||||
uint8 index_depth; /* For PseudoColor and GreyScale. */
|
||||
PRUint8 index_depth; /* For PseudoColor and GreyScale. */
|
||||
} bit_alloc; /* Allocation of bits. */
|
||||
uint8 pixmap_depth; /* Total bit depth (including alpha or pad.) */
|
||||
PRUint8 pixmap_depth; /* Total bit depth (including alpha or pad.) */
|
||||
|
||||
/* Colormap information. This may be used for one of three purposes:
|
||||
- If the colorspace belongs to a PseudoColor source image, then the
|
||||
@ -142,10 +142,10 @@ typedef struct _NI_ColorSpace {
|
||||
void *private_data;
|
||||
|
||||
/* Special purpose flags for OS-specific problems. */
|
||||
uint8 os_flags; /* Flags are of type NI_OSFlags. */
|
||||
PRUint8 os_flags; /* Flags are of type NI_OSFlags. */
|
||||
|
||||
/* Reference counter. */
|
||||
uint32 ref_count;
|
||||
PRUint32 ref_count;
|
||||
} NI_ColorSpace;
|
||||
|
||||
|
||||
@ -153,9 +153,9 @@ typedef struct _NI_ColorSpace {
|
||||
typedef struct _NI_PixmapHeader
|
||||
{
|
||||
/* Size. */
|
||||
uint32 width; /* Width. */
|
||||
uint32 height; /* Height. */
|
||||
uint32 widthBytes; /* width * depth / 8. May be aligned for
|
||||
PRUint32 width; /* Width. */
|
||||
PRUint32 height; /* Height. */
|
||||
PRUint32 widthBytes; /* width * depth / 8. May be aligned for
|
||||
optimizations. */
|
||||
|
||||
/* Colorspace. */
|
||||
@ -164,8 +164,8 @@ typedef struct _NI_PixmapHeader
|
||||
/* Transparency. */
|
||||
NI_IRGB *transparent_pixel; /* The image's transparent pixel
|
||||
(if present.) */
|
||||
uint8 alpha_bits; /* Number of bits assigned to alpha channel. */
|
||||
uint8 alpha_shift; /* Offset for alpha channel bits. */
|
||||
PRUint8 alpha_bits; /* Number of bits assigned to alpha channel. */
|
||||
PRUint8 alpha_shift; /* Offset for alpha channel bits. */
|
||||
int32 is_interleaved_alpha; /* Is alpha channel interleaved with
|
||||
image data? */
|
||||
PRPackedBool is_mask; /* Is this image a mask? (Boolean) */
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/* if.h --- Top-level image library internal routines
|
||||
*
|
||||
* $Id: if_struct.h,v 1.6 1999/11/06 03:31:22 dmose%mozilla.org Exp $
|
||||
* $Id: if_struct.h,v 1.7 1999/11/13 22:37:36 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
#ifndef _if_h
|
||||
@ -131,8 +131,8 @@ typedef enum _IL_ConversionType {
|
||||
IL_GreyToGrey = 0x24
|
||||
} IL_ConversionType;
|
||||
|
||||
typedef void (*il_converter)(il_container *ic, const uint8 *mask,
|
||||
const uint8 *sp, int x_offset,
|
||||
typedef void (*il_converter)(il_container *ic, const PRUint8 *mask,
|
||||
const PRUint8 *sp, int x_offset,
|
||||
int num, void XP_HUGE *out);
|
||||
|
||||
enum icstate {
|
||||
@ -179,8 +179,8 @@ struct il_container_struct {
|
||||
ilIURL *url;
|
||||
char *url_address; /* Same as url->address if there is no redirection*/
|
||||
|
||||
uint32 hash;
|
||||
uint32 urlhash;
|
||||
PRUint32 hash;
|
||||
PRUint32 urlhash;
|
||||
|
||||
enum icstate state;
|
||||
int sized;
|
||||
@ -200,7 +200,7 @@ struct il_container_struct {
|
||||
int update_start_row; /* Scanline range to send to FE */
|
||||
int update_end_row;
|
||||
|
||||
uint32 bytes_consumed; /* Bytes read from the stream so far */
|
||||
PRUint32 bytes_consumed; /* Bytes read from the stream so far */
|
||||
|
||||
NI_PixmapHeader *src_header; /* Source image header information. */
|
||||
IL_Pixmap *image; /* Destination image pixmap structure. */
|
||||
@ -216,12 +216,12 @@ struct il_container_struct {
|
||||
class nsIImgDCallbk *imgdcb;
|
||||
|
||||
void *row_output_timeout;
|
||||
uint8 *scalerow;
|
||||
PRUint8 *scalerow;
|
||||
int pass; /* pass (scan #) of a multi-pass image.
|
||||
Used for interlaced GIFs & p-JPEGs */
|
||||
|
||||
int forced;
|
||||
uint32 content_length;
|
||||
PRUint32 content_length;
|
||||
|
||||
int dest_width, dest_height; /* Target dimensions of the image */
|
||||
PRPackedBool natural_size; /* True if the image is decoded to its natural
|
||||
|
@ -24,7 +24,7 @@
|
||||
* il_utilp.h Colormap and colorspace utilities - types and definitions
|
||||
* private to Image Library.
|
||||
*
|
||||
* $Id: il_utilp.h,v 1.3 1999/11/06 03:31:23 dmose%mozilla.org Exp $
|
||||
* $Id: il_utilp.h,v 1.4 1999/11/13 22:37:37 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -67,13 +67,13 @@ typedef struct il_ColorSpaceData {
|
||||
contribution to a depth N pixmap e.g. for a 24 to 16-bit color
|
||||
conversion, the output pixel is given by
|
||||
|
||||
uint8 red, green, blue;
|
||||
uint16 output_pixel;
|
||||
PRUint8 red, green, blue;
|
||||
PRUint16 output_pixel;
|
||||
output_pixel = r8torgbn[red] + g8torgbn[green] + b8torgbn[blue];
|
||||
|
||||
Depth conversion maps are created for the following destination image
|
||||
pixmap depths: N = 8, 16 and 32. The type of the array elements is a
|
||||
uintN. */
|
||||
PRUintn. */
|
||||
void *r8torgbn;
|
||||
void *g8torgbn;
|
||||
void *b8torgbn;
|
||||
|
@ -43,13 +43,13 @@ public:
|
||||
NS_IMETHOD ImgDCBSetupColorspaceConverter()=0;
|
||||
NS_IMETHOD ImgDCBCreateGreyScaleColorSpace()=0;
|
||||
|
||||
NS_IMETHOD_(void*) ImgDCBSetTimeout(TimeoutCallbackFunction func, void* closure, uint32 msecs)=0;
|
||||
NS_IMETHOD_(void*) ImgDCBSetTimeout(TimeoutCallbackFunction func, void* closure, PRUint32 msecs)=0;
|
||||
NS_IMETHOD ImgDCBClearTimeout(void *timer_id)=0;
|
||||
|
||||
NS_IMETHOD ImgDCBHaveHdr(int destwidth, int destheight )=0;
|
||||
|
||||
NS_IMETHOD ImgDCBHaveRow(uint8 *rowbuf, uint8* rgbrow, int x_offset, int len,
|
||||
int row, int dup_rowcnt, uint8 draw_mode,
|
||||
NS_IMETHOD ImgDCBHaveRow(PRUint8 *rowbuf, PRUint8* rgbrow, int x_offset, int len,
|
||||
int row, int dup_rowcnt, PRUint8 draw_mode,
|
||||
int pass )=0;
|
||||
|
||||
|
||||
|
@ -50,15 +50,15 @@ public:
|
||||
NS_IMETHOD ImgDCBCreateGreyScaleColorSpace();
|
||||
|
||||
NS_IMETHOD_(void*) ImgDCBSetTimeout(TimeoutCallbackFunction func,
|
||||
void* closure, uint32 msecs);
|
||||
void* closure, PRUint32 msecs);
|
||||
NS_IMETHOD ImgDCBClearTimeout(void *timer_id);
|
||||
|
||||
|
||||
/* callbacks from the decoder */
|
||||
NS_IMETHOD ImgDCBHaveHdr(int destwidth, int destheight);
|
||||
NS_IMETHOD ImgDCBHaveRow(uint8*, uint8*,
|
||||
NS_IMETHOD ImgDCBHaveRow(PRUint8*, PRUint8*,
|
||||
int, int, int, int,
|
||||
uint8 , int);
|
||||
PRUint8 , int);
|
||||
|
||||
NS_IMETHOD ImgDCBHaveImageFrame();
|
||||
NS_IMETHOD ImgDCBHaveImageAll();
|
||||
|
@ -25,7 +25,7 @@
|
||||
Includes dithering for B&W displays, but not dithering
|
||||
for PseudoColor displays which can be found in dither.c.
|
||||
|
||||
$Id: color.cpp,v 3.13 1999/11/06 03:31:25 dmose%mozilla.org Exp $
|
||||
$Id: color.cpp,v 3.14 1999/11/13 22:37:39 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#pragma profile on
|
||||
#endif
|
||||
|
||||
uint8 il_identity_index_map[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
PRUint8 il_identity_index_map[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
|
||||
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
|
||||
@ -58,18 +58,18 @@ uint8 il_identity_index_map[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
|
||||
static void
|
||||
ConvertRGBToCI(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint8 red, green, blue, map_index;
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *) vout + x_offset;
|
||||
const uint8 *end = sp + 3*num;
|
||||
PRUint8 red, green, blue, map_index;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *) vout + x_offset;
|
||||
const PRUint8 *end = sp + 3*num;
|
||||
IL_ColorMap *cmap = &ic->image->header.color_space->cmap;
|
||||
uint8 *lookup_table = (uint8 *)cmap->table;
|
||||
uint8 *index_map = cmap->index;
|
||||
PRUint8 *lookup_table = (PRUint8 *)cmap->table;
|
||||
PRUint8 *index_map = cmap->index;
|
||||
|
||||
if (index_map == NULL)
|
||||
{
|
||||
@ -108,22 +108,22 @@ ConvertRGBToCI(il_container *ic,
|
||||
|
||||
static void
|
||||
DitherConvertRGBToCI(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *) vout + x_offset;
|
||||
const uint8 XP_HUGE *end = out + num;
|
||||
uint8 *index_map = ic->image->header.color_space->cmap.index;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *) vout + x_offset;
|
||||
const PRUint8 XP_HUGE *end = out + num;
|
||||
PRUint8 *index_map = ic->image->header.color_space->cmap.index;
|
||||
|
||||
if (index_map == NULL)
|
||||
{
|
||||
index_map = il_identity_index_map;
|
||||
}
|
||||
|
||||
il_quantize_fs_dither(ic, mask, sp, x_offset, (uint8 XP_HUGE *) vout, num);
|
||||
il_quantize_fs_dither(ic, mask, sp, x_offset, (PRUint8 XP_HUGE *) vout, num);
|
||||
if (mask) {
|
||||
while (out < end) {
|
||||
if (*mask++)
|
||||
@ -142,8 +142,8 @@ struct fs_data {
|
||||
long* err1;
|
||||
long* err2;
|
||||
long* err3;
|
||||
uint8 *greypixels;
|
||||
uint8 *bwpixels;
|
||||
PRUint8 *greypixels;
|
||||
PRUint8 *bwpixels;
|
||||
int width;
|
||||
int direction;
|
||||
long threshval, sum;
|
||||
@ -162,8 +162,8 @@ init_fs_dither(il_container *ic)
|
||||
fs->direction = 1;
|
||||
fs->err1 = (long*) PR_Calloc(fs->width+2, sizeof(long));
|
||||
fs->err2 = (long*) PR_Calloc(fs->width+2, sizeof(long));
|
||||
fs->greypixels = (uint8 *)PR_Calloc(fs->width+7, 1);
|
||||
fs->bwpixels = (uint8 *)PR_Calloc(fs->width+7, 1);
|
||||
fs->greypixels = (PRUint8 *)PR_Calloc(fs->width+7, 1);
|
||||
fs->bwpixels = (PRUint8 *)PR_Calloc(fs->width+7, 1);
|
||||
#ifdef XP_UNIX
|
||||
{
|
||||
int i;
|
||||
@ -181,18 +181,18 @@ init_fs_dither(il_container *ic)
|
||||
|
||||
static void
|
||||
ConvertRGBToBW(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint32 fgmask32, bgmask32;
|
||||
uint32 *m;
|
||||
PRUint32 fgmask32, bgmask32;
|
||||
PRUint32 *m;
|
||||
int mask_bit;
|
||||
struct fs_data *fs = (struct fs_data *)ic->quantize;
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *)vout;
|
||||
uint8 *gp, *bp;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *)vout;
|
||||
PRUint8 *gp, *bp;
|
||||
int col, limitcol;
|
||||
long grey;
|
||||
long sum;
|
||||
@ -208,14 +208,14 @@ ConvertRGBToBW(il_container *ic,
|
||||
for(col=0; col<fs->width; col++)
|
||||
{
|
||||
/* CCIR 709 */
|
||||
uint8 r = *sp++;
|
||||
uint8 g = *sp++;
|
||||
uint8 b = *sp++;
|
||||
grey = ((uint)(0.299 * 4096) * r +
|
||||
(uint)(0.587 * 4096) * g +
|
||||
(uint)(0.114 * 4096) * b) / 4096;
|
||||
PRUint8 r = *sp++;
|
||||
PRUint8 g = *sp++;
|
||||
PRUint8 b = *sp++;
|
||||
grey = ((PRUintn)(0.299 * 4096) * r +
|
||||
(PRUintn)(0.587 * 4096) * g +
|
||||
(PRUintn)(0.114 * 4096) * b) / 4096;
|
||||
|
||||
*gp++ = (uint8)grey;
|
||||
*gp++ = (PRUint8)grey;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -291,18 +291,18 @@ ConvertRGBToBW(il_container *ic,
|
||||
bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
fgmask32 = 0;
|
||||
|
||||
m = ((uint32*)out) + (x_offset >> 5);
|
||||
m = ((PRUint32*)out) + (x_offset >> 5);
|
||||
mask_bit = ~x_offset & 0x1f; /* next bit to write in 32-bit mask */
|
||||
|
||||
/* Add a bit to the row of mask bits. Flush accumulator to memory if full. */
|
||||
#define SHIFT_IMAGE_MASK(opaqueness, pixel) \
|
||||
{ \
|
||||
fgmask32 |= ((uint32)pixel & opaqueness) << M32(mask_bit); \
|
||||
bgmask32 |= ((uint32)((pixel ^ 1) & opaqueness)) << M32(mask_bit); \
|
||||
fgmask32 |= ((PRUint32)pixel & opaqueness) << M32(mask_bit); \
|
||||
bgmask32 |= ((PRUint32)((pixel ^ 1) & opaqueness)) << M32(mask_bit); \
|
||||
\
|
||||
/* Filled up 32-bit mask word. Write it to memory. */ \
|
||||
if (mask_bit-- == 0) { \
|
||||
uint32 mtmp = *m; \
|
||||
PRUint32 mtmp = *m; \
|
||||
mtmp |= fgmask32; \
|
||||
mtmp &= ~bgmask32; \
|
||||
*m++ = mtmp; \
|
||||
@ -324,7 +324,7 @@ ConvertRGBToBW(il_container *ic,
|
||||
|
||||
/* End of scan line. Write out any remaining mask bits. */
|
||||
if (mask_bit < 31) {
|
||||
uint32 mtmp = *m;
|
||||
PRUint32 mtmp = *m;
|
||||
mtmp |= fgmask32;
|
||||
mtmp &= ~bgmask32;
|
||||
*m = mtmp;
|
||||
@ -333,16 +333,16 @@ ConvertRGBToBW(il_container *ic,
|
||||
|
||||
static void
|
||||
ConvertRGBToGrey8(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint r, g, b;
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *)vout + x_offset;
|
||||
const uint8 *end = sp + num*3;
|
||||
uint32 grey;
|
||||
PRUintn r, g, b;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *)vout + x_offset;
|
||||
const PRUint8 *end = sp + num*3;
|
||||
PRUint32 grey;
|
||||
|
||||
if (!mask)
|
||||
{
|
||||
@ -352,11 +352,11 @@ ConvertRGBToGrey8(il_container *ic,
|
||||
r = sp[0];
|
||||
g = sp[1];
|
||||
b = sp[2];
|
||||
grey = ((uint)(0.299 * 4096) * r +
|
||||
(uint)(0.587 * 4096) * g +
|
||||
(uint)(0.114 * 4096) * b) / 4096;
|
||||
grey = ((PRUintn)(0.299 * 4096) * r +
|
||||
(PRUintn)(0.587 * 4096) * g +
|
||||
(PRUintn)(0.114 * 4096) * b) / 4096;
|
||||
|
||||
*out = (uint8)grey;
|
||||
*out = (PRUint8)grey;
|
||||
out++;
|
||||
sp += 3;
|
||||
}
|
||||
@ -372,10 +372,10 @@ ConvertRGBToGrey8(il_container *ic,
|
||||
r = sp[0];
|
||||
g = sp[1];
|
||||
b = sp[2];
|
||||
grey = ((uint)(0.299 * 4096) * r +
|
||||
(uint)(0.587 * 4096) * g +
|
||||
(uint)(0.114 * 4096) * b) / 4096;
|
||||
*out = (uint8)grey;
|
||||
grey = ((PRUintn)(0.299 * 4096) * r +
|
||||
(PRUintn)(0.587 * 4096) * g +
|
||||
(PRUintn)(0.114 * 4096) * b) / 4096;
|
||||
*out = (PRUint8)grey;
|
||||
}
|
||||
out++;
|
||||
sp += 3;
|
||||
@ -385,20 +385,20 @@ ConvertRGBToGrey8(il_container *ic,
|
||||
|
||||
static void
|
||||
ConvertRGBToRGB8(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint r, g, b, pixel;
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *) vout + x_offset;
|
||||
const uint8 *end = sp + num*3;
|
||||
PRUintn r, g, b, pixel;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *) vout + x_offset;
|
||||
const PRUint8 *end = sp + num*3;
|
||||
il_ColorSpaceData *private_data =
|
||||
(il_ColorSpaceData *)ic->image->header.color_space->private_data;
|
||||
uint8 *rm = (uint8*)private_data->r8torgbn;
|
||||
uint8 *gm = (uint8*)private_data->g8torgbn;
|
||||
uint8 *bm = (uint8*)private_data->b8torgbn;
|
||||
PRUint8 *rm = (PRUint8*)private_data->r8torgbn;
|
||||
PRUint8 *gm = (PRUint8*)private_data->g8torgbn;
|
||||
PRUint8 *bm = (PRUint8*)private_data->b8torgbn;
|
||||
if (!mask)
|
||||
{
|
||||
while (sp < end)
|
||||
@ -431,20 +431,20 @@ ConvertRGBToRGB8(il_container *ic,
|
||||
|
||||
static void
|
||||
ConvertRGBToRGB16(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint r, g, b, pixel;
|
||||
uint16 XP_HUGE *out = (uint16 XP_HUGE *) vout + x_offset;
|
||||
const uint8 *end = sp + num*3;
|
||||
PRUintn r, g, b, pixel;
|
||||
PRUint16 XP_HUGE *out = (PRUint16 XP_HUGE *) vout + x_offset;
|
||||
const PRUint8 *end = sp + num*3;
|
||||
il_ColorSpaceData *private_data =
|
||||
(il_ColorSpaceData *)ic->image->header.color_space->private_data;
|
||||
uint16 *rm = (uint16*)private_data->r8torgbn;
|
||||
uint16 *gm = (uint16*)private_data->g8torgbn;
|
||||
uint16 *bm = (uint16*)private_data->b8torgbn;
|
||||
PRUint16 *rm = (PRUint16*)private_data->r8torgbn;
|
||||
PRUint16 *gm = (PRUint16*)private_data->g8torgbn;
|
||||
PRUint16 *bm = (PRUint16*)private_data->b8torgbn;
|
||||
|
||||
if (!mask)
|
||||
{
|
||||
@ -478,14 +478,14 @@ ConvertRGBToRGB16(il_container *ic,
|
||||
|
||||
static void
|
||||
ConvertRGBToRGB24(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint8 XP_HUGE *out = (uint8 XP_HUGE *) vout + (3 * x_offset);
|
||||
const uint8 *end = sp + num*3;
|
||||
PRUint8 XP_HUGE *out = (PRUint8 XP_HUGE *) vout + (3 * x_offset);
|
||||
const PRUint8 *end = sp + num*3;
|
||||
/* XXX this is a hack because it ignores the shifts */
|
||||
|
||||
// The XP_UNIX define down here is needed because the unix gtk
|
||||
@ -539,20 +539,20 @@ ConvertRGBToRGB24(il_container *ic,
|
||||
|
||||
static void
|
||||
ConvertRGBToRGB32(il_container *ic,
|
||||
const uint8 *mask,
|
||||
const uint8 *sp,
|
||||
const PRUint8 *mask,
|
||||
const PRUint8 *sp,
|
||||
int x_offset,
|
||||
int num,
|
||||
void XP_HUGE *vout)
|
||||
{
|
||||
uint r, g, b, pixel;
|
||||
uint32 XP_HUGE *out = (uint32 XP_HUGE *) vout + x_offset;
|
||||
const uint8 *end = sp + num*3;
|
||||
PRUintn r, g, b, pixel;
|
||||
PRUint32 XP_HUGE *out = (PRUint32 XP_HUGE *) vout + x_offset;
|
||||
const PRUint8 *end = sp + num*3;
|
||||
il_ColorSpaceData *private_data =
|
||||
(il_ColorSpaceData *)ic->image->header.color_space->private_data;
|
||||
uint32 *rm = (uint32*)private_data->r8torgbn;
|
||||
uint32 *gm = (uint32*)private_data->g8torgbn;
|
||||
uint32 *bm = (uint32*)private_data->b8torgbn;
|
||||
PRUint32 *rm = (PRUint32*)private_data->r8torgbn;
|
||||
PRUint32 *gm = (PRUint32*)private_data->g8torgbn;
|
||||
PRUint32 *bm = (PRUint32*)private_data->b8torgbn;
|
||||
|
||||
if (!mask)
|
||||
{
|
||||
@ -585,10 +585,10 @@ ConvertRGBToRGB32(il_container *ic,
|
||||
}
|
||||
|
||||
/* Sorting predicate for NS_QuickSort() */
|
||||
int compare_uint32(const void *a, const void *b, void *unused)
|
||||
int compare_PRUint32(const void *a, const void *b, void *unused)
|
||||
{
|
||||
uint32 a1 = *(uint32*)a;
|
||||
uint32 b1 = *(uint32*)b;
|
||||
PRUint32 a1 = *(PRUint32*)a;
|
||||
PRUint32 b1 = *(PRUint32*)b;
|
||||
|
||||
return (a1 < b1) ? -1 : ((a1 > b1) ? 1 : 0);
|
||||
}
|
||||
@ -597,12 +597,12 @@ int compare_uint32(const void *a, const void *b, void *unused)
|
||||
static void
|
||||
unique_map_colors(NI_ColorMap *cmap)
|
||||
{
|
||||
uint i;
|
||||
uint32 ind[256];
|
||||
PRUintn i;
|
||||
PRUint32 ind[256];
|
||||
int32 num_colors = cmap->num_colors;
|
||||
IL_RGB *map = cmap->map;
|
||||
uint max_colors;
|
||||
uint unique_colors = 1;
|
||||
PRUintn max_colors;
|
||||
PRUintn unique_colors = 1;
|
||||
|
||||
/* A -ve value for cmap->num_colors indicates that the colors may be
|
||||
non-unique. */
|
||||
@ -620,7 +620,7 @@ unique_map_colors(NI_ColorMap *cmap)
|
||||
}
|
||||
|
||||
/* Sort by color, so identical colors will be grouped together. */
|
||||
NS_QuickSort(ind, max_colors, sizeof(*ind), compare_uint32, NULL);
|
||||
NS_QuickSort(ind, max_colors, sizeof(*ind), compare_PRUint32, NULL);
|
||||
|
||||
/* Look for adjacent colors with different values */
|
||||
for (i = 0; i < max_colors-1; i++)
|
||||
@ -639,8 +639,8 @@ unique_map_colors(NI_ColorMap *cmap)
|
||||
static int32
|
||||
il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
{
|
||||
register uint8 red_bits, green_bits, blue_bits;
|
||||
register uint8 red_shift, green_shift, blue_shift;
|
||||
register PRUint8 red_bits, green_bits, blue_bits;
|
||||
register PRUint8 red_shift, green_shift, blue_shift;
|
||||
int32 j, k;
|
||||
int32 pixmap_depth = color_space->pixmap_depth;
|
||||
IL_RGBBits *rgb = &color_space->bit_alloc.rgb;
|
||||
@ -663,7 +663,7 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
switch(pixmap_depth) {
|
||||
case 8: /* 8-bit TrueColor. */
|
||||
{
|
||||
uint8 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
PRUint8 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
|
||||
private_data->r8torgbn = PR_MALLOC(256);
|
||||
private_data->g8torgbn = PR_MALLOC(256);
|
||||
@ -677,20 +677,20 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
}
|
||||
|
||||
/* XXXM12N These could be optimized. */
|
||||
tmp_map = (uint8*)private_data->r8torgbn;
|
||||
tmp_map = (PRUint8*)private_data->r8torgbn;
|
||||
for (j = 0; j < (1 << red_bits); j++)
|
||||
for (k = 0; k < (1 << (8 - red_bits)); k++)
|
||||
*tmp_map++ = (uint8)(j << red_shift);
|
||||
*tmp_map++ = (PRUint8)(j << red_shift);
|
||||
|
||||
tmp_map = (uint8*)private_data->g8torgbn;
|
||||
tmp_map = (PRUint8*)private_data->g8torgbn;
|
||||
for (j = 0; j < (1 << green_bits); j++)
|
||||
for (k = 0; k < (1 << (8 - green_bits)); k++)
|
||||
*tmp_map++ = (uint8)(j << green_shift);
|
||||
*tmp_map++ = (PRUint8)(j << green_shift);
|
||||
|
||||
tmp_map = (uint8*)private_data->b8torgbn;
|
||||
tmp_map = (PRUint8*)private_data->b8torgbn;
|
||||
for (j = 0; j < (1 << blue_bits); j++)
|
||||
for (k = 0; k < (1 << (8 - blue_bits)); k++)
|
||||
*tmp_map++ = (uint8)(j << blue_shift);
|
||||
*tmp_map++ = (PRUint8)(j << blue_shift);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -699,11 +699,11 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
{
|
||||
PRBool win95_rounding; /* True if Win95 color quatization bug is
|
||||
present. */
|
||||
uint16 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
PRUint16 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
|
||||
private_data->r8torgbn = PR_MALLOC(sizeof(uint16) * 256);
|
||||
private_data->g8torgbn = PR_MALLOC(sizeof(uint16) * 256);
|
||||
private_data->b8torgbn = PR_MALLOC(sizeof(uint16) * 256);
|
||||
private_data->r8torgbn = PR_MALLOC(sizeof(PRUint16) * 256);
|
||||
private_data->g8torgbn = PR_MALLOC(sizeof(PRUint16) * 256);
|
||||
private_data->b8torgbn = PR_MALLOC(sizeof(PRUint16) * 256);
|
||||
|
||||
if (!(private_data->r8torgbn &&
|
||||
private_data->g8torgbn &&
|
||||
@ -721,19 +721,19 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
#define ROUND(v, b) (win95_rounding ? WACKY(v, b) : (v))
|
||||
|
||||
/* XXXM12N These could be optimized. */
|
||||
tmp_map = (uint16*)private_data->r8torgbn;
|
||||
tmp_map = (PRUint16*)private_data->r8torgbn;
|
||||
for (j = 0; j < 256; j++)
|
||||
*tmp_map++ = (uint16)(ROUND(j, red_bits) >> (8 - red_bits) <<
|
||||
*tmp_map++ = (PRUint16)(ROUND(j, red_bits) >> (8 - red_bits) <<
|
||||
red_shift);
|
||||
|
||||
tmp_map = (uint16*)private_data->g8torgbn;
|
||||
tmp_map = (PRUint16*)private_data->g8torgbn;
|
||||
for (j = 0; j < 256; j++)
|
||||
*tmp_map++ = (uint16)(ROUND(j, green_bits) >> (8 - green_bits) <<
|
||||
*tmp_map++ = (PRUint16)(ROUND(j, green_bits) >> (8 - green_bits) <<
|
||||
green_shift);
|
||||
|
||||
tmp_map = (uint16*)private_data->b8torgbn;
|
||||
tmp_map = (PRUint16*)private_data->b8torgbn;
|
||||
for (j = 0; j < 256; j++)
|
||||
*tmp_map++ = (uint16)(ROUND(j, blue_bits) >> (8 - blue_bits) <<
|
||||
*tmp_map++ = (PRUint16)(ROUND(j, blue_bits) >> (8 - blue_bits) <<
|
||||
blue_shift);
|
||||
|
||||
#undef _W1
|
||||
@ -745,11 +745,11 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
case 32: /* Typically 24-bit TrueColor with an 8-bit
|
||||
(leading) pad. */
|
||||
{
|
||||
uint32 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
PRUint32 *tmp_map; /* Array type corresponds to pixmap depth. */
|
||||
|
||||
private_data->r8torgbn = PR_MALLOC(sizeof(uint32) * 256);
|
||||
private_data->g8torgbn = PR_MALLOC(sizeof(uint32) * 256);
|
||||
private_data->b8torgbn = PR_MALLOC(sizeof(uint32) * 256);
|
||||
private_data->r8torgbn = PR_MALLOC(sizeof(PRUint32) * 256);
|
||||
private_data->g8torgbn = PR_MALLOC(sizeof(PRUint32) * 256);
|
||||
private_data->b8torgbn = PR_MALLOC(sizeof(PRUint32) * 256);
|
||||
|
||||
if (!(private_data->r8torgbn &&
|
||||
private_data->g8torgbn &&
|
||||
@ -758,15 +758,15 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
tmp_map = (uint32*)private_data->r8torgbn;
|
||||
tmp_map = (PRUint32*)private_data->r8torgbn;
|
||||
for (j = 0; j < (1 << red_bits); j++)
|
||||
*tmp_map++ = j << red_shift;
|
||||
|
||||
tmp_map = (uint32*)private_data->g8torgbn;
|
||||
tmp_map = (PRUint32*)private_data->g8torgbn;
|
||||
for (j = 0; j < (1 << green_bits); j++)
|
||||
*tmp_map++ = j << green_shift;
|
||||
|
||||
tmp_map = (uint32*)private_data->b8torgbn;
|
||||
tmp_map = (PRUint32*)private_data->b8torgbn;
|
||||
for (j = 0; j < (1 << blue_bits); j++)
|
||||
*tmp_map++ = j << blue_shift;
|
||||
|
||||
@ -795,7 +795,7 @@ il_init_rgb_depth_tables(IL_ColorSpace *color_space)
|
||||
PRBool
|
||||
il_setup_color_space_converter(il_container *ic)
|
||||
{
|
||||
uint8 conversion_type;
|
||||
PRUint8 conversion_type;
|
||||
IL_GroupContext *img_cx = ic->img_cx;
|
||||
IL_DitherMode dither_mode = img_cx->dither_mode;
|
||||
il_converter converter = NULL;
|
||||
|
@ -195,9 +195,9 @@ il_free_quantize(il_container *ic)
|
||||
#endif
|
||||
|
||||
void
|
||||
il_quantize_fs_dither(il_container *ic, const uint8 *mask,
|
||||
const uint8 *input_buf, int x_offset,
|
||||
uint8 XP_HUGE *output_buf, int width)
|
||||
il_quantize_fs_dither(il_container *ic, const PRUint8 *mask,
|
||||
const PRUint8 *input_buf, int x_offset,
|
||||
PRUint8 XP_HUGE *output_buf, int width)
|
||||
{
|
||||
my_cquantize_ptr cquantize;
|
||||
register LOCFSERROR r_cur, g_cur, b_cur; /* current error or pixel
|
||||
@ -216,9 +216,9 @@ il_quantize_fs_dither(il_container *ic, const uint8 *mask,
|
||||
IL_ColorMap *cmap = &ic->image->header.color_space->cmap;
|
||||
IL_RGB *map = cmap->map; /* The colormap array. */
|
||||
IL_RGB *map_entry; /* Current entry in the colormap. */
|
||||
uint8 *lookup_table = (uint8 *)cmap->table; /* Lookup table for the colormap. */
|
||||
const uint8 *maskp;
|
||||
uint8 map_index;
|
||||
PRUint8 *lookup_table = (PRUint8 *)cmap->table; /* Lookup table for the colormap. */
|
||||
const PRUint8 *maskp;
|
||||
PRUint8 map_index;
|
||||
int dir; /* 1 for left-to-right, -1 for right-to-left */
|
||||
JDIMENSION col;
|
||||
JSAMPLE *range_limit = the_sample_range_limit;
|
||||
|
@ -126,10 +126,10 @@ ImgDCallbk::ImgDCBDestroyTransparentPixel()
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImgDCallbk :: ImgDCBHaveRow(uint8 *rowbuf, uint8* rgbrow,
|
||||
ImgDCallbk :: ImgDCBHaveRow(PRUint8 *rowbuf, PRUint8* rgbrow,
|
||||
int x_offset, int len,
|
||||
int row, int dup_rowcnt,
|
||||
uint8 draw_mode,
|
||||
PRUint8 draw_mode,
|
||||
int pass )
|
||||
{
|
||||
PRBool ret=PR_FALSE;
|
||||
@ -199,7 +199,7 @@ ImgDCallbk :: ImgDCBError()
|
||||
}
|
||||
|
||||
void*
|
||||
ImgDCallbk :: ImgDCBSetTimeout(TimeoutCallbackFunction func, void* closure, uint32 msecs)
|
||||
ImgDCallbk :: ImgDCBSetTimeout(TimeoutCallbackFunction func, void* closure, PRUint32 msecs)
|
||||
{
|
||||
return( IL_SetTimeout(func, closure, msecs ));
|
||||
|
||||
@ -258,7 +258,7 @@ il_dimensions_notify(il_container *ic, int dest_width, int dest_height)
|
||||
for (image_req = ic->clients; image_req; image_req = image_req->next) {
|
||||
message_data.image_instance = image_req;
|
||||
message_data.width = dest_width; /* Note: these are stored as */
|
||||
message_data.height = dest_height; /* uint16s. */
|
||||
message_data.height = dest_height; /* PRUint16s. */
|
||||
XP_NotifyObservers(image_req->obs_list, IL_DIMENSIONS, &message_data);
|
||||
}
|
||||
}
|
||||
@ -291,9 +291,9 @@ il_pixmap_update_notify(il_container *ic)
|
||||
nsCRT::zero(&message_data, sizeof(IL_MessageData));
|
||||
|
||||
update_rect->x_origin = 0;
|
||||
update_rect->y_origin = (uint16)ic->update_start_row;
|
||||
update_rect->width = (uint16)ic->image->header.width;
|
||||
update_rect->height = (uint16)(ic->update_end_row-ic->update_start_row+1);
|
||||
update_rect->y_origin = (PRUint16)ic->update_start_row;
|
||||
update_rect->width = (PRUint16)ic->image->header.width;
|
||||
update_rect->height = (PRUint16)(ic->update_end_row-ic->update_start_row+1);
|
||||
|
||||
PR_ASSERT(ic->clients);
|
||||
for(image_req = ic->clients; image_req; image_req = image_req->next) {
|
||||
@ -344,10 +344,10 @@ il_frame_complete_notify(il_container *ic)
|
||||
int
|
||||
il_compute_percentage_complete(int row, il_container *ic)
|
||||
{
|
||||
uint percent_height;
|
||||
PRUintn percent_height;
|
||||
int percent_done = 0;
|
||||
|
||||
percent_height = (uint)(row * (uint32)100 / ic->image->header.height);
|
||||
percent_height = (PRUintn)(row * (PRUint32)100 / ic->image->header.height);
|
||||
switch(ic->pass) {
|
||||
case 0: percent_done = percent_height; /* non-interlaced GIF */
|
||||
break;
|
||||
@ -371,8 +371,8 @@ il_compute_percentage_complete(int row, il_container *ic)
|
||||
void
|
||||
il_progress_notify(il_container *ic)
|
||||
{
|
||||
uint percent_done;
|
||||
static uint last_percent_done = 0;
|
||||
PRUintn percent_done;
|
||||
static PRUintn last_percent_done = 0;
|
||||
int row = ic->update_end_row;
|
||||
IL_MessageData message_data;
|
||||
IL_ImageReq *image_req;
|
||||
@ -387,7 +387,7 @@ il_progress_notify(il_container *ic)
|
||||
/* Calculate the percentage of image decoded (not displayed) */
|
||||
if(ic->content_length) {
|
||||
percent_done =
|
||||
(uint32)100 * ic->bytes_consumed / ((uint32)ic->content_length);
|
||||
(PRUint32)100 * ic->bytes_consumed / ((PRUint32)ic->content_length);
|
||||
|
||||
/* Some protocols, e.g. gopher, don't support content-length, so
|
||||
* show the percentage of the image displayed instead
|
||||
@ -408,7 +408,7 @@ il_progress_notify(il_container *ic)
|
||||
* of scans in a progressive JPEG isn't known until the
|
||||
* whole file has been read.
|
||||
*/
|
||||
percent_done = (uint)(row * (uint32)100 / img_header->height);
|
||||
percent_done = (PRUintn)(row * (PRUint32)100 / img_header->height);
|
||||
|
||||
}
|
||||
}
|
||||
@ -445,7 +445,7 @@ il_cache_return_notify(IL_ImageReq *image_req)
|
||||
|
||||
/* First notify observers of the image dimensions. */
|
||||
message_data.width = (unsigned short) ic->dest_width; /* Note: these are stored as */
|
||||
message_data.height = (unsigned short) ic->dest_height; /* uint16s. */
|
||||
message_data.height = (unsigned short) ic->dest_height; /* PRUint16s. */
|
||||
XP_NotifyObservers(image_req->obs_list, IL_DIMENSIONS, &message_data);
|
||||
message_data.width = message_data.height = 0;
|
||||
|
||||
@ -611,14 +611,14 @@ il_size(il_container *ic)
|
||||
{
|
||||
float aspect;
|
||||
int status;
|
||||
uint8 img_depth;
|
||||
uint32 src_width, src_height;
|
||||
PRUint8 img_depth;
|
||||
PRUint32 src_width, src_height;
|
||||
int32 image_bytes, old_image_bytes;
|
||||
IL_GroupContext *img_cx = ic->img_cx;
|
||||
NI_PixmapHeader *src_header = ic->src_header; /* Source image header. */
|
||||
NI_PixmapHeader *img_header = &ic->image->header; /* Destination image
|
||||
header. */
|
||||
uint32 req_w=0, req_h=0; /* store requested values for printing.*/
|
||||
PRUint32 req_w=0, req_h=0; /* store requested values for printing.*/
|
||||
|
||||
|
||||
/* Get the dimensions of the source image. */
|
||||
@ -799,7 +799,7 @@ il_size(il_container *ic)
|
||||
/* If we have a mask, initialize its bits. */
|
||||
if (ic->mask) {
|
||||
NI_PixmapHeader *mask_header = &ic->mask->header;
|
||||
uint32 mask_size = mask_header->widthBytes * mask_header->height;
|
||||
PRUint32 mask_size = mask_header->widthBytes * mask_header->height;
|
||||
|
||||
img_cx->img_cb->ControlPixmapBits(img_cx->dpy_cx, ic->mask,
|
||||
IL_LOCK_BITS);
|
||||
@ -1658,11 +1658,11 @@ IL_StreamCreated(il_container *ic,
|
||||
|
||||
|
||||
/* Phong's linear congruential hash */
|
||||
uint32
|
||||
PRUint32
|
||||
il_hash(const char *ubuf)
|
||||
{
|
||||
unsigned char * buf = (unsigned char*) ubuf;
|
||||
uint32 h=1;
|
||||
PRUint32 h=1;
|
||||
while(*buf)
|
||||
{
|
||||
h = 0x63c63cd9*h + 0x9c39c33d + (int32)*buf;
|
||||
@ -1674,7 +1674,7 @@ il_hash(const char *ubuf)
|
||||
#define IL_LAST_ICON 62
|
||||
/* Extra factor of 7 is to account for duplications between
|
||||
mc-icons and ns-icons */
|
||||
static uint32 il_icon_table[(IL_LAST_ICON + 7) * 2];
|
||||
static PRUint32 il_icon_table[(IL_LAST_ICON + 7) * 2];
|
||||
|
||||
static void
|
||||
il_setup_icon_table(void)
|
||||
@ -1841,11 +1841,11 @@ il_setup_icon_table(void)
|
||||
}
|
||||
|
||||
|
||||
static uint32
|
||||
static PRUint32
|
||||
il_internal_image(const char *image_url)
|
||||
{
|
||||
int i;
|
||||
uint32 hash = il_hash(image_url);
|
||||
PRUint32 hash = il_hash(image_url);
|
||||
if (il_icon_table[0]==0)
|
||||
il_setup_icon_table();
|
||||
|
||||
@ -1866,8 +1866,8 @@ IL_GetImage(const char* image_url,
|
||||
IL_GroupContext *img_cx,
|
||||
XP_ObserverList obs_list,
|
||||
NI_IRGB *background_color,
|
||||
uint32 req_width, uint32 req_height,
|
||||
uint32 flags,
|
||||
PRUint32 req_width, PRUint32 req_height,
|
||||
PRUint32 flags,
|
||||
void *opaque_cx)
|
||||
{
|
||||
ilINetContext *net_cx = (ilINetContext *)opaque_cx;
|
||||
@ -1918,7 +1918,7 @@ IL_GetImage(const char* image_url,
|
||||
!PL_strncmp(image_url, "/mc-", 4) ||
|
||||
!PL_strncmp(image_url, "/ns-", 4))
|
||||
{
|
||||
uint32 icon;
|
||||
PRUint32 icon;
|
||||
|
||||
/* A built-in icon ? */
|
||||
icon = il_internal_image(image_url);
|
||||
@ -2081,7 +2081,7 @@ IL_ReloadImages(IL_GroupContext *img_cx, void *net_cx)
|
||||
|
||||
|
||||
IL_IMPLEMENT(void)
|
||||
IL_SetDisplayMode(IL_GroupContext *img_cx, uint32 display_flags,
|
||||
IL_SetDisplayMode(IL_GroupContext *img_cx, PRUint32 display_flags,
|
||||
IL_DisplayData *display_data)
|
||||
{
|
||||
if (display_flags & IL_DISPLAY_CONTEXT)
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
/* if.h --- Top-level image library internal routines
|
||||
*
|
||||
* $Id: if.h,v 3.14 1999/11/06 03:31:27 dmose%mozilla.org Exp $
|
||||
* $Id: if.h,v 3.15 1999/11/13 22:37:41 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
#ifndef _if_h
|
||||
@ -137,8 +137,8 @@ typedef enum _IL_ConversionType {
|
||||
IL_GreyToGrey = 0x24
|
||||
} IL_ConversionType;
|
||||
|
||||
typedef void (*il_converter)(il_container *ic, const uint8 *mask,
|
||||
const uint8 *sp, int x_offset,
|
||||
typedef void (*il_converter)(il_container *ic, const PRUint8 *mask,
|
||||
const PRUint8 *sp, int x_offset,
|
||||
int num, void XP_HUGE *out);
|
||||
|
||||
enum icstate {
|
||||
@ -185,8 +185,8 @@ struct il_container_struct {
|
||||
ilIURL *url;
|
||||
char *url_address; /* Same as url->address if there is no redirection*/
|
||||
|
||||
uint32 hash;
|
||||
uint32 urlhash;
|
||||
PRUint32 hash;
|
||||
PRUint32 urlhash;
|
||||
|
||||
enum icstate state;
|
||||
int sized;
|
||||
@ -206,7 +206,7 @@ struct il_container_struct {
|
||||
int update_start_row; /* Scanline range to send to FE */
|
||||
int update_end_row;
|
||||
|
||||
uint32 bytes_consumed; /* Bytes read from the stream so far */
|
||||
PRUint32 bytes_consumed; /* Bytes read from the stream so far */
|
||||
|
||||
NI_PixmapHeader *src_header; /* Source image header information. */
|
||||
IL_Pixmap *image; /* Destination image pixmap structure. */
|
||||
@ -222,14 +222,14 @@ struct il_container_struct {
|
||||
class ImgDCallbk *imgdcb;
|
||||
|
||||
void *row_output_timeout;
|
||||
uint8 *scalerow;
|
||||
PRUint8 *scalerow;
|
||||
int pass; /* pass (scan #) of a multi-pass image.
|
||||
Used for interlaced GIFs & p-JPEGs */
|
||||
|
||||
int forced;
|
||||
uint32 content_length;
|
||||
PRUint32 content_length;
|
||||
|
||||
uint32 dest_width, dest_height; /* Target dimensions of the image */
|
||||
PRUint32 dest_width, dest_height; /* Target dimensions of the image */
|
||||
PRPackedBool natural_size; /* True if the image is decoded to its natural
|
||||
size. */
|
||||
PRPackedBool aspect_distorted; /* True if the image undergoes aspect ratio
|
||||
@ -358,7 +358,7 @@ struct _IL_ImageReq {
|
||||
#endif
|
||||
|
||||
extern int il_debug;
|
||||
extern uint8 il_identity_index_map[];
|
||||
extern PRUint8 il_identity_index_map[];
|
||||
|
||||
extern void il_delete_container(il_container *ic);
|
||||
extern il_container *il_removefromcache(il_container *ic);
|
||||
@ -400,13 +400,13 @@ extern int il_setup_quantize(void);
|
||||
extern int il_init_quantize(il_container *ic);
|
||||
extern void il_free_quantize(il_container *ic);
|
||||
extern void il_quantize_fs_dither(il_container * ic,
|
||||
const uint8* mask,
|
||||
const uint8 *samp_in,
|
||||
const PRUint8* mask,
|
||||
const PRUint8 *samp_in,
|
||||
int x_offset,
|
||||
uint8 XP_HUGE *samp_out,
|
||||
PRUint8 XP_HUGE *samp_out,
|
||||
int width);
|
||||
|
||||
extern PRBool il_emit_row(il_container *ic, uint8 *buf, uint8 *rgbbuf,
|
||||
extern PRBool il_emit_row(il_container *ic, PRUint8 *buf, PRUint8 *rgbbuf,
|
||||
int start_column, int len, int row, int row_count,
|
||||
il_draw_mode draw_mode, int ipass);
|
||||
|
||||
@ -421,7 +421,7 @@ extern int il_set_color_palette(MWContext *cx, il_container *ic);
|
||||
|
||||
extern PRBool il_reset_palette(il_container *ic);
|
||||
|
||||
extern void il_reverse_bits(uint8 *buf, int n);
|
||||
extern void il_reverse_bits(PRUint8 *buf, int n);
|
||||
extern void il_reconnect(il_container *cx);
|
||||
extern void il_abort_reconnect(void);
|
||||
|
||||
@ -441,7 +441,7 @@ extern il_container
|
||||
extern void
|
||||
il_destroy_pixmap(ilIImageRenderer *img_cb, IL_Pixmap *pixmap);
|
||||
|
||||
extern uint32 il_hash(const char *ubuf);
|
||||
extern PRUint32 il_hash(const char *ubuf);
|
||||
|
||||
extern void il_partial(il_container *ic, int row, int row_count, int pass);
|
||||
extern void il_scour_container(il_container *ic);
|
||||
@ -450,7 +450,7 @@ extern PRBool il_add_client(IL_GroupContext *img_cx, il_container *ic,
|
||||
IL_ImageReq *image_req, int is_view_image);
|
||||
extern PRBool il_delete_client(il_container *ic, IL_ImageReq *image_req);
|
||||
|
||||
extern void il_reduce_image_cache_size_to(uint32 new_size);
|
||||
extern void il_reduce_image_cache_size_to(PRUint32 new_size);
|
||||
|
||||
|
||||
/************************ Image observer notifiers ***************************/
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* -*- Mode: C; tab-width: 4 -*-
|
||||
* il_util.c Colormap and colorspace utilities.
|
||||
*
|
||||
* $Id: il_util.cpp,v 3.6 1999/11/06 03:31:28 dmose%mozilla.org Exp $
|
||||
* $Id: il_util.cpp,v 3.7 1999/11/13 22:37:41 cls%seawood.org Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -46,14 +46,14 @@
|
||||
Note: the lookup table used here is of the form we will use when dithering
|
||||
to an arbitrary palette. */
|
||||
static IL_ColorMap *
|
||||
il_NewColorCube(uint32 red_size, uint32 green_size, uint32 blue_size,
|
||||
uint32 base_offset)
|
||||
il_NewColorCube(PRUint32 red_size, PRUint32 green_size, PRUint32 blue_size,
|
||||
PRUint32 base_offset)
|
||||
{
|
||||
uint8 r, g, b, map_index;
|
||||
uint32 i, j, k, size, red_offset, green_offset, dmax_val;
|
||||
uint32 trm1, tgm1, tbm1, dtrm1, dtgm1, dtbm1;
|
||||
uint32 crm1, cgm1, cbm1, dcrm1, dcgm1, dcbm1;
|
||||
uint8 *lookup_table, *ptr, *done;
|
||||
PRUint8 r, g, b, map_index;
|
||||
PRUint32 i, j, k, size, red_offset, green_offset, dmax_val;
|
||||
PRUint32 trm1, tgm1, tbm1, dtrm1, dtgm1, dtbm1;
|
||||
PRUint32 crm1, cgm1, cbm1, dcrm1, dcgm1, dcbm1;
|
||||
PRUint8 *lookup_table, *ptr, *done;
|
||||
IL_RGB *map;
|
||||
IL_ColorMap *cmap;
|
||||
|
||||
@ -83,11 +83,11 @@ il_NewColorCube(uint32 red_size, uint32 green_size, uint32 blue_size,
|
||||
if (!map)
|
||||
return PR_FALSE;
|
||||
|
||||
lookup_table = (uint8 *)PR_Calloc(LOOKUP_TABLE_SIZE, 1);
|
||||
lookup_table = (PRUint8 *)PR_Calloc(LOOKUP_TABLE_SIZE, 1);
|
||||
if (!lookup_table)
|
||||
return PR_FALSE;
|
||||
|
||||
done = (uint8 *)PR_Calloc(size, 1);
|
||||
done = (PRUint8 *)PR_Calloc(size, 1);
|
||||
if (!done)
|
||||
return PR_FALSE;
|
||||
|
||||
@ -96,12 +96,12 @@ il_NewColorCube(uint32 red_size, uint32 green_size, uint32 blue_size,
|
||||
for (j = 0; j < LOOKUP_TABLE_GREEN; j++)
|
||||
for (k = 0; k < LOOKUP_TABLE_BLUE; k++) {
|
||||
/* Scale indices down to cube coordinates. */
|
||||
r = (uint8) (CUBE_SCALE(i, dcrm1, trm1, dtrm1));
|
||||
g = (uint8) (CUBE_SCALE(j, dcgm1, tgm1, dtgm1));
|
||||
b = (uint8) (CUBE_SCALE(k, dcbm1, tbm1, dtbm1));
|
||||
r = (PRUint8) (CUBE_SCALE(i, dcrm1, trm1, dtrm1));
|
||||
g = (PRUint8) (CUBE_SCALE(j, dcgm1, tgm1, dtgm1));
|
||||
b = (PRUint8) (CUBE_SCALE(k, dcbm1, tbm1, dtbm1));
|
||||
|
||||
/* Compute the colormap index. */
|
||||
map_index =(uint8)( r * red_offset + g * green_offset + b +
|
||||
map_index =(PRUint8)( r * red_offset + g * green_offset + b +
|
||||
base_offset);
|
||||
|
||||
/* Fill out the colormap entry for this index if we haven't
|
||||
@ -109,11 +109,11 @@ il_NewColorCube(uint32 red_size, uint32 green_size, uint32 blue_size,
|
||||
if (!done[map_index]) {
|
||||
/* Scale from cube coordinates up to 8-bit RGB values. */
|
||||
map[map_index].red =
|
||||
(uint8) (CUBE_SCALE(r, dmax_val, crm1, dcrm1));
|
||||
(PRUint8) (CUBE_SCALE(r, dmax_val, crm1, dcrm1));
|
||||
map[map_index].green =
|
||||
(uint8) (CUBE_SCALE(g, dmax_val, cgm1, dcgm1));
|
||||
(PRUint8) (CUBE_SCALE(g, dmax_val, cgm1, dcgm1));
|
||||
map[map_index].blue =
|
||||
(uint8) (CUBE_SCALE(b, dmax_val, cbm1, dcbm1));
|
||||
(PRUint8) (CUBE_SCALE(b, dmax_val, cbm1, dcbm1));
|
||||
|
||||
/* Mark as done. */
|
||||
done[map_index] = 1;
|
||||
@ -206,8 +206,8 @@ select_ncolors(int Ncolors[],
|
||||
be replaced when the Image Library has the capability to dither to an
|
||||
arbitrary palette. */
|
||||
IL_IMPLEMENT(IL_ColorMap *)
|
||||
IL_NewCubeColorMap(IL_RGB *reserved_colors, uint16 num_reserved_colors,
|
||||
uint16 num_colors)
|
||||
IL_NewCubeColorMap(IL_RGB *reserved_colors, PRUint16 num_reserved_colors,
|
||||
PRUint16 num_colors)
|
||||
{
|
||||
int i;
|
||||
IL_RGB *map;
|
||||
@ -239,8 +239,8 @@ IL_NewCubeColorMap(IL_RGB *reserved_colors, uint16 num_reserved_colors,
|
||||
/* Create an optimal fixed palette of the specified size, starting with
|
||||
the given set of reserved colors. */
|
||||
IL_IMPLEMENT(IL_ColorMap *)
|
||||
IL_NewOptimalColorMap(IL_RGB *reserved_colors, uint16 num_reserved_colors,
|
||||
uint16 num_colors)
|
||||
IL_NewOptimalColorMap(IL_RGB *reserved_colors, PRUint16 num_reserved_colors,
|
||||
PRUint16 num_colors)
|
||||
{
|
||||
/* XXXM12N Implement me. */
|
||||
return NULL;
|
||||
@ -325,7 +325,7 @@ IL_DestroyColorMap (IL_ColorMap *cmap)
|
||||
/* Reorder the entries in a colormap. new_order is an array mapping the old
|
||||
indices to the new indices. */
|
||||
IL_IMPLEMENT(void)
|
||||
IL_ReorderColorMap(IL_ColorMap *cmap, uint16 *new_order)
|
||||
IL_ReorderColorMap(IL_ColorMap *cmap, PRUint16 *new_order)
|
||||
{
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ IL_ReorderColorMap(IL_ColorMap *cmap, uint16 *new_order)
|
||||
contents of the IL_RGBBits structure will be copied, so they need not be
|
||||
preserved after the call to IL_CreateTrueColorSpace. */
|
||||
IL_IMPLEMENT(IL_ColorSpace *)
|
||||
IL_CreateTrueColorSpace(IL_RGBBits *rgb, uint8 pixmap_depth)
|
||||
IL_CreateTrueColorSpace(IL_RGBBits *rgb, PRUint8 pixmap_depth)
|
||||
{
|
||||
IL_ColorSpace *color_space;
|
||||
|
||||
@ -377,8 +377,8 @@ IL_CreateTrueColorSpace(IL_RGBBits *rgb, uint8 pixmap_depth)
|
||||
IL_ColorSpace. Memory associated with the colormap will be freed by
|
||||
IL_ReleaseColorSpace when the reference count reaches zero. */
|
||||
IL_IMPLEMENT(IL_ColorSpace *)
|
||||
IL_CreatePseudoColorSpace(IL_ColorMap *cmap, uint8 index_depth,
|
||||
uint8 pixmap_depth)
|
||||
IL_CreatePseudoColorSpace(IL_ColorMap *cmap, PRUint8 index_depth,
|
||||
PRUint8 pixmap_depth)
|
||||
{
|
||||
IL_ColorSpace *color_space;
|
||||
|
||||
@ -411,7 +411,7 @@ IL_CreatePseudoColorSpace(IL_ColorMap *cmap, uint8 index_depth,
|
||||
any additional allowance that might be necessary e.g. for an alpha channel,
|
||||
or for alignment. */
|
||||
PRBool
|
||||
IL_CreateGreyScaleColorSpace(uint8 index_depth, uint8 pixmap_depth, IL_ColorSpace **color_space_ptr)
|
||||
IL_CreateGreyScaleColorSpace(PRUint8 index_depth, PRUint8 pixmap_depth, IL_ColorSpace **color_space_ptr)
|
||||
{
|
||||
IL_ColorSpace *color_space;
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "nsCRT.h"
|
||||
#include "xpcompat.h" //temporary, for timers
|
||||
|
||||
static uint32 image_cache_size;
|
||||
static PRUint32 image_cache_size;
|
||||
|
||||
PRLogModuleInfo *il_log_module = NULL;
|
||||
ilISystemServices *il_ss = NULL;
|
||||
@ -287,13 +287,13 @@ il_image_match(il_container *ic, /* Candidate for match. */
|
||||
requested size. */
|
||||
if (!(
|
||||
/* Both dimensions match (either zero is a match.) */
|
||||
(((uint32)req_width == ic->dest_width) &&
|
||||
((uint32)req_height == ic->dest_height)) ||
|
||||
(((PRUint32)req_width == ic->dest_width) &&
|
||||
((PRUint32)req_height == ic->dest_height)) ||
|
||||
/* Width matches, request height zero, aspect ratio same. */
|
||||
(ic_sized && ((uint32)req_width == ic->dest_width) && !req_height &&
|
||||
(ic_sized && ((PRUint32)req_width == ic->dest_width) && !req_height &&
|
||||
!ic->aspect_distorted) ||
|
||||
/* Height matches, request width zero, aspect ratio same. */
|
||||
(ic_sized && ((uint32)req_height == ic->dest_height) && !req_width &&
|
||||
(ic_sized && ((PRUint32)req_height == ic->dest_height) && !req_width &&
|
||||
!ic->aspect_distorted) ||
|
||||
/* Request dimensions zero, cache entry has natural dimensions. */
|
||||
(!req_width && !req_height && ic->natural_size)
|
||||
@ -376,7 +376,7 @@ il_images_match(il_container *ic1, il_container *ic2)
|
||||
|
||||
static il_container *
|
||||
il_find_in_cache(IL_DisplayType display_type,
|
||||
uint32 hash,
|
||||
PRUint32 hash,
|
||||
const char *image_url,
|
||||
IL_IRGB* background_color,
|
||||
int req_depth,
|
||||
@ -414,7 +414,7 @@ il_get_container(IL_GroupContext *img_cx,
|
||||
int req_width, /* Target width requested by client. */
|
||||
int req_height) /* Target height requested by client. */
|
||||
{
|
||||
uint32 urlhash, hash;
|
||||
PRUint32 urlhash, hash;
|
||||
il_container *ic;
|
||||
|
||||
urlhash = hash = il_hash(image_url);
|
||||
@ -759,7 +759,7 @@ il_addtocache(il_container *ic)
|
||||
|
||||
/* Image storage is added in when image is sized */
|
||||
if (ic->sized)
|
||||
il_cache.bytes += (uint32)img_header->widthBytes * img_header->height;
|
||||
il_cache.bytes += (PRUint32)img_header->widthBytes * img_header->height;
|
||||
il_cache.items++;
|
||||
}
|
||||
|
||||
@ -767,7 +767,7 @@ il_addtocache(il_container *ic)
|
||||
/* Set limit on approximate size, in bytes, of all pixmap storage used
|
||||
by the imagelib. */
|
||||
IL_IMPLEMENT(void)
|
||||
IL_SetCacheSize(uint32 new_size)
|
||||
IL_SetCacheSize(PRUint32 new_size)
|
||||
{
|
||||
image_cache_size = new_size;
|
||||
il_reduce_image_cache_size_to(new_size);
|
||||
@ -775,7 +775,7 @@ IL_SetCacheSize(uint32 new_size)
|
||||
|
||||
|
||||
void
|
||||
il_reduce_image_cache_size_to(uint32 new_size)
|
||||
il_reduce_image_cache_size_to(PRUint32 new_size)
|
||||
{
|
||||
int32 last_size = 0;
|
||||
|
||||
@ -785,7 +785,7 @@ il_reduce_image_cache_size_to(uint32 new_size)
|
||||
}
|
||||
}
|
||||
|
||||
IL_IMPLEMENT(uint32)
|
||||
IL_IMPLEMENT(PRUint32)
|
||||
IL_ShrinkCache(void)
|
||||
{
|
||||
il_container *ic;
|
||||
@ -828,7 +828,7 @@ IL_FlushCache(void)
|
||||
}
|
||||
}
|
||||
|
||||
IL_IMPLEMENT(uint32)
|
||||
IL_IMPLEMENT(PRUint32)
|
||||
IL_GetCacheSize()
|
||||
{
|
||||
return il_cache.bytes;
|
||||
@ -864,7 +864,7 @@ IL_UnCache(IL_Pixmap *pixmap)
|
||||
/* Free num_bytes of memory by flushing the Least Recently Used (LRU) images
|
||||
from the image cache. */
|
||||
IL_IMPLEMENT(void)
|
||||
IL_FreeMemory(IL_GroupContext *image_context, uint32 num_bytes)
|
||||
IL_FreeMemory(IL_GroupContext *image_context, PRUint32 num_bytes)
|
||||
{
|
||||
/* XXXM12N Implement me. */
|
||||
}
|
||||
|
@ -53,8 +53,8 @@
|
||||
|
||||
/* for png */
|
||||
typedef struct _IL_IRGBGA {
|
||||
uint8 index;
|
||||
uint8 red, green, blue, gray, alpha;
|
||||
PRUint8 index;
|
||||
PRUint8 red, green, blue, gray, alpha;
|
||||
} IL_IRGBGA;
|
||||
|
||||
static void
|
||||
@ -74,7 +74,7 @@ il_timeout_callback(void *closure)
|
||||
* will take place when the entire image is decoded.
|
||||
*/
|
||||
if (ic->multi &&
|
||||
((uint32)img_header->height * img_header->width < 100000)) {
|
||||
((PRUint32)img_header->height * img_header->width < 100000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ il_partial(
|
||||
* will take place when the entire image is decoded.
|
||||
*/
|
||||
if (ic->multi &&
|
||||
((uint32)img_header->height * img_header->width < 100000)) {
|
||||
((PRUint32)img_header->height * img_header->width < 100000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -232,12 +232,12 @@ il_flush_image_data(il_container *ic)
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
il_scale_RGB_row(
|
||||
uint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
PRUint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
uint8 *dest, /* Destination, packed RGB pixels */
|
||||
PRUint8 *dest, /* Destination, packed RGB pixels */
|
||||
int dest_len) /* Length of target row, in pixels */
|
||||
{
|
||||
uint8 *dest_end = dest + (3 * dest_len);
|
||||
PRUint8 *dest_end = dest + (3 * dest_len);
|
||||
int n = 0;
|
||||
|
||||
PR_ASSERT(dest);
|
||||
@ -280,15 +280,15 @@ il_scale_RGB_row(
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
il_scale_CI_row(
|
||||
uint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
PRUint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
uint8 *dest, /* Destination, packed RGB pixels */
|
||||
PRUint8 *dest, /* Destination, packed RGB pixels */
|
||||
int dest_len, /* Length of target row, in pixels */
|
||||
uint8* indirect_map,/* image-to-FE color mapping */
|
||||
PRUint8* indirect_map,/* image-to-FE color mapping */
|
||||
int transparent_pixel_color)
|
||||
{
|
||||
int src_pixel, mapped_src_pixel;
|
||||
uint8 *dest_end = dest + dest_len;
|
||||
PRUint8 *dest_end = dest + dest_len;
|
||||
int n = 0;
|
||||
|
||||
PR_ASSERT(dest);
|
||||
@ -331,20 +331,20 @@ il_scale_CI_row(
|
||||
|
||||
/* Convert row coordinate from image space to display space. */
|
||||
#define SCALE_YCOORD(ih, sh, y) \
|
||||
((int)((uint32)(y) * (ih)->height / (sh)->height))
|
||||
((int)((PRUint32)(y) * (ih)->height / (sh)->height))
|
||||
|
||||
#define SCALE_XCOORD(ih, sh, x) \
|
||||
((int)((uint32)(x) * (ih)->width / (sh)->width))
|
||||
((int)((PRUint32)(x) * (ih)->width / (sh)->width))
|
||||
|
||||
/* Add a bit to the row of mask bits. Flush accumulator to memory if full. */
|
||||
#define SHIFT_IMAGE_MASK(not_transparent_flag) \
|
||||
{ \
|
||||
fgmask32 |= ((uint32)not_transparent_flag ) << M32(mask_bit); \
|
||||
bgmask32 |= ((uint32)not_transparent_flag ^ 1) << M32(mask_bit); \
|
||||
fgmask32 |= ((PRUint32)not_transparent_flag ) << M32(mask_bit); \
|
||||
bgmask32 |= ((PRUint32)not_transparent_flag ^ 1) << M32(mask_bit); \
|
||||
\
|
||||
/* Filled up 32-bit mask word. Write it to memory. */ \
|
||||
if (mask_bit-- == 0) { \
|
||||
uint32 mtmp = *m; \
|
||||
PRUint32 mtmp = *m; \
|
||||
mtmp |= fgmask32; \
|
||||
if (draw_mode == ilErase) \
|
||||
mtmp &= ~bgmask32; \
|
||||
@ -362,22 +362,22 @@ il_scale_CI_row(
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
il_alpha_mask(
|
||||
uint8 *src, /* RGBa, input data */
|
||||
PRUint8 *src, /* RGBa, input data */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
int x_offset, /* Destination offset from left edge */
|
||||
uint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
PRUint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
int mask_len, /* Number of pixels in output row */
|
||||
il_draw_mode draw_mode) /* ilOverlay or ilErase */
|
||||
{
|
||||
int not_transparent,n =0;
|
||||
int output_bits_remaining = mask_len;
|
||||
|
||||
uint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
uint32 fgmask32 = 0;
|
||||
PRUint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
PRUint32 fgmask32 = 0;
|
||||
|
||||
int mask_bit; /* next bit to write in setmask32 */
|
||||
|
||||
uint32 *m = ((uint32*)maskp) + (x_offset >> 5);
|
||||
PRUint32 *m = ((PRUint32*)maskp) + (x_offset >> 5);
|
||||
mask_bit = ~x_offset & 0x1f;
|
||||
|
||||
PR_ASSERT(mask_len);
|
||||
@ -424,7 +424,7 @@ il_alpha_mask(
|
||||
|
||||
/* End of scan line. Write out any remaining mask bits. */
|
||||
if (mask_bit < 31) {
|
||||
uint32 mtmp = *m;
|
||||
PRUint32 mtmp = *m;
|
||||
mtmp |= fgmask32;
|
||||
if (draw_mode == ilErase)
|
||||
mtmp &= ~bgmask32;
|
||||
@ -440,10 +440,10 @@ il_alpha_mask(
|
||||
static void
|
||||
il_generate_scaled_transparency_mask(
|
||||
IL_IRGB *transparent_pixel, /* The transparent pixel */
|
||||
uint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
PRUint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
int x_offset, /* Destination offset from left edge */
|
||||
uint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
PRUint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
int mask_len, /* Number of pixels in output row */
|
||||
il_draw_mode draw_mode) /* ilOverlay or ilErase */
|
||||
{
|
||||
@ -452,12 +452,12 @@ il_generate_scaled_transparency_mask(
|
||||
transparent_pixel ? transparent_pixel->index : -1;
|
||||
int output_bits_remaining = mask_len;
|
||||
|
||||
uint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
uint32 fgmask32 = 0;
|
||||
PRUint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
PRUint32 fgmask32 = 0;
|
||||
|
||||
int mask_bit; /* next bit to write in setmask32 */
|
||||
|
||||
uint32 *m = ((uint32*)maskp) + (x_offset >> 5);
|
||||
PRUint32 *m = ((PRUint32*)maskp) + (x_offset >> 5);
|
||||
mask_bit = ~x_offset & 0x1f;
|
||||
|
||||
PR_ASSERT(maskp);
|
||||
@ -503,7 +503,7 @@ il_generate_scaled_transparency_mask(
|
||||
|
||||
/* End of scan line. Write out any remaining mask bits. */
|
||||
if (mask_bit < 31) {
|
||||
uint32 mtmp = *m;
|
||||
PRUint32 mtmp = *m;
|
||||
mtmp |= fgmask32;
|
||||
if (draw_mode == ilErase)
|
||||
mtmp &= ~bgmask32;
|
||||
@ -520,10 +520,10 @@ il_generate_scaled_transparency_mask(
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
il_scale_mask(
|
||||
uint8 *src, /* input mask data */
|
||||
PRUint8 *src, /* input mask data */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
int x_offset, /* Destination offset from left edge */
|
||||
uint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
PRUint8 XP_HUGE *maskp, /* Output pointer, left-justified bitmask */
|
||||
int mask_len, /* Number of pixels in output row */
|
||||
il_draw_mode draw_mode) /* ilOverlay or ilErase */
|
||||
{
|
||||
@ -531,13 +531,13 @@ il_generate_scaled_transparency_mask(
|
||||
int not_transparent,n = 0;
|
||||
int output_bits_remaining = mask_len;
|
||||
|
||||
uint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
uint32 fgmask32 = 0;
|
||||
PRUint32 bgmask32 = 0; /* 32-bit temporary mask accumulators */
|
||||
PRUint32 fgmask32 = 0;
|
||||
|
||||
uint8 src_bit; /* next bit to read in setmask32 */
|
||||
PRUint8 src_bit; /* next bit to read in setmask32 */
|
||||
int mask_bit; /* next bit to write in setmask32 */
|
||||
|
||||
uint32 *m = ((uint32*)maskp) + (x_offset >> 5);
|
||||
PRUint32 *m = ((PRUint32*)maskp) + (x_offset >> 5);
|
||||
mask_bit = ~x_offset & 0x1f;
|
||||
|
||||
src_bit = 0x07;
|
||||
@ -556,7 +556,7 @@ il_generate_scaled_transparency_mask(
|
||||
if (src_len >= mask_len) /* Scaling down */
|
||||
{
|
||||
while (output_bits_remaining ) {
|
||||
not_transparent = ((*src & ((uint8)1 << src_bit)) != 0);
|
||||
not_transparent = ((*src & ((PRUint8)1 << src_bit)) != 0);
|
||||
|
||||
SHIFT_IMAGE_MASK(not_transparent);
|
||||
n += src_len;
|
||||
@ -573,7 +573,7 @@ il_generate_scaled_transparency_mask(
|
||||
{
|
||||
while (output_bits_remaining){
|
||||
n += mask_len;
|
||||
not_transparent = ((*src & ((uint8)1 << src_bit)) != 0);
|
||||
not_transparent = ((*src & ((PRUint8)1 << src_bit)) != 0);
|
||||
|
||||
while (n >= src_len){
|
||||
SHIFT_IMAGE_MASK(not_transparent);
|
||||
@ -588,7 +588,7 @@ il_generate_scaled_transparency_mask(
|
||||
}
|
||||
/* End of scan line. Write out any remaining mask bits. */
|
||||
if (mask_bit < 31){
|
||||
uint32 mtmp = *m;
|
||||
PRUint32 mtmp = *m;
|
||||
mtmp |= fgmask32;
|
||||
if (draw_mode == ilErase)
|
||||
mtmp &= ~bgmask32;
|
||||
@ -610,13 +610,13 @@ il_generate_scaled_transparency_mask(
|
||||
static void
|
||||
il_reset_background_pixels(
|
||||
il_container *ic, /* The image container */
|
||||
uint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
PRUint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
int src_len, /* Number of pixels in row */
|
||||
uint8 XP_HUGE *dest, /* Output pointer, 8-bit pseudocolor data */
|
||||
PRUint8 XP_HUGE *dest, /* Output pointer, 8-bit pseudocolor data */
|
||||
int dest_len) /* Width of output pixel row */
|
||||
{
|
||||
int is_transparent, n = 0;
|
||||
uint8 XP_HUGE *dest_end = dest + dest_len;
|
||||
PRUint8 XP_HUGE *dest_end = dest + dest_len;
|
||||
NI_PixmapHeader *img_header = &ic->image->header;
|
||||
int src_trans_pixel_index = ic->src_header->transparent_pixel->index;
|
||||
int img_trans_pixel_index = img_header->transparent_pixel->index;
|
||||
@ -665,13 +665,13 @@ il_reset_background_pixels(
|
||||
static void
|
||||
il_generate_byte_mask(
|
||||
il_container *ic, /* The image container */
|
||||
uint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
PRUint8 *src, /* Row of pixels, 8-bit pseudocolor data */
|
||||
int src_len, /* Number of pixels in row */
|
||||
uint8 *dest, /* Output pointer, 8-bit pseudocolor data */
|
||||
PRUint8 *dest, /* Output pointer, 8-bit pseudocolor data */
|
||||
int dest_len) /* Width of output pixel row */
|
||||
{
|
||||
int is_transparent, n = 0;
|
||||
uint8 XP_HUGE *dest_end = dest + dest_len;
|
||||
PRUint8 XP_HUGE *dest_end = dest + dest_len;
|
||||
int src_trans_pixel_index = ic->src_header->transparent_pixel->index;
|
||||
|
||||
/* Two cases */
|
||||
@ -702,7 +702,7 @@ il_generate_byte_mask(
|
||||
}
|
||||
else
|
||||
while (n >= src_len) {
|
||||
*dest++ = (uint8)-1;
|
||||
*dest++ = (PRUint8)-1;
|
||||
n -= src_len;
|
||||
}
|
||||
}
|
||||
@ -710,13 +710,13 @@ il_generate_byte_mask(
|
||||
}
|
||||
|
||||
static void
|
||||
il_overlay(uint8 *src, uint8 *dest, uint8 *byte_mask, int num_cols,
|
||||
il_overlay(PRUint8 *src, PRUint8 *dest, PRUint8 *byte_mask, int num_cols,
|
||||
int bytes_per_pixel)
|
||||
{
|
||||
int i, col;
|
||||
#if 0
|
||||
uint8 *s = src;
|
||||
uint8 *s_end = src + (num_cols * bytes_per_pixel);
|
||||
PRUint8 *s = src;
|
||||
PRUint8 *s_end = src + (num_cols * bytes_per_pixel);
|
||||
#endif
|
||||
for (col = num_cols; col > 0; col--) {
|
||||
if (*byte_mask++) {
|
||||
@ -736,12 +736,12 @@ il_overlay(uint8 *src, uint8 *dest, uint8 *byte_mask, int num_cols,
|
||||
|
||||
static void
|
||||
il_scale_alpha8(
|
||||
uint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
PRUint8 XP_HUGE *src, /* Source row of packed RGB pixels */
|
||||
int src_len, /* Number of pixels in source row */
|
||||
uint8 *dest, /* Destination, packed RGB pixels */
|
||||
PRUint8 *dest, /* Destination, packed RGB pixels */
|
||||
int dest_len) /* Length of target row, in pixels */
|
||||
{
|
||||
uint8 *dest_end = dest + dest_len;
|
||||
PRUint8 *dest_end = dest + dest_len;
|
||||
int n = 0;
|
||||
|
||||
PR_ASSERT(dest);
|
||||
@ -777,7 +777,7 @@ il_scale_alpha8(
|
||||
}
|
||||
}
|
||||
|
||||
static uint8 il_tmpbuf[MAX_IMAGE_WIDTH];
|
||||
static PRUint8 il_tmpbuf[MAX_IMAGE_WIDTH];
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Emit a complete row of pixel data into the image. This routine
|
||||
@ -791,9 +791,9 @@ static uint8 il_tmpbuf[MAX_IMAGE_WIDTH];
|
||||
PRBool
|
||||
il_emit_row(
|
||||
il_container *ic, /* The image container */
|
||||
uint8 *cbuf, /* Color index data source, or NULL if source
|
||||
PRUint8 *cbuf, /* Color index data source, or NULL if source
|
||||
is RGB data */
|
||||
uint8 *rgbbuf, /* Packed RGBa data or RGBa workspace if <cbuf> != NULL */
|
||||
PRUint8 *rgbbuf, /* Packed RGBa data or RGBa workspace if <cbuf> != NULL */
|
||||
int x_offset, /* First column to write data into */
|
||||
int len, /* Width of source image, in pixels */
|
||||
int row, /* Starting row of image */
|
||||
@ -811,15 +811,15 @@ il_emit_row(
|
||||
NI_PixmapHeader *mask_header = NULL;
|
||||
NI_ColorSpace *src_color_space = src_header->color_space;
|
||||
NI_ColorSpace *img_color_space = img_header->color_space;
|
||||
uint8 XP_HUGE *out;
|
||||
uint8 XP_HUGE *dp;
|
||||
uint8 XP_HUGE *mp;
|
||||
uint8 XP_HUGE *maskp = NULL;
|
||||
uint8 XP_HUGE *alphabits, *alphabitstart = NULL;
|
||||
uint8 *byte_mask = NULL;
|
||||
uint8 XP_HUGE *srcbuf = rgbbuf;
|
||||
uint8 *p = cbuf;
|
||||
uint8 *pl = cbuf+len;
|
||||
PRUint8 XP_HUGE *out;
|
||||
PRUint8 XP_HUGE *dp;
|
||||
PRUint8 XP_HUGE *mp;
|
||||
PRUint8 XP_HUGE *maskp = NULL;
|
||||
PRUint8 XP_HUGE *alphabits, *alphabitstart = NULL;
|
||||
PRUint8 *byte_mask = NULL;
|
||||
PRUint8 XP_HUGE *srcbuf = rgbbuf;
|
||||
PRUint8 *p = cbuf;
|
||||
PRUint8 *pl = cbuf+len;
|
||||
int drow_start, drow_end, row_count, color_index, dup, do_dither;
|
||||
int dcolumn_start, dcolumn_end, column_count, offset, src_len, dest_len;
|
||||
|
||||
@ -914,10 +914,10 @@ il_emit_row(
|
||||
// IL_LOCK_BITS);
|
||||
|
||||
#ifdef _USD
|
||||
alphabitstart = maskp = (uint8 XP_HUGE *)mask->bits +
|
||||
alphabitstart = maskp = (PRUint8 XP_HUGE *)mask->bits +
|
||||
(mask_header->height - drow_start - 1) * mask_header->widthBytes;
|
||||
#else
|
||||
alphabitstart = maskp = (uint8 XP_HUGE *)mask->bits +
|
||||
alphabitstart = maskp = (PRUint8 XP_HUGE *)mask->bits +
|
||||
drow_start * mask_header->widthBytes;
|
||||
#endif
|
||||
if(img_header->alpha_bits == 1)
|
||||
@ -926,7 +926,7 @@ il_emit_row(
|
||||
il_alpha_mask(rgbbuf, (int)len, dcolumn_start,
|
||||
alphabitstart, column_count, draw_mode);
|
||||
|
||||
uint8 *tmpbuf, *rgbbuf_p;
|
||||
PRUint8 *tmpbuf, *rgbbuf_p;
|
||||
int i;
|
||||
|
||||
rgbbuf_p = tmpbuf = rgbbuf;
|
||||
@ -939,7 +939,7 @@ il_emit_row(
|
||||
}
|
||||
else{ /* alpha_bits=8*/
|
||||
|
||||
uint8 *tmpbuf, *rgbbuf_p;
|
||||
PRUint8 *tmpbuf, *rgbbuf_p;
|
||||
int i;
|
||||
unsigned char *scalemask;
|
||||
|
||||
@ -980,10 +980,10 @@ il_emit_row(
|
||||
// img_cx->img_cb->ControlPixmapBits(img_cx->dpy_cx, mask,
|
||||
// IL_LOCK_BITS);
|
||||
#ifdef _USD
|
||||
maskp = (uint8 XP_HUGE *)mask->bits +
|
||||
maskp = (PRUint8 XP_HUGE *)mask->bits +
|
||||
(mask_header->height - drow_start - 1) * mask_header->widthBytes;
|
||||
#else
|
||||
maskp = (uint8 XP_HUGE *)mask->bits +
|
||||
maskp = (PRUint8 XP_HUGE *)mask->bits +
|
||||
drow_start * mask_header->widthBytes;
|
||||
#endif
|
||||
|
||||
@ -1020,8 +1020,8 @@ il_emit_row(
|
||||
#ifdef M12N
|
||||
int i;
|
||||
int src_trans_pixel_index;
|
||||
uint8 XP_HUGE * dest;
|
||||
uint8 *indirect_map = src_color_space->cmap.index;
|
||||
PRUint8 XP_HUGE * dest;
|
||||
PRUint8 *indirect_map = src_color_space->cmap.index;
|
||||
|
||||
PR_ASSERT(image->haveBits);
|
||||
|
||||
@ -1039,10 +1039,10 @@ il_emit_row(
|
||||
|
||||
/* No converter, image is already rendered in pseudocolor. */
|
||||
#ifdef _USD
|
||||
out = (uint8 XP_HUGE *)image->bits +
|
||||
out = (PRUint8 XP_HUGE *)image->bits +
|
||||
(img_header->height - drow_start - 1) * img_header->widthBytes;
|
||||
#else
|
||||
out = (uint8 XP_HUGE *)image->bits +
|
||||
out = (PRUint8 XP_HUGE *)image->bits +
|
||||
drow_start * img_header->widthBytes;
|
||||
#endif
|
||||
|
||||
@ -1067,7 +1067,7 @@ il_emit_row(
|
||||
|
||||
/* Generate the output row in RGB space, regardless of screen depth. */
|
||||
if (cbuf) {
|
||||
uint8 *r = rgbbuf;
|
||||
PRUint8 *r = rgbbuf;
|
||||
IL_RGB *map = src_color_space->cmap.map, *entry;
|
||||
|
||||
if (!src_header->transparent_pixel) {
|
||||
@ -1132,8 +1132,8 @@ il_emit_row(
|
||||
src_len = len;
|
||||
dest_len = column_count;
|
||||
if (src_len != dest_len) {
|
||||
uint8 XP_HUGE *src = rgbbuf;
|
||||
uint8 *dest = ic->scalerow;
|
||||
PRUint8 XP_HUGE *src = rgbbuf;
|
||||
PRUint8 *dest = ic->scalerow;
|
||||
srcbuf = dest;
|
||||
|
||||
/* Scale the pixel data (mask data already scaled) */
|
||||
@ -1145,10 +1145,10 @@ il_emit_row(
|
||||
IL_LOCK_BITS);
|
||||
|
||||
#ifdef _USD
|
||||
out = (uint8 XP_HUGE *)image->bits +
|
||||
(img_header->height-drow_start-1) * (uint32)img_header->widthBytes;
|
||||
out = (PRUint8 XP_HUGE *)image->bits +
|
||||
(img_header->height-drow_start-1) * (PRUint32)img_header->widthBytes;
|
||||
#else
|
||||
out = (uint8 XP_HUGE *)image->bits +
|
||||
out = (PRUint8 XP_HUGE *)image->bits +
|
||||
drow_start * img_header->widthBytes;
|
||||
#endif
|
||||
|
||||
|
@ -131,7 +131,7 @@ time_t Mactime(time_t *timer)
|
||||
|
||||
|
||||
NS_EXPORT void*
|
||||
IL_SetTimeout(TimeoutCallbackFunction func, void * closure, uint32 msecs)
|
||||
IL_SetTimeout(TimeoutCallbackFunction func, void * closure, PRUint32 msecs)
|
||||
{
|
||||
return il_ss->SetTimeout((ilTimeoutCallbackFunction)func,
|
||||
closure, msecs);
|
||||
|
@ -69,7 +69,7 @@ extern void XP_QSORT(void *, size_t, size_t,
|
||||
#endif /* XP_MAC */
|
||||
|
||||
|
||||
NS_EXPORT void* IL_SetTimeout(TimeoutCallbackFunction func, void * closure, uint32 msecs);
|
||||
NS_EXPORT void* IL_SetTimeout(TimeoutCallbackFunction func, void * closure, PRUint32 msecs);
|
||||
|
||||
NS_EXPORT void IL_ClearTimeout(void *timer_id);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user