Use stdint types instead of DATA32 etc.
This should make things slightly more consistent and unambiguous, and the stdint types are already used here and there (in loaders). I'm not aware of any systems where this change makes any difference. If there are targets out there with 64 bit ints imlib2 might now work there and on targets with 16 bit ints it most likely still doesn't.
This commit is contained in:
parent
0fdae6aa73
commit
18d0befc57
|
@ -161,7 +161,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
else if (!strcmp(argv[i], "-colormod"))
|
||||
{
|
||||
DATA8 rt[256], gt[256], bt[256], at[256];
|
||||
uint8_t rt[256], gt[256], bt[256], at[256];
|
||||
double rm, gm, bm, am;
|
||||
|
||||
/*\ Setup color mod tables \ */
|
||||
|
|
|
@ -39,18 +39,11 @@
|
|||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
/* Data types to use */
|
||||
#ifndef DATA64
|
||||
#define DATA64 unsigned long long
|
||||
#define DATA32 unsigned int
|
||||
#define DATA16 unsigned short
|
||||
#define DATA8 unsigned char
|
||||
#endif
|
||||
|
||||
/* opaque data types */
|
||||
typedef void *Imlib_Context;
|
||||
typedef void *Imlib_Image;
|
||||
|
@ -864,7 +857,7 @@ EAPI const char *imlib_image_get_filename(void);
|
|||
* caching - in fact all images cached from this one will also be affected
|
||||
* when you put the data back. If this matters it is suggested you clone
|
||||
* the image first before playing with the image data.
|
||||
* The image data is returned in the format of a DATA32 (32 bits) per
|
||||
* The image data is returned in the format of a uint32_t (32 bits) per
|
||||
* pixel in a linear array ordered from the top left of the image to the
|
||||
* bottom right going from left to right each line.
|
||||
* Each pixel has the upper 8 bits as the alpha channel and the lower 8 bits
|
||||
|
@ -874,7 +867,7 @@ EAPI const char *imlib_image_get_filename(void);
|
|||
*
|
||||
* @return A pointer to the image data
|
||||
*/
|
||||
EAPI DATA32 *imlib_image_get_data(void);
|
||||
EAPI uint32_t *imlib_image_get_data(void);
|
||||
|
||||
/**
|
||||
* Get a pointer to the image data for the current image (read-only)
|
||||
|
@ -887,7 +880,7 @@ EAPI DATA32 *imlib_image_get_data(void);
|
|||
*
|
||||
* @return A pointer to the image data
|
||||
*/
|
||||
EAPI DATA32 *imlib_image_get_data_for_reading_only(void);
|
||||
EAPI uint32_t *imlib_image_get_data_for_reading_only(void);
|
||||
|
||||
/**
|
||||
* Put back @p data obtained by imlib_image_get_data().
|
||||
|
@ -896,7 +889,7 @@ EAPI DATA32 *imlib_image_get_data_for_reading_only(void);
|
|||
*
|
||||
* @param data The pointer to the image data
|
||||
*/
|
||||
EAPI void imlib_image_put_back_data(DATA32 * data);
|
||||
EAPI void imlib_image_put_back_data(uint32_t * data);
|
||||
|
||||
/**
|
||||
* Return whether or not the current image has an alpa channel
|
||||
|
@ -1139,7 +1132,7 @@ EAPI void imlib_render_image_part_on_drawable_at_size(int source_x,
|
|||
/**
|
||||
* Return X11 pixel value of current color
|
||||
*/
|
||||
EAPI DATA32 imlib_render_get_pixel_color(void);
|
||||
EAPI uint32_t imlib_render_get_pixel_color(void);
|
||||
|
||||
#endif /* X_DISPLAY_MISSING */
|
||||
|
||||
|
@ -1260,7 +1253,7 @@ EAPI Imlib_Image imlib_create_cropped_scaled_image(int source_x,
|
|||
* @return Image handle (NULL on failure)
|
||||
*/
|
||||
EAPI Imlib_Image imlib_create_image_using_data(int width, int height,
|
||||
DATA32 * data);
|
||||
uint32_t * data);
|
||||
|
||||
/**
|
||||
* Create a new image using given pixel data and memory management function
|
||||
|
@ -1280,7 +1273,7 @@ EAPI Imlib_Image imlib_create_image_using_data(int width, int height,
|
|||
* @return Image handle (NULL on failure)
|
||||
*/
|
||||
EAPI Imlib_Image imlib_create_image_using_data_and_memory_function
|
||||
(int width, int height, DATA32 * data,
|
||||
(int width, int height, uint32_t * data,
|
||||
Imlib_Image_Data_Memory_Function func);
|
||||
|
||||
/**
|
||||
|
@ -1298,7 +1291,7 @@ EAPI Imlib_Image imlib_create_image_using_data_and_memory_function
|
|||
* @return Image handle (NULL on failure)
|
||||
*/
|
||||
EAPI Imlib_Image imlib_create_image_using_copied_data(int width, int height,
|
||||
DATA32 * data);
|
||||
uint32_t * data);
|
||||
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
/**
|
||||
|
@ -2121,36 +2114,36 @@ EAPI void imlib_modify_color_modifier_contrast(double
|
|||
*
|
||||
* Explicitly copies the mapping tables from the table pointers passed
|
||||
* into this function into those of the current color modifier. Tables
|
||||
* are 256 entry arrays of DATA8 which are a mapping of that channel
|
||||
* are 256 entry arrays of uint8_t which are a mapping of that channel
|
||||
* value to a new channel value. A normal mapping would be linear (v[0]
|
||||
* = 0, v[10] = 10, v[50] = 50, v[200] = 200, v[255] = 255).
|
||||
*
|
||||
* @param red_table A 256 element DATA8 array
|
||||
* @param green_table A 256 element DATA8 array
|
||||
* @param blue_table A 256 element DATA8 array
|
||||
* @param alpha_table A 256 element DATA8 array
|
||||
* @param red_table A 256 element uint8_t array
|
||||
* @param green_table A 256 element uint8_t array
|
||||
* @param blue_table A 256 element uint8_t array
|
||||
* @param alpha_table A 256 element uint8_t array
|
||||
*/
|
||||
EAPI void imlib_set_color_modifier_tables(DATA8 * red_table,
|
||||
DATA8 * green_table,
|
||||
DATA8 * blue_table,
|
||||
DATA8 * alpha_table);
|
||||
EAPI void imlib_set_color_modifier_tables(uint8_t * red_table,
|
||||
uint8_t * green_table,
|
||||
uint8_t * blue_table,
|
||||
uint8_t * alpha_table);
|
||||
|
||||
/**
|
||||
* Get current color modifier tables
|
||||
*
|
||||
* Copies the table values from the current color modifier into the
|
||||
* pointers to mapping tables specified. They must have 256 entries and
|
||||
* be DATA8 format.
|
||||
* be uint8_t format.
|
||||
*
|
||||
* @param red_table A 256 element DATA8 array
|
||||
* @param green_table A 256 element DATA8 array
|
||||
* @param blue_table A 256 element DATA8 array
|
||||
* @param alpha_table A 256 element DATA8 array
|
||||
* @param red_table A 256 element uint8_t array
|
||||
* @param green_table A 256 element uint8_t array
|
||||
* @param blue_table A 256 element uint8_t array
|
||||
* @param alpha_table A 256 element uint8_t array
|
||||
*/
|
||||
EAPI void imlib_get_color_modifier_tables(DATA8 * red_table,
|
||||
DATA8 * green_table,
|
||||
DATA8 * blue_table,
|
||||
DATA8 * alpha_table);
|
||||
EAPI void imlib_get_color_modifier_tables(uint8_t * red_table,
|
||||
uint8_t * green_table,
|
||||
uint8_t * blue_table,
|
||||
uint8_t * alpha_table);
|
||||
|
||||
/**
|
||||
* Reset current color modifier tables
|
||||
|
@ -2828,6 +2821,15 @@ EAPI const char *imlib_strerror(int err);
|
|||
/*--------------------------------
|
||||
* Deprecated functionality
|
||||
*/
|
||||
|
||||
/* Old data types, no longer used by imlib2, likely to be removed */
|
||||
#ifndef DATA64
|
||||
#define DATA64 uint64_t IMLIB2_DEPRECATED
|
||||
#define DATA32 uint32_t IMLIB2_DEPRECATED
|
||||
#define DATA16 uint16_t IMLIB2_DEPRECATED
|
||||
#define DATA8 uint8_t IMLIB2_DEPRECATED
|
||||
#endif
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -86,7 +86,7 @@ typedef struct {
|
|||
Imlib_Text_Direction direction;
|
||||
double angle;
|
||||
Imlib_Color color;
|
||||
DATA32 pixel;
|
||||
uint32_t pixel;
|
||||
Imlib_Color_Range color_range;
|
||||
Imlib_Image image;
|
||||
Imlib_Image_Data_Memory_Function image_data_memory_func;
|
||||
|
@ -543,7 +543,7 @@ imlib_context_get_direction(void)
|
|||
EAPI void
|
||||
imlib_context_set_color(int red, int green, int blue, int alpha)
|
||||
{
|
||||
DATA8 r, g, b, a;
|
||||
uint8_t r, g, b, a;
|
||||
|
||||
r = red;
|
||||
g = green;
|
||||
|
@ -616,7 +616,7 @@ imlib_context_get_color_hlsa(float *hue, float *lightness, float *saturation,
|
|||
EAPI void
|
||||
imlib_context_set_color_cmya(int cyan, int magenta, int yellow, int alpha)
|
||||
{
|
||||
DATA8 r, g, b, a;
|
||||
uint8_t r, g, b, a;
|
||||
|
||||
r = 255 - cyan;
|
||||
g = 255 - magenta;
|
||||
|
@ -962,7 +962,7 @@ imlib_image_get_filename(void)
|
|||
return im->file;
|
||||
}
|
||||
|
||||
EAPI DATA32 *
|
||||
EAPI uint32_t *
|
||||
imlib_image_get_data(void)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
@ -975,7 +975,7 @@ imlib_image_get_data(void)
|
|||
return im->data;
|
||||
}
|
||||
|
||||
EAPI DATA32 *
|
||||
EAPI uint32_t *
|
||||
imlib_image_get_data_for_reading_only(void)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
@ -988,7 +988,7 @@ imlib_image_get_data_for_reading_only(void)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
imlib_image_put_back_data(DATA32 * data)
|
||||
imlib_image_put_back_data(uint32_t * data)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
|
@ -1201,14 +1201,14 @@ imlib_render_image_part_on_drawable_at_size(int source_x, int source_y,
|
|||
0, ctx->color_modifier, ctx->operation);
|
||||
}
|
||||
|
||||
EAPI DATA32
|
||||
EAPI uint32_t
|
||||
imlib_render_get_pixel_color(void)
|
||||
{
|
||||
return __imlib_RenderGetPixel(ctx->display, ctx->drawable, ctx->visual,
|
||||
ctx->colormap, ctx->depth,
|
||||
(DATA8) ctx->color.red,
|
||||
(DATA8) ctx->color.green,
|
||||
(DATA8) ctx->color.blue);
|
||||
(uint8_t) ctx->color.red,
|
||||
(uint8_t) ctx->color.green,
|
||||
(uint8_t) ctx->color.blue);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1249,18 +1249,18 @@ imlib_blend_image_onto_image(Imlib_Image source_image, char merge_alpha,
|
|||
EAPI Imlib_Image
|
||||
imlib_create_image(int width, int height)
|
||||
{
|
||||
DATA32 *data;
|
||||
uint32_t *data;
|
||||
|
||||
if (!IMAGE_DIMENSIONS_OK(width, height))
|
||||
return NULL;
|
||||
data = malloc(width * height * sizeof(DATA32));
|
||||
data = malloc(width * height * sizeof(uint32_t));
|
||||
if (data)
|
||||
return __imlib_CreateImage(width, height, data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Imlib_Image
|
||||
imlib_create_image_using_data(int width, int height, DATA32 * data)
|
||||
imlib_create_image_using_data(int width, int height, uint32_t * data)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
|
@ -1275,8 +1275,8 @@ imlib_create_image_using_data(int width, int height, DATA32 * data)
|
|||
|
||||
EAPI Imlib_Image
|
||||
imlib_create_image_using_data_and_memory_function
|
||||
(int width, int height, DATA32 * data, Imlib_Image_Data_Memory_Function func)
|
||||
{
|
||||
(int width, int height, uint32_t * data,
|
||||
Imlib_Image_Data_Memory_Function func) {
|
||||
ImlibImage *im;
|
||||
|
||||
CHECK_PARAM_POINTER_RETURN("data", data, NULL);
|
||||
|
@ -1290,7 +1290,7 @@ EAPI Imlib_Image
|
|||
}
|
||||
|
||||
EAPI Imlib_Image
|
||||
imlib_create_image_using_copied_data(int width, int height, DATA32 * data)
|
||||
imlib_create_image_using_copied_data(int width, int height, uint32_t * data)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
|
@ -1300,10 +1300,10 @@ imlib_create_image_using_copied_data(int width, int height, DATA32 * data)
|
|||
im = __imlib_CreateImage(width, height, NULL);
|
||||
if (!im)
|
||||
return NULL;
|
||||
im->data = malloc(width * height * sizeof(DATA32));
|
||||
im->data = malloc(width * height * sizeof(uint32_t));
|
||||
if (data)
|
||||
{
|
||||
memcpy(im->data, data, width * height * sizeof(DATA32));
|
||||
memcpy(im->data, data, width * height * sizeof(uint32_t));
|
||||
return im;
|
||||
}
|
||||
else
|
||||
|
@ -1328,7 +1328,7 @@ imlib_create_image_from_drawable(Pixmap mask, int x, int y, int width,
|
|||
mask = None;
|
||||
}
|
||||
im = __imlib_CreateImage(width, height, NULL);
|
||||
im->data = malloc(width * height * sizeof(DATA32));
|
||||
im->data = malloc(width * height * sizeof(uint32_t));
|
||||
if (__imlib_GrabDrawableToRGBA(im->data, 0, 0, width, height, ctx->display,
|
||||
ctx->drawable, mask, ctx->visual,
|
||||
ctx->colormap, ctx->depth, x, y, width,
|
||||
|
@ -1354,7 +1354,7 @@ imlib_create_image_from_ximage(XImage * image, XImage * mask, int x, int y,
|
|||
if (!IMAGE_DIMENSIONS_OK(width, height))
|
||||
return NULL;
|
||||
im = __imlib_CreateImage(width, height, NULL);
|
||||
im->data = malloc(width * height * sizeof(DATA32));
|
||||
im->data = malloc(width * height * sizeof(uint32_t));
|
||||
__imlib_GrabXImageToRGBA(im->data, 0, 0, width, height,
|
||||
ctx->display, image, mask, ctx->visual,
|
||||
ctx->depth, x, y, width, height, need_to_grab_x);
|
||||
|
@ -1381,7 +1381,7 @@ imlib_create_scaled_image_from_drawable(Pixmap mask, int source_x,
|
|||
domask = mask != 0 || get_mask_from_shape;
|
||||
|
||||
im = __imlib_CreateImage(destination_width, destination_height, NULL);
|
||||
im->data = malloc(destination_width * destination_height * sizeof(DATA32));
|
||||
im->data = malloc(destination_width * destination_height * sizeof(uint32_t));
|
||||
|
||||
__imlib_GrabDrawableScaledToRGBA(im->data, 0, 0,
|
||||
destination_width, destination_height,
|
||||
|
@ -1480,13 +1480,13 @@ imlib_clone_image(void)
|
|||
im = __imlib_CreateImage(im_old->w, im_old->h, NULL);
|
||||
if (!(im))
|
||||
return NULL;
|
||||
im->data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
im->data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
if (!(im->data))
|
||||
{
|
||||
__imlib_FreeImage(im);
|
||||
return NULL;
|
||||
}
|
||||
memcpy(im->data, im_old->data, im->w * im->h * sizeof(DATA32));
|
||||
memcpy(im->data, im_old->data, im->w * im->h * sizeof(uint32_t));
|
||||
im->flags = im_old->flags;
|
||||
IM_FLAG_SET(im, F_UNCACHEABLE);
|
||||
im->moddate = im_old->moddate;
|
||||
|
@ -1511,7 +1511,7 @@ imlib_create_cropped_image(int x, int y, int width, int height)
|
|||
if (__imlib_LoadImageData(im_old))
|
||||
return NULL;
|
||||
im = __imlib_CreateImage(abs(width), abs(height), NULL);
|
||||
im->data = malloc(abs(width * height) * sizeof(DATA32));
|
||||
im->data = malloc(abs(width * height) * sizeof(uint32_t));
|
||||
if (!(im->data))
|
||||
{
|
||||
__imlib_FreeImage(im);
|
||||
|
@ -1553,7 +1553,7 @@ imlib_create_cropped_scaled_image(int source_x, int source_y,
|
|||
im = __imlib_CreateImage(abs(destination_width), abs(destination_height),
|
||||
NULL);
|
||||
im->data =
|
||||
malloc(abs(destination_width * destination_height) * sizeof(DATA32));
|
||||
malloc(abs(destination_width * destination_height) * sizeof(uint32_t));
|
||||
if (!(im->data))
|
||||
{
|
||||
__imlib_FreeImage(im);
|
||||
|
@ -2363,8 +2363,8 @@ imlib_modify_color_modifier_contrast(double contrast_value)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
imlib_set_color_modifier_tables(DATA8 * red_table, DATA8 * green_table,
|
||||
DATA8 * blue_table, DATA8 * alpha_table)
|
||||
imlib_set_color_modifier_tables(uint8_t * red_table, uint8_t * green_table,
|
||||
uint8_t * blue_table, uint8_t * alpha_table)
|
||||
{
|
||||
CHECK_PARAM_POINTER("color_modifier", ctx->color_modifier);
|
||||
__imlib_CmodSetTables((ImlibColorModifier *) ctx->color_modifier,
|
||||
|
@ -2372,8 +2372,8 @@ imlib_set_color_modifier_tables(DATA8 * red_table, DATA8 * green_table,
|
|||
}
|
||||
|
||||
EAPI void
|
||||
imlib_get_color_modifier_tables(DATA8 * red_table, DATA8 * green_table,
|
||||
DATA8 * blue_table, DATA8 * alpha_table)
|
||||
imlib_get_color_modifier_tables(uint8_t * red_table, uint8_t * green_table,
|
||||
uint8_t * blue_table, uint8_t * alpha_table)
|
||||
{
|
||||
CHECK_PARAM_POINTER("color_modifier", ctx->color_modifier);
|
||||
__imlib_CmodGetTables((ImlibColorModifier *) ctx->color_modifier,
|
||||
|
@ -2663,7 +2663,7 @@ EAPI void
|
|||
imlib_image_query_pixel(int x, int y, Imlib_Color * color_return)
|
||||
{
|
||||
ImlibImage *im;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
CHECK_PARAM_POINTER("image", ctx->image);
|
||||
CHECK_PARAM_POINTER("color_return", color_return);
|
||||
|
@ -2690,7 +2690,7 @@ imlib_image_query_pixel_hsva(int x, int y, float *hue, float *saturation,
|
|||
float *value, int *alpha)
|
||||
{
|
||||
ImlibImage *im;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
int r, g, b;
|
||||
|
||||
CHECK_PARAM_POINTER("image", ctx->image);
|
||||
|
@ -2719,7 +2719,7 @@ imlib_image_query_pixel_hlsa(int x, int y, float *hue, float *lightness,
|
|||
float *saturation, int *alpha)
|
||||
{
|
||||
ImlibImage *im;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
int r, g, b;
|
||||
|
||||
CHECK_PARAM_POINTER("image", ctx->image);
|
||||
|
@ -2748,7 +2748,7 @@ imlib_image_query_pixel_cmya(int x, int y, int *cyan, int *magenta, int *yellow,
|
|||
int *alpha)
|
||||
{
|
||||
ImlibImage *im;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
CHECK_PARAM_POINTER("image", ctx->image);
|
||||
CAST_IMAGE(im, ctx->image);
|
||||
|
@ -2912,7 +2912,7 @@ imlib_create_rotated_image(double angle)
|
|||
return NULL;
|
||||
|
||||
im = __imlib_CreateImage(sz, sz, NULL);
|
||||
im->data = calloc(sz * sz, sizeof(DATA32));
|
||||
im->data = calloc(sz * sz, sizeof(uint32_t));
|
||||
if (!(im->data))
|
||||
{
|
||||
__imlib_FreeImage(im);
|
||||
|
@ -2970,7 +2970,7 @@ imlib_rotate_image_from_buffer(double angle, Imlib_Image source_image)
|
|||
|
||||
#if 0 /* Not necessary 'cause destination is context */
|
||||
im = __imlib_CreateImage(sz, sz, NULL);
|
||||
im->data = calloc(sz * sz, sizeof(DATA32));
|
||||
im->data = calloc(sz * sz, sizeof(uint32_t));
|
||||
if (!(im->data))
|
||||
{
|
||||
__imlib_FreeImage(im);
|
||||
|
@ -3329,7 +3329,7 @@ imlib_image_clear(void)
|
|||
if (__imlib_LoadImageData(im))
|
||||
return;
|
||||
__imlib_DirtyImage(im);
|
||||
memset(im->data, 0, im->w * im->h * sizeof(DATA32));
|
||||
memset(im->data, 0, im->w * im->h * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3337,7 +3337,7 @@ imlib_image_clear_color(int r, int g, int b, int a)
|
|||
{
|
||||
ImlibImage *im;
|
||||
int i, max;
|
||||
DATA32 col;
|
||||
uint32_t col;
|
||||
|
||||
CHECK_PARAM_POINTER("image", ctx->image);
|
||||
CAST_IMAGE(im, ctx->image);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
FN_(imlib_mmx_RotateAA)
|
||||
|
||||
|
||||
/*\ Prototype: __imlib_mmx_RotateAA(DATA32 *src, DATA32 *dest, int sow, int sw,
|
||||
/*\ Prototype: __imlib_mmx_RotateAA(uint32_t *src, uint32_t *dest, int sow, int sw,
|
||||
|*| int sh, int dow, int dw, int dh, int x, int y,
|
||||
|*| int dxh, int dyh, int dxv, int dyv)
|
||||
\*/
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
.align 8
|
||||
FN_(imlib_Scale_mmx_AARGBA)
|
||||
|
||||
/*\ Prototype: __imlib_Scale_mmx_AARGBA(ImlibScaleInfo *isi, DATA32 *dest,
|
||||
/*\ Prototype: __imlib_Scale_mmx_AARGBA(ImlibScaleInfo *isi, uint32_t *dest,
|
||||
|*| int dxx, int dyy, int dx, int dy, int dw, int dh, int dow, int sow)
|
||||
\*/
|
||||
|
||||
|
|
326
src/lib/blend.c
326
src/lib/blend.c
|
@ -23,7 +23,7 @@
|
|||
RESHADE_COLOR(G_VAL(dest), g, G_VAL(dest)); \
|
||||
RESHADE_COLOR(B_VAL(dest), b, B_VAL(dest));
|
||||
|
||||
DATA8 pow_lut[256][256];
|
||||
uint8_t pow_lut[256][256];
|
||||
|
||||
void
|
||||
__imlib_build_pow_lut(void)
|
||||
|
@ -54,7 +54,7 @@ __imlib_build_pow_lut(void)
|
|||
/* COPY OPS */
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -63,8 +63,8 @@ __imlib_BlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = A_VAL(src);
|
||||
switch (a)
|
||||
|
@ -88,7 +88,7 @@ __imlib_BlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -97,8 +97,8 @@ __imlib_BlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = A_VAL(src);
|
||||
switch (aa)
|
||||
|
@ -124,7 +124,7 @@ __imlib_BlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -144,7 +144,7 @@ __imlib_CopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -164,7 +164,7 @@ __imlib_CopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -186,7 +186,7 @@ __imlib_CopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* ADD OPS */
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddBlendRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -195,8 +195,8 @@ __imlib_AddBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = A_VAL(src);
|
||||
switch (a)
|
||||
|
@ -220,7 +220,7 @@ __imlib_AddBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddBlendRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -229,8 +229,8 @@ __imlib_AddBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = A_VAL(src);
|
||||
switch (aa)
|
||||
|
@ -257,7 +257,7 @@ __imlib_AddBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddCopyRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -266,7 +266,7 @@ __imlib_AddCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
ADD_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
src++;
|
||||
|
@ -279,7 +279,7 @@ __imlib_AddCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddCopyRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -288,7 +288,7 @@ __imlib_AddCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(src);
|
||||
ADD_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -302,7 +302,7 @@ __imlib_AddCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddCopyRGBToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -311,7 +311,7 @@ __imlib_AddCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = 0xff;
|
||||
ADD_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -327,7 +327,7 @@ __imlib_AddCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* SUBTRACT OPS */
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubBlendRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -336,8 +336,8 @@ __imlib_SubBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = A_VAL(src);
|
||||
switch (a)
|
||||
|
@ -361,7 +361,7 @@ __imlib_SubBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubBlendRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -370,8 +370,8 @@ __imlib_SubBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = A_VAL(src);
|
||||
switch (aa)
|
||||
|
@ -398,7 +398,7 @@ __imlib_SubBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubCopyRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -407,7 +407,7 @@ __imlib_SubCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
SUB_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
src++;
|
||||
|
@ -420,7 +420,7 @@ __imlib_SubCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubCopyRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -429,7 +429,7 @@ __imlib_SubCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(src);
|
||||
SUB_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -443,7 +443,7 @@ __imlib_SubCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubCopyRGBToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -452,7 +452,7 @@ __imlib_SubCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = 0xff;
|
||||
SUB_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -468,7 +468,7 @@ __imlib_SubCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* RESHADE OPS */
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReBlendRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -477,8 +477,8 @@ __imlib_ReBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = A_VAL(src);
|
||||
switch (a)
|
||||
|
@ -502,7 +502,7 @@ __imlib_ReBlendRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReBlendRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -511,8 +511,8 @@ __imlib_ReBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = A_VAL(src);
|
||||
switch (aa)
|
||||
|
@ -539,7 +539,7 @@ __imlib_ReBlendRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBAToRGB(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -548,7 +548,7 @@ __imlib_ReCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
RE_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
src++;
|
||||
|
@ -561,7 +561,7 @@ __imlib_ReCopyRGBAToRGB(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBAToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -570,7 +570,7 @@ __imlib_ReCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(src);
|
||||
RE_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -584,7 +584,7 @@ __imlib_ReCopyRGBAToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBToRGBA(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
|
@ -593,7 +593,7 @@ __imlib_ReCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = 0xff;
|
||||
RE_COPY(R_VAL(src), G_VAL(src), B_VAL(src), dst);
|
||||
|
@ -610,19 +610,19 @@ __imlib_ReCopyRGBToRGBA(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* COPY OPS */
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = amod[A_VAL(src)];
|
||||
switch (a)
|
||||
|
@ -649,19 +649,19 @@ __imlib_BlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = amod[A_VAL(src)];
|
||||
switch (aa)
|
||||
|
@ -691,20 +691,20 @@ __imlib_BlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[am][A_VAL(dst)];
|
||||
BLEND_COLOR(am, A_VAL(dst), 255, A_VAL(dst))
|
||||
|
@ -720,19 +720,19 @@ __imlib_BlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_BlendRGBToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], am,
|
||||
dst);
|
||||
|
@ -746,11 +746,11 @@ __imlib_BlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *rmod = cm->red_mapping,
|
||||
uint8_t *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
|
@ -770,13 +770,13 @@ __imlib_CopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
|
@ -796,11 +796,11 @@ __imlib_CopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_CopyRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
|
@ -823,19 +823,19 @@ __imlib_CopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* ADD OPS */
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_AddBlendRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = amod[A_VAL(src)];
|
||||
switch (a)
|
||||
|
@ -861,19 +861,19 @@ __imlib_AddBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_AddBlendRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = amod[A_VAL(src)];
|
||||
switch (aa)
|
||||
|
@ -902,19 +902,19 @@ __imlib_AddBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddBlendRGBToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_ADD(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], am,
|
||||
dst);
|
||||
|
@ -928,20 +928,20 @@ __imlib_AddBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_AddBlendRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[am][A_VAL(dst)];
|
||||
BLEND_COLOR(am, A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -957,18 +957,18 @@ __imlib_AddBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddCopyRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *rmod = cm->red_mapping,
|
||||
uint8_t *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
ADD_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
dst);
|
||||
|
@ -982,18 +982,18 @@ __imlib_AddCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_AddCopyRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = amod[A_VAL(src)];
|
||||
ADD_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
|
@ -1008,19 +1008,19 @@ __imlib_AddCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_AddCopyRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = am;
|
||||
ADD_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
|
@ -1037,19 +1037,19 @@ __imlib_AddCopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* SUBTRACT OPS */
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_SubBlendRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = amod[A_VAL(src)];
|
||||
switch (a)
|
||||
|
@ -1075,19 +1075,19 @@ __imlib_SubBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_SubBlendRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = amod[A_VAL(src)];
|
||||
switch (aa)
|
||||
|
@ -1116,19 +1116,19 @@ __imlib_SubBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubBlendRGBToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_SUB(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], am,
|
||||
dst);
|
||||
|
@ -1142,20 +1142,20 @@ __imlib_SubBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_SubBlendRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[am][A_VAL(dst)];
|
||||
BLEND_COLOR(am, A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -1171,18 +1171,18 @@ __imlib_SubBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubCopyRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *rmod = cm->red_mapping,
|
||||
uint8_t *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
SUB_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
dst);
|
||||
|
@ -1196,18 +1196,18 @@ __imlib_SubCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_SubCopyRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = amod[A_VAL(src)];
|
||||
SUB_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
|
@ -1222,19 +1222,19 @@ __imlib_SubCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_SubCopyRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = am;
|
||||
SUB_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)],
|
||||
|
@ -1251,19 +1251,19 @@ __imlib_SubCopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
/* RESHADE OPS */
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReBlendRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = amod[A_VAL(src)];
|
||||
switch (a)
|
||||
|
@ -1289,19 +1289,19 @@ __imlib_ReBlendRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
__imlib_ReBlendRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst,
|
||||
int dstw, int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
aa = amod[A_VAL(src)];
|
||||
switch (aa)
|
||||
|
@ -1329,19 +1329,19 @@ __imlib_ReBlendRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReBlendRGBToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_RE(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], am,
|
||||
dst);
|
||||
|
@ -1355,20 +1355,20 @@ __imlib_ReBlendRGBToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReBlendRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[am][A_VAL(dst)];
|
||||
BLEND_COLOR(am, A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -1384,18 +1384,18 @@ __imlib_ReBlendRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBAToRGBCmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *rmod = cm->red_mapping,
|
||||
uint8_t *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
RE_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], dst);
|
||||
src++;
|
||||
|
@ -1408,18 +1408,18 @@ __imlib_ReCopyRGBAToRGBCmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBAToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = amod[A_VAL(src)];
|
||||
RE_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], dst);
|
||||
|
@ -1433,19 +1433,19 @@ __imlib_ReCopyRGBAToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyRGBToRGBACmod(DATA32 * src, int srcw, DATA32 * dst, int dstw,
|
||||
__imlib_ReCopyRGBToRGBACmod(uint32_t * src, int srcw, uint32_t * dst, int dstw,
|
||||
int w, int h, ImlibColorModifier * cm)
|
||||
{
|
||||
int src_step = (srcw - w), dst_step = (dstw - w), ww = w;
|
||||
DATA8 *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
uint8_t *amod = cm->alpha_mapping, *rmod = cm->red_mapping,
|
||||
*gmod = cm->green_mapping, *bmod = cm->blue_mapping;
|
||||
DATA8 am = amod[255];
|
||||
uint8_t am = amod[255];
|
||||
|
||||
while (h--)
|
||||
{
|
||||
while (w--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = am;
|
||||
RE_COPY(rmod[R_VAL(src)], gmod[G_VAL(src)], bmod[B_VAL(src)], dst);
|
||||
|
@ -1739,7 +1739,7 @@ __imlib_GetBlendFunction(ImlibOp op, char blend, char merge_alpha, char rgb_src,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_BlendRGBAToData(DATA32 * src, int src_w, int src_h, DATA32 * dst,
|
||||
__imlib_BlendRGBAToData(uint32_t * src, int src_w, int src_h, uint32_t * dst,
|
||||
int dst_w, int dst_h, int sx, int sy, int dx, int dy,
|
||||
int w, int h, char blend, char merge_alpha,
|
||||
ImlibColorModifier * cm, ImlibOp op, char rgb_src)
|
||||
|
@ -1846,7 +1846,7 @@ __imlib_BlendImageToImage(ImlibImage * im_src, ImlibImage * im_dst,
|
|||
else
|
||||
{
|
||||
ImlibScaleInfo *scaleinfo = NULL;
|
||||
DATA32 *buf = NULL;
|
||||
uint32_t *buf = NULL;
|
||||
int sx, sy, sw, sh, dx, dy, dw, dh, dxx, dyy, y2, x2;
|
||||
int psx, psy, psw, psh;
|
||||
int y, h, hh;
|
||||
|
@ -1919,7 +1919,7 @@ __imlib_BlendImageToImage(ImlibImage * im_src, ImlibImage * im_dst,
|
|||
return;
|
||||
/* if we are scaling the image at all make a scaling buffer */
|
||||
/* allocate a buffer to render scaled RGBA data into */
|
||||
buf = malloc(dw * LINESIZE * sizeof(DATA32));
|
||||
buf = malloc(dw * LINESIZE * sizeof(uint32_t));
|
||||
if (!buf)
|
||||
{
|
||||
__imlib_FreeScaleInfo(scaleinfo);
|
||||
|
|
208
src/lib/blend.h
208
src/lib/blend.h
|
@ -266,10 +266,10 @@ nc = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
|
|||
tmp = (cc) + (((c) - 127) << 1); \
|
||||
nc = (tmp | (-(tmp >> 8))) & (~(tmp >> 9));
|
||||
|
||||
extern DATA8 pow_lut[256][256];
|
||||
extern uint8_t pow_lut[256][256];
|
||||
|
||||
#define BLEND_DST_ALPHA(r1, g1, b1, a1, dest) \
|
||||
{ DATA8 _aa; \
|
||||
{ uint8_t _aa; \
|
||||
_aa = pow_lut[a1][A_VAL(dest)]; \
|
||||
BLEND_COLOR(a1, A_VAL(dest), 255, A_VAL(dest)); \
|
||||
BLEND_COLOR(_aa, R_VAL(dest), r1, R_VAL(dest)); \
|
||||
|
@ -304,7 +304,7 @@ enum _imlibop {
|
|||
OP_RESHADE
|
||||
};
|
||||
|
||||
typedef void (*ImlibBlendFunction)(DATA32 *, int, DATA32 *, int, int,
|
||||
typedef void (*ImlibBlendFunction)(uint32_t *, int, uint32_t *, int, int,
|
||||
int, ImlibColorModifier *);
|
||||
|
||||
ImlibBlendFunction __imlib_GetBlendFunction(ImlibOp op, char merge_alpha,
|
||||
|
@ -320,211 +320,211 @@ void __imlib_BlendImageToImage(ImlibImage * im_src,
|
|||
ImlibColorModifier * cm,
|
||||
ImlibOp op, int clx, int cly,
|
||||
int clw, int clh);
|
||||
void __imlib_BlendRGBAToData(DATA32 * src, int src_w, int src_h,
|
||||
DATA32 * dst, int dst_w, int dst_h,
|
||||
int sx, int sy, int dx, int dy,
|
||||
int w, int h,
|
||||
char blend, char merge_alpha,
|
||||
void __imlib_BlendRGBAToData(uint32_t * src, int src_w,
|
||||
int src_h, uint32_t * dst,
|
||||
int dst_w, int dst_h, int sx,
|
||||
int sy, int dx, int dy, int w,
|
||||
int h, char blend, char merge_alpha,
|
||||
ImlibColorModifier * cm, ImlibOp op,
|
||||
char rgb_src);
|
||||
void __imlib_build_pow_lut(void);
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef DO_MMX_ASM
|
||||
void __imlib_mmx_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
|
||||
void __imlib_mmx_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_add_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_add_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_subtract_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_subtract_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_mmx_reshade_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_mmx_reshade_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
#elif DO_AMD64_ASM
|
||||
void __imlib_amd64_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgb(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgb(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgb_to_rgba(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgb_to_rgba(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
|
||||
void __imlib_amd64_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_add_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_add_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_subtract_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_subtract_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgb_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgb_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_blend_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_blend_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgb_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgb_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgba_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
void __imlib_amd64_reshade_copy_rgb_to_rgba_cmod(DATA32 * src, int sw, DATA32 * dst, int dw,
|
||||
void __imlib_amd64_reshade_copy_rgb_to_rgba_cmod(uint32_t * src, int sw, uint32_t * dst, int dw,
|
||||
int w, int h, ImlibColorModifier * cm);
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "colormod.h"
|
||||
#include "image.h"
|
||||
|
||||
static DATABIG mod_count = 0;
|
||||
static uint64_t mod_count = 0;
|
||||
|
||||
ImlibColorModifier *
|
||||
__imlib_CreateCmod(void)
|
||||
|
@ -19,10 +19,10 @@ __imlib_CreateCmod(void)
|
|||
cm->modification_count = mod_count;
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
cm->red_mapping[i] = (DATA8) i;
|
||||
cm->green_mapping[i] = (DATA8) i;
|
||||
cm->blue_mapping[i] = (DATA8) i;
|
||||
cm->alpha_mapping[i] = (DATA8) i;
|
||||
cm->red_mapping[i] = (uint8_t) i;
|
||||
cm->green_mapping[i] = (uint8_t) i;
|
||||
cm->blue_mapping[i] = (uint8_t) i;
|
||||
cm->alpha_mapping[i] = (uint8_t) i;
|
||||
}
|
||||
return cm;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ __imlib_CmodChanged(ImlibColorModifier * cm)
|
|||
|
||||
void
|
||||
__imlib_CmodSetTables(ImlibColorModifier * cm,
|
||||
DATA8 * r, DATA8 * g, DATA8 * b, DATA8 * a)
|
||||
uint8_t * r, uint8_t * g, uint8_t * b, uint8_t * a)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -67,20 +67,20 @@ __imlib_CmodReset(ImlibColorModifier * cm)
|
|||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
cm->red_mapping[i] = (DATA8) i;
|
||||
cm->green_mapping[i] = (DATA8) i;
|
||||
cm->blue_mapping[i] = (DATA8) i;
|
||||
cm->alpha_mapping[i] = (DATA8) i;
|
||||
cm->red_mapping[i] = (uint8_t) i;
|
||||
cm->green_mapping[i] = (uint8_t) i;
|
||||
cm->blue_mapping[i] = (uint8_t) i;
|
||||
cm->alpha_mapping[i] = (uint8_t) i;
|
||||
}
|
||||
__imlib_CmodChanged(cm);
|
||||
}
|
||||
|
||||
void
|
||||
__imlib_DataCmodApply(DATA32 * data, int w, int h, int jump,
|
||||
__imlib_DataCmodApply(uint32_t * data, int w, int h, int jump,
|
||||
ImlibImageFlags * fl, ImlibColorModifier * cm)
|
||||
{
|
||||
int x, y;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
/* We might be adding alpha */
|
||||
if (fl && !(*fl & F_HAS_ALPHA))
|
||||
|
@ -116,17 +116,17 @@ __imlib_DataCmodApply(DATA32 * data, int w, int h, int jump,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_CmodGetTables(ImlibColorModifier * cm, DATA8 * r, DATA8 * g,
|
||||
DATA8 * b, DATA8 * a)
|
||||
__imlib_CmodGetTables(ImlibColorModifier * cm, uint8_t * r, uint8_t * g,
|
||||
uint8_t * b, uint8_t * a)
|
||||
{
|
||||
if (r)
|
||||
memcpy(r, cm->red_mapping, (256 * sizeof(DATA8)));
|
||||
memcpy(r, cm->red_mapping, (256 * sizeof(uint8_t)));
|
||||
if (g)
|
||||
memcpy(g, cm->green_mapping, (256 * sizeof(DATA8)));
|
||||
memcpy(g, cm->green_mapping, (256 * sizeof(uint8_t)));
|
||||
if (b)
|
||||
memcpy(b, cm->blue_mapping, (256 * sizeof(DATA8)));
|
||||
memcpy(b, cm->blue_mapping, (256 * sizeof(uint8_t)));
|
||||
if (a)
|
||||
memcpy(a, cm->alpha_mapping, (256 * sizeof(DATA8)));
|
||||
memcpy(a, cm->alpha_mapping, (256 * sizeof(uint8_t)));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -142,28 +142,28 @@ __imlib_CmodModBrightness(ImlibColorModifier * cm, double v)
|
|||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->red_mapping[i] = (DATA8) val2;
|
||||
cm->red_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)cm->green_mapping[i] + val;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->green_mapping[i] = (DATA8) val2;
|
||||
cm->green_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)cm->blue_mapping[i] + val;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->blue_mapping[i] = (DATA8) val2;
|
||||
cm->blue_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)cm->alpha_mapping[i] + val;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->alpha_mapping[i] = (DATA8) val2;
|
||||
cm->alpha_mapping[i] = (uint8_t) val2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,28 +179,28 @@ __imlib_CmodModContrast(ImlibColorModifier * cm, double v)
|
|||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->red_mapping[i] = (DATA8) val2;
|
||||
cm->red_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(((double)cm->green_mapping[i] - 127) * v) + 127;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->green_mapping[i] = (DATA8) val2;
|
||||
cm->green_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(((double)cm->blue_mapping[i] - 127) * v) + 127;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->blue_mapping[i] = (DATA8) val2;
|
||||
cm->blue_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(((double)cm->alpha_mapping[i] - 127) * v) + 127;
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->alpha_mapping[i] = (DATA8) val2;
|
||||
cm->alpha_mapping[i] = (uint8_t) val2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,28 +218,28 @@ __imlib_CmodModGamma(ImlibColorModifier * cm, double v)
|
|||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->red_mapping[i] = (DATA8) val2;
|
||||
cm->red_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(pow(((double)cm->green_mapping[i] / 255), (1 / v)) * 255);
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->green_mapping[i] = (DATA8) val2;
|
||||
cm->green_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(pow(((double)cm->blue_mapping[i] / 255), (1 / v)) * 255);
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->blue_mapping[i] = (DATA8) val2;
|
||||
cm->blue_mapping[i] = (uint8_t) val2;
|
||||
|
||||
val2 = (int)(pow(((double)cm->alpha_mapping[i] / 255), (1 / v)) * 255);
|
||||
if (val2 < 0)
|
||||
val2 = 0;
|
||||
if (val2 > 255)
|
||||
val2 = 255;
|
||||
cm->alpha_mapping[i] = (DATA8) val2;
|
||||
cm->alpha_mapping[i] = (uint8_t) val2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#include "types.h"
|
||||
|
||||
struct _ImlibColorModifier {
|
||||
DATA8 red_mapping[256];
|
||||
DATA8 green_mapping[256];
|
||||
DATA8 blue_mapping[256];
|
||||
DATA8 alpha_mapping[256];
|
||||
DATABIG modification_count;
|
||||
uint8_t red_mapping[256];
|
||||
uint8_t green_mapping[256];
|
||||
uint8_t blue_mapping[256];
|
||||
uint8_t alpha_mapping[256];
|
||||
uint64_t modification_count;
|
||||
};
|
||||
|
||||
#define CMOD_APPLY_RGB(cm, r, g, b) \
|
||||
|
@ -43,15 +43,17 @@ struct _ImlibColorModifier {
|
|||
ImlibColorModifier *__imlib_CreateCmod(void);
|
||||
void __imlib_FreeCmod(ImlibColorModifier * cm);
|
||||
void __imlib_CmodChanged(ImlibColorModifier * cm);
|
||||
void __imlib_CmodSetTables(ImlibColorModifier * cm, DATA8 * r,
|
||||
DATA8 * g, DATA8 * b, DATA8 * a);
|
||||
void __imlib_CmodSetTables(ImlibColorModifier * cm, uint8_t * r,
|
||||
uint8_t * g, uint8_t * b,
|
||||
uint8_t * a);
|
||||
void __imlib_CmodReset(ImlibColorModifier * cm);
|
||||
void __imlib_DataCmodApply(DATA32 * data, int w, int h,
|
||||
void __imlib_DataCmodApply(uint32_t * data, int w, int h,
|
||||
int jump, ImlibImageFlags * fl,
|
||||
ImlibColorModifier * cm);
|
||||
|
||||
void __imlib_CmodGetTables(ImlibColorModifier * cm, DATA8 * r,
|
||||
DATA8 * g, DATA8 * b, DATA8 * a);
|
||||
void __imlib_CmodGetTables(ImlibColorModifier * cm, uint8_t * r,
|
||||
uint8_t * g, uint8_t * b,
|
||||
uint8_t * a);
|
||||
void __imlib_CmodModBrightness(ImlibColorModifier * cm,
|
||||
double v);
|
||||
void __imlib_CmodModContrast(ImlibColorModifier * cm, double v);
|
||||
|
|
|
@ -44,15 +44,15 @@
|
|||
#define PIXEL_B(argb) (((argb) ) & 0xff)
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define A_VAL(p) ((DATA8 *)(p))[3]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[0]
|
||||
#define A_VAL(p) ((uint8_t *)(p))[3]
|
||||
#define R_VAL(p) ((uint8_t *)(p))[2]
|
||||
#define G_VAL(p) ((uint8_t *)(p))[1]
|
||||
#define B_VAL(p) ((uint8_t *)(p))[0]
|
||||
#else
|
||||
#define A_VAL(p) ((DATA8 *)(p))[0]
|
||||
#define R_VAL(p) ((DATA8 *)(p))[1]
|
||||
#define G_VAL(p) ((DATA8 *)(p))[2]
|
||||
#define B_VAL(p) ((DATA8 *)(p))[3]
|
||||
#define A_VAL(p) ((uint8_t *)(p))[0]
|
||||
#define R_VAL(p) ((uint8_t *)(p))[1]
|
||||
#define G_VAL(p) ((uint8_t *)(p))[2]
|
||||
#define B_VAL(p) ((uint8_t *)(p))[3]
|
||||
#endif
|
||||
|
||||
#define CLIP(x, y, w, h, xx, yy, ww, hh) \
|
||||
|
|
|
@ -18,14 +18,14 @@ div_round_16(int n)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_Ellipse_DrawToData(int xc, int yc, int a, int b, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
__imlib_Ellipse_DrawToData(int xc, int yc, int a, int b, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
int xx, yy, x, y, prev_x, prev_y, ty, by, lx, rx;
|
||||
DATA32 a2, b2, *tp, *bp;
|
||||
DATA64 dx, dy;
|
||||
uint32_t a2, b2, *tp, *bp;
|
||||
uint64_t dx, dy;
|
||||
|
||||
if (A_VAL(&color) == 0xff)
|
||||
blend = 0;
|
||||
|
@ -153,15 +153,16 @@ __imlib_Ellipse_DrawToData(int xc, int yc, int a, int b, DATA32 color,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_Ellipse_DrawToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
__imlib_Ellipse_DrawToData_AA(int xc, int yc, int a, int b, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly,
|
||||
int clw, int clh, ImlibOp op, char dst_alpha,
|
||||
char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
int xx, yy, x, y, prev_x, prev_y, ty, by, lx, rx;
|
||||
DATA32 a2, b2, col0, col1, *tp, *bp;
|
||||
DATA64 dx, dy;
|
||||
DATA8 ca = A_VAL(&color);
|
||||
uint32_t a2, b2, col0, col1, *tp, *bp;
|
||||
uint64_t dx, dy;
|
||||
uint8_t ca = A_VAL(&color);
|
||||
|
||||
pfunc = __imlib_GetPointDrawFunction(op, dst_alpha, blend);
|
||||
if (!pfunc)
|
||||
|
@ -192,7 +193,7 @@ __imlib_Ellipse_DrawToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (dy < dx)
|
||||
{
|
||||
int len;
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
y = yy >> 16;
|
||||
|
||||
|
@ -268,7 +269,7 @@ __imlib_Ellipse_DrawToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (ty < yc)
|
||||
{
|
||||
int len;
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
x = xx >> 16;
|
||||
|
||||
|
@ -331,15 +332,15 @@ __imlib_Ellipse_DrawToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
__imlib_Ellipse_FillToData(int xc, int yc, int a, int b, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
ImlibSpanDrawFunction sfunc;
|
||||
int xx, yy, x, y, prev_x, prev_y, ty, by, lx, rx;
|
||||
DATA32 a2, b2, *tp, *bp;
|
||||
DATA64 dx, dy;
|
||||
uint32_t a2, b2, *tp, *bp;
|
||||
uint64_t dx, dy;
|
||||
|
||||
if (A_VAL(&color) == 0xff)
|
||||
blend = 0;
|
||||
|
@ -372,7 +373,7 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (dy < dx)
|
||||
{
|
||||
int len;
|
||||
DATA32 *tpp, *bpp;
|
||||
uint32_t *tpp, *bpp;
|
||||
|
||||
y = div_round_16(yy);
|
||||
|
||||
|
@ -443,7 +444,7 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (ty < yc)
|
||||
{
|
||||
int len;
|
||||
DATA32 *tpp, *bpp;
|
||||
uint32_t *tpp, *bpp;
|
||||
|
||||
x = div_round_16(xx);
|
||||
|
||||
|
@ -491,16 +492,17 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
__imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly,
|
||||
int clw, int clh, ImlibOp op, char dst_alpha,
|
||||
char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
ImlibSpanDrawFunction sfunc;
|
||||
int xx, yy, x, y, prev_x, prev_y, ty, by, lx, rx;
|
||||
DATA32 a2, b2, col1, *tp, *bp;
|
||||
DATA64 dx, dy;
|
||||
DATA8 ca = A_VAL(&color);
|
||||
uint32_t a2, b2, col1, *tp, *bp;
|
||||
uint64_t dx, dy;
|
||||
uint8_t ca = A_VAL(&color);
|
||||
|
||||
pfunc = __imlib_GetPointDrawFunction(op, dst_alpha, blend);
|
||||
if (ca == 0xff)
|
||||
|
@ -534,7 +536,7 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (dy < dx)
|
||||
{
|
||||
int len;
|
||||
DATA32 tmp, *tpp, *bpp;
|
||||
uint32_t tmp, *tpp, *bpp;
|
||||
|
||||
y = yy >> 16;
|
||||
|
||||
|
@ -610,7 +612,7 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
while (ty < yc)
|
||||
{
|
||||
int len;
|
||||
DATA32 tmp, *tpp, *bpp;
|
||||
uint32_t tmp, *tpp, *bpp;
|
||||
|
||||
x = xx >> 16;
|
||||
|
||||
|
@ -673,7 +675,7 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Ellipse_DrawToImage(int xc, int yc, int a, int b, DATA32 color,
|
||||
__imlib_Ellipse_DrawToImage(int xc, int yc, int a, int b, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char anti_alias)
|
||||
{
|
||||
|
@ -741,7 +743,7 @@ __imlib_Ellipse_DrawToImage(int xc, int yc, int a, int b, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Ellipse_FillToImage(int xc, int yc, int a, int b, DATA32 color,
|
||||
__imlib_Ellipse_FillToImage(int xc, int yc, int a, int b, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char anti_alias)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ do { \
|
|||
} while (0)
|
||||
|
||||
ImlibUpdate *
|
||||
__imlib_Point_DrawToImage(int x, int y, DATA32 color,
|
||||
__imlib_Point_DrawToImage(int x, int y, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char make_updates)
|
||||
{
|
||||
|
@ -56,16 +56,16 @@ __imlib_Point_DrawToImage(int x, int y, DATA32 color,
|
|||
}
|
||||
|
||||
static int
|
||||
__imlib_SimpleLine_DrawToData(int x0, int y0, int x1, int y1, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, int *cl_x0, int *cl_y0, int *cl_x1,
|
||||
int *cl_y1, ImlibOp op, char dst_alpha,
|
||||
char blend)
|
||||
__imlib_SimpleLine_DrawToData(int x0, int y0, int x1, int y1, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly,
|
||||
int clw, int clh, int *cl_x0, int *cl_y0,
|
||||
int *cl_x1, int *cl_y1, ImlibOp op,
|
||||
char dst_alpha, char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
ImlibSpanDrawFunction sfunc;
|
||||
int dx, dy, len, lx, ty, rx, by;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
if (A_VAL(&color) == 0xff)
|
||||
blend = 0;
|
||||
|
@ -393,8 +393,8 @@ do { \
|
|||
} while (0)
|
||||
|
||||
static int
|
||||
__imlib_Line_DrawToData(int x0, int y0, int x1, int y1, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
__imlib_Line_DrawToData(int x0, int y0, int x1, int y1, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, int *cl_x0, int *cl_y0, int *cl_x1, int *cl_y1,
|
||||
ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ __imlib_Line_DrawToData(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
int px, py, x, y, prev_x, prev_y;
|
||||
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 0;
|
||||
int delx, dely, xx, yy, dxx, dyy;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
dx = x1 - x0;
|
||||
dy = y1 - y0;
|
||||
|
@ -508,8 +508,8 @@ __imlib_Line_DrawToData(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
}
|
||||
|
||||
static int
|
||||
__imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
__imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, int *cl_x0, int *cl_y0, int *cl_x1,
|
||||
int *cl_y1, ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -517,8 +517,8 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
int px, py, x, y, prev_x, prev_y;
|
||||
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
|
||||
int delx, dely, xx, yy, dxx, dyy;
|
||||
DATA32 *p;
|
||||
DATA8 ca = A_VAL(&color);
|
||||
uint32_t *p;
|
||||
uint8_t ca = A_VAL(&color);
|
||||
|
||||
dx = x1 - x0;
|
||||
dy = y1 - y0;
|
||||
|
@ -549,8 +549,8 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
|
||||
while (px < rx)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
y = (yy >> 16);
|
||||
if (prev_y != y)
|
||||
|
@ -608,8 +608,8 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
|
||||
while (py < by)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
x = (xx >> 16);
|
||||
if (prev_x != x)
|
||||
|
@ -659,7 +659,7 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
|
|||
}
|
||||
|
||||
ImlibUpdate *
|
||||
__imlib_Line_DrawToImage(int x0, int y0, int x1, int y1, DATA32 color,
|
||||
__imlib_Line_DrawToImage(int x0, int y0, int x1, int y1, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char anti_alias,
|
||||
char make_updates)
|
||||
|
|
|
@ -416,10 +416,10 @@ do { \
|
|||
ysort = (IndexedValue *)malloc(nvertices * sizeof(IndexedValue)); \
|
||||
if (!ysort) { free(edge); return; } \
|
||||
\
|
||||
s0 = (DATA8 *)malloc(clw * sizeof(DATA8)); \
|
||||
s0 = (uint8_t *)malloc(clw * sizeof(uint8_t)); \
|
||||
if (!s0) { free(edge); free(ysort); return; } \
|
||||
\
|
||||
s1 = (DATA8 *)malloc(clw * sizeof(DATA8)); \
|
||||
s1 = (uint8_t *)malloc(clw * sizeof(uint8_t)); \
|
||||
if (!s1) { free(edge); free(ysort); free(s0); return; } \
|
||||
\
|
||||
memset(s0,0,clw); \
|
||||
|
@ -472,8 +472,8 @@ do { \
|
|||
/* draws the poly-line defined by the sequence of vertices */
|
||||
|
||||
static void
|
||||
__imlib_Polygon_DrawToData(ImlibPoly * poly, char close, DATA32 color,
|
||||
DATA32 * dst, int dstw,
|
||||
__imlib_Polygon_DrawToData(ImlibPoly * poly, char close, uint32_t color,
|
||||
uint32_t * dst, int dstw,
|
||||
int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -484,8 +484,8 @@ __imlib_Polygon_DrawToData(ImlibPoly * poly, char close, DATA32 color,
|
|||
int nactive_edges, nactive_horz_edges, nvertices;
|
||||
int clrx, clby, ty, by, y;
|
||||
int x0, x1, nx0, nx1;
|
||||
DATA32 *p;
|
||||
DATA8 *s0, *s1, *ps;
|
||||
uint32_t *p;
|
||||
uint8_t *s0, *s1, *ps;
|
||||
|
||||
INIT_POLY();
|
||||
|
||||
|
@ -711,8 +711,8 @@ __imlib_Polygon_DrawToData(ImlibPoly * poly, char close, DATA32 color,
|
|||
/* anti-aliased drawing */
|
||||
|
||||
static void
|
||||
__imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
||||
DATA32 * dst, int dstw,
|
||||
__imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, uint32_t color,
|
||||
uint32_t * dst, int dstw,
|
||||
int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -723,8 +723,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
int nactive_edges, nactive_horz_edges, nvertices;
|
||||
int clrx, clby, ty, by, y, yy, prev_y, prev_yy;
|
||||
int x0, x1, nx0, nx1;
|
||||
DATA32 *p;
|
||||
DATA8 *s0, *s1, *ps;
|
||||
uint32_t *p;
|
||||
uint8_t *s0, *s1, *ps;
|
||||
|
||||
INIT_POLY();
|
||||
|
||||
|
@ -800,8 +800,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
{
|
||||
case STEEP_EDGE:
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
aa = (e->xx - (e_lx << 16)) >> 8;
|
||||
rx = e_lx + 1;
|
||||
|
@ -862,8 +862,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
x0 = x;
|
||||
while (ey < y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == prev_y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -878,8 +878,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
lx = x;
|
||||
while (ey == y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -906,8 +906,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
ey = eyy >> 16;
|
||||
while ((ey == y) && (x <= rx))
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -929,8 +929,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
x1 = x;
|
||||
while (ey < y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == prev_y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -945,8 +945,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
rx = x;
|
||||
while (ey == y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -972,8 +972,8 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
ey = eyy >> 16;
|
||||
while ((ey == y) && (x >= lx))
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1040,7 +1040,7 @@ __imlib_Polygon_DrawToData_AA(ImlibPoly * poly, char close, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Polygon_DrawToImage(ImlibPoly * poly, char close, DATA32 color,
|
||||
__imlib_Polygon_DrawToImage(ImlibPoly * poly, char close, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char anti_alias)
|
||||
{
|
||||
|
@ -1097,8 +1097,8 @@ __imlib_Polygon_DrawToImage(ImlibPoly * poly, char close, DATA32 color,
|
|||
/* aliased filling */
|
||||
|
||||
static void
|
||||
__imlib_Polygon_FillToData(ImlibPoly * poly, DATA32 color,
|
||||
DATA32 * dst, int dstw,
|
||||
__imlib_Polygon_FillToData(ImlibPoly * poly, uint32_t color,
|
||||
uint32_t * dst, int dstw,
|
||||
int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -1109,8 +1109,8 @@ __imlib_Polygon_FillToData(ImlibPoly * poly, DATA32 color,
|
|||
int nactive_edges, nactive_horz_edges, nvertices;
|
||||
int clrx, clby, ty, by, y;
|
||||
int x0, x1, nx0, nx1;
|
||||
DATA32 *p;
|
||||
DATA8 *s0, *s1, *ps;
|
||||
uint32_t *p;
|
||||
uint8_t *s0, *s1, *ps;
|
||||
|
||||
INIT_POLY();
|
||||
|
||||
|
@ -1414,8 +1414,8 @@ __imlib_Polygon_FillToData(ImlibPoly * poly, DATA32 color,
|
|||
/* anti-aliased filling */
|
||||
|
||||
static void
|
||||
__imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
||||
DATA32 * dst, int dstw,
|
||||
__imlib_Polygon_FillToData_AA(ImlibPoly * poly, uint32_t color,
|
||||
uint32_t * dst, int dstw,
|
||||
int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char dst_alpha, char blend)
|
||||
{
|
||||
|
@ -1426,8 +1426,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
int nactive_edges, nactive_horz_edges, nvertices;
|
||||
int clrx, clby, ty, by, y, yy, prev_y, prev_yy;
|
||||
int x0, x1, nx0, nx1;
|
||||
DATA32 *p;
|
||||
DATA8 *s0, *s1, *ps;
|
||||
uint32_t *p;
|
||||
uint8_t *s0, *s1, *ps;
|
||||
|
||||
INIT_POLY();
|
||||
|
||||
|
@ -1513,8 +1513,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
{
|
||||
case STEEP_EDGE:
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (le_lx < x0)
|
||||
x0 = le_lx;
|
||||
|
@ -1556,8 +1556,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
{
|
||||
while (ey < y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == prev_y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1578,8 +1578,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
rx = le->v1->x;
|
||||
while ((ey == y) && (x <= rx))
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1597,8 +1597,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
|
||||
while (ey >= y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1637,8 +1637,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
{
|
||||
case STEEP_EDGE:
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
rx = re_lx + 1;
|
||||
if (rx > x1)
|
||||
|
@ -1680,8 +1680,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
{
|
||||
while (ey >= y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1699,8 +1699,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
|
||||
while (ey < y)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if ((ey == prev_y) && IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1721,8 +1721,8 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
lx = re->v1->x;
|
||||
while ((ey == y) && (x >= lx))
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 aa;
|
||||
uint32_t tmp;
|
||||
uint8_t aa;
|
||||
|
||||
if (IN_SEGMENT(x, clx, clw))
|
||||
{
|
||||
|
@ -1796,7 +1796,7 @@ __imlib_Polygon_FillToData_AA(ImlibPoly * poly, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Polygon_FillToImage(ImlibPoly * poly, DATA32 color,
|
||||
__imlib_Polygon_FillToImage(ImlibPoly * poly, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend, char anti_alias)
|
||||
{
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
#include "span.h"
|
||||
|
||||
static void
|
||||
__imlib_Rectangle_DrawToData(int x, int y, int rw, int rh, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
__imlib_Rectangle_DrawToData(int x, int y, int rw, int rh, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly,
|
||||
int clw, int clh, ImlibOp op, char dst_alpha,
|
||||
char blend)
|
||||
{
|
||||
ImlibPointDrawFunction pfunc;
|
||||
ImlibSpanDrawFunction sfunc;
|
||||
int x0, y0, x1, y1, len;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
if (A_VAL(&color) == 0xff)
|
||||
blend = 0;
|
||||
|
@ -83,12 +84,13 @@ __imlib_Rectangle_DrawToData(int x, int y, int rw, int rh, DATA32 color,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_Rectangle_FillToData(int x, int y, int rw, int rh, DATA32 color,
|
||||
DATA32 * dst, int dstw, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char dst_alpha, char blend)
|
||||
__imlib_Rectangle_FillToData(int x, int y, int rw, int rh, uint32_t color,
|
||||
uint32_t * dst, int dstw, int clx, int cly,
|
||||
int clw, int clh, ImlibOp op, char dst_alpha,
|
||||
char blend)
|
||||
{
|
||||
ImlibSpanDrawFunction sfunc;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
if (A_VAL(&color) == 0xff)
|
||||
blend = 0;
|
||||
|
@ -113,7 +115,7 @@ __imlib_Rectangle_FillToData(int x, int y, int rw, int rh, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Rectangle_DrawToImage(int x, int y, int w, int h, DATA32 color,
|
||||
__imlib_Rectangle_DrawToImage(int x, int y, int w, int h, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char blend)
|
||||
{
|
||||
|
@ -152,7 +154,7 @@ __imlib_Rectangle_DrawToImage(int x, int y, int w, int h, DATA32 color,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_Rectangle_FillToImage(int x, int y, int w, int h, DATA32 color,
|
||||
__imlib_Rectangle_FillToImage(int x, int y, int w, int h, uint32_t color,
|
||||
ImlibImage * im, int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char blend)
|
||||
{
|
||||
|
|
|
@ -146,12 +146,12 @@ __imlib_FilterCalcDiv(ImlibFilterColor * fil)
|
|||
}
|
||||
|
||||
static int
|
||||
__imlib_FilterGet(ImlibFilterColor * fil, DATA32 * data,
|
||||
__imlib_FilterGet(ImlibFilterColor * fil, uint32_t * data,
|
||||
int w, int h, int x, int y)
|
||||
{
|
||||
int i, off, ret;
|
||||
ImlibFilterPixel *pix;
|
||||
DATA32 *p;
|
||||
uint32_t *p;
|
||||
|
||||
ret = fil->cons;
|
||||
pix = fil->pixels;
|
||||
|
@ -186,9 +186,9 @@ void
|
|||
__imlib_FilterImage(ImlibImage * im, ImlibFilter * fil)
|
||||
{
|
||||
int x, y, a, r, g, b, ad, rd, gd, bd;
|
||||
DATA32 *data, *p1, *p2;
|
||||
uint32_t *data, *p1, *p2;
|
||||
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
|
|
@ -86,11 +86,11 @@ Imlib_Font_Glyph *__imlib_font_get_next_glyph(ImlibFont * fn,
|
|||
Imlib_Font_Glyph *__imlib_font_cache_glyph_get(ImlibFont * fn, FT_UInt index);
|
||||
void __imlib_render_str(ImlibImage * im, ImlibFont * f,
|
||||
int drx, int dry, const char *text,
|
||||
DATA32 pixel, int dir, double angle,
|
||||
uint32_t pixel, int dir, double angle,
|
||||
int *retw, int *reth, int blur,
|
||||
int *nextx, int *nexty, ImlibOp op,
|
||||
int clx, int cly, int clw, int clh);
|
||||
void __imlib_font_draw(ImlibImage * dst, DATA32 col,
|
||||
void __imlib_font_draw(ImlibImage * dst, uint32_t col,
|
||||
ImlibFont * fn, int x, int y,
|
||||
const char *text, int *nextx, int *nexty,
|
||||
int clx, int cly, int clw, int clh);
|
||||
|
|
|
@ -64,14 +64,14 @@ __imlib_font_cache_glyph_get(ImlibFont * fn, FT_UInt index)
|
|||
|
||||
void
|
||||
__imlib_render_str(ImlibImage * im, ImlibFont * fn, int drx, int dry,
|
||||
const char *text, DATA32 pixel, int dir, double angle,
|
||||
const char *text, uint32_t pixel, int dir, double angle,
|
||||
int *retw, int *reth, int blur,
|
||||
int *nextx, int *nexty, ImlibOp op, int clx, int cly,
|
||||
int clw, int clh)
|
||||
{
|
||||
int w, h, ascent;
|
||||
ImlibImage *im2;
|
||||
DATA32 *data;
|
||||
uint32_t *data;
|
||||
int nx, ny;
|
||||
|
||||
__imlib_font_query_advance(fn, text, &w, NULL);
|
||||
|
@ -79,7 +79,7 @@ __imlib_render_str(ImlibImage * im, ImlibFont * fn, int drx, int dry,
|
|||
|
||||
if (!IMAGE_DIMENSIONS_OK(w, h))
|
||||
return;
|
||||
data = calloc(w * h, sizeof(DATA32));
|
||||
data = calloc(w * h, sizeof(uint32_t));
|
||||
if (!data)
|
||||
return;
|
||||
/* TODO check if this is the right way of rendering. Esp for huge sizes */
|
||||
|
@ -243,14 +243,14 @@ __imlib_render_str(ImlibImage * im, ImlibFont * fn, int drx, int dry,
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_font_draw(ImlibImage * dst, DATA32 col, ImlibFont * fn, int x, int y,
|
||||
__imlib_font_draw(ImlibImage * dst, uint32_t col, ImlibFont * fn, int x, int y,
|
||||
const char *text, int *nextx, int *nexty, int clx, int cly,
|
||||
int clw, int clh)
|
||||
{
|
||||
int pen_x, pen_y;
|
||||
int chr;
|
||||
int ext_x, ext_y, ext_w, ext_h;
|
||||
DATA32 *im;
|
||||
uint32_t *im;
|
||||
int im_w, im_h;
|
||||
int lut[256];
|
||||
int ii;
|
||||
|
@ -317,7 +317,7 @@ __imlib_font_draw(ImlibImage * dst, DATA32 col, ImlibFont * fn, int x, int y,
|
|||
|
||||
if (chr_x < (ext_x + ext_w))
|
||||
{
|
||||
DATA8 *data;
|
||||
uint8_t *data;
|
||||
int i, j, w, h;
|
||||
|
||||
data = fg->glyph_out->bitmap.buffer;
|
||||
|
@ -353,9 +353,9 @@ __imlib_font_draw(ImlibImage * dst, DATA32 col, ImlibFont * fn, int x, int y,
|
|||
}
|
||||
if (in_w < w)
|
||||
{
|
||||
DATA8 *src_ptr;
|
||||
DATA32 *dst_ptr;
|
||||
DATA32 *dst_end_ptr;
|
||||
uint8_t *src_ptr;
|
||||
uint32_t *dst_ptr;
|
||||
uint32_t *dst_end_ptr;
|
||||
|
||||
src_ptr = data + (i * j) + in_x;
|
||||
dst_ptr = im + (dy * im_w) + dx;
|
||||
|
|
|
@ -42,8 +42,8 @@ __imlib_FreeRange(ImlibRange * rg)
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_AddRangeColor(ImlibRange * rg, DATA8 r, DATA8 g, DATA8 b, DATA8 a,
|
||||
int dist)
|
||||
__imlib_AddRangeColor(ImlibRange * rg, uint8_t r, uint8_t g, uint8_t b,
|
||||
uint8_t a, int dist)
|
||||
{
|
||||
ImlibRangeColor *p, *rc;
|
||||
|
||||
|
@ -79,11 +79,11 @@ __imlib_AddRangeColor(ImlibRange * rg, DATA8 r, DATA8 g, DATA8 b, DATA8 a,
|
|||
rg->color = rc;
|
||||
}
|
||||
|
||||
static DATA32 *
|
||||
static uint32_t *
|
||||
__imlib_MapRange(ImlibRange * rg, int len)
|
||||
{
|
||||
ImlibRangeColor *p;
|
||||
DATA32 *map, *pmap, v, vv;
|
||||
uint32_t *map, *pmap, v, vv;
|
||||
int r, g, b, a, rr, gg, bb, aa, i, l, ll, v1, v2, inc, j;
|
||||
|
||||
if (!rg->color)
|
||||
|
@ -93,8 +93,8 @@ __imlib_MapRange(ImlibRange * rg, int len)
|
|||
ll = 1;
|
||||
for (p = rg->color; p; p = p->next)
|
||||
ll += p->distance;
|
||||
map = malloc(len * sizeof(DATA32));
|
||||
pmap = calloc(ll, sizeof(DATA32));
|
||||
map = malloc(len * sizeof(uint32_t));
|
||||
pmap = calloc(ll, sizeof(uint32_t));
|
||||
i = 0;
|
||||
for (p = rg->color; p; p = p->next)
|
||||
{
|
||||
|
@ -150,11 +150,11 @@ __imlib_MapRange(ImlibRange * rg, int len)
|
|||
return map;
|
||||
}
|
||||
|
||||
static DATA32 *
|
||||
static uint32_t *
|
||||
__imlib_MapHsvaRange(ImlibRange * rg, int len)
|
||||
{
|
||||
ImlibRangeColor *p;
|
||||
DATA32 *map, *pmap, k, kk;
|
||||
uint32_t *map, *pmap, k, kk;
|
||||
int r, g, b, a, rr, gg, bb, aa, i, l, ll, inc, j;
|
||||
float h1, s1, v1, h2, s2, v2, h, s, v, k1, k2;
|
||||
|
||||
|
@ -165,8 +165,8 @@ __imlib_MapHsvaRange(ImlibRange * rg, int len)
|
|||
ll = 1;
|
||||
for (p = rg->color; p; p = p->next)
|
||||
ll += p->distance;
|
||||
map = malloc(len * sizeof(DATA32));
|
||||
pmap = calloc(ll, sizeof(DATA32));
|
||||
map = malloc(len * sizeof(uint32_t));
|
||||
pmap = calloc(ll, sizeof(uint32_t));
|
||||
i = 0;
|
||||
for (p = rg->color; p; p = p->next)
|
||||
{
|
||||
|
@ -235,18 +235,18 @@ __imlib_MapHsvaRange(ImlibRange * rg, int len)
|
|||
return map;
|
||||
}
|
||||
|
||||
typedef DATA32 *(ImlibRangeMapFunc) (ImlibRange * rg, int len);
|
||||
typedef uint32_t *(ImlibRangeMapFunc) (ImlibRange * rg, int len);
|
||||
|
||||
static void
|
||||
_DrawGradient(ImlibImage * im, int x, int y, int w, int h,
|
||||
ImlibRange * rg, double angle, ImlibOp op,
|
||||
int clx, int cly, int clw, int clh, ImlibRangeMapFunc * rmf)
|
||||
{
|
||||
DATA32 *map, *p;
|
||||
uint32_t *map, *p;
|
||||
int *hlut, *vlut, len;
|
||||
int xx, yy, xoff, yoff, ww, hh, jump;
|
||||
int tmp, i, divw, divh;
|
||||
DATA8 r, g, b, a;
|
||||
uint8_t r, g, b, a;
|
||||
|
||||
xoff = yoff = 0;
|
||||
ww = w;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "types.h"
|
||||
|
||||
typedef struct _ImlibRangeColor {
|
||||
DATA8 red, green, blue, alpha;
|
||||
uint8_t red, green, blue, alpha;
|
||||
int distance;
|
||||
struct _ImlibRangeColor *next;
|
||||
} ImlibRangeColor;
|
||||
|
@ -15,8 +15,8 @@ typedef struct {
|
|||
|
||||
ImlibRange *__imlib_CreateRange(void);
|
||||
void __imlib_FreeRange(ImlibRange * rg);
|
||||
void __imlib_AddRangeColor(ImlibRange * rg, DATA8 r, DATA8 g,
|
||||
DATA8 b, DATA8 a, int dist);
|
||||
void __imlib_AddRangeColor(ImlibRange * rg, uint8_t r, uint8_t g,
|
||||
uint8_t b, uint8_t a, int dist);
|
||||
void __imlib_DrawGradient(ImlibImage * im,
|
||||
int x, int y, int w, int h,
|
||||
ImlibRange * rg, double angle,
|
||||
|
|
|
@ -35,7 +35,7 @@ static ImlibImage *images = NULL;
|
|||
|
||||
static int cache_size = 4096 * 1024;
|
||||
|
||||
__EXPORT__ DATA32 *
|
||||
__EXPORT__ uint32_t *
|
||||
__imlib_AllocateData(ImlibImage * im)
|
||||
{
|
||||
int w = im->w;
|
||||
|
@ -45,9 +45,9 @@ __imlib_AllocateData(ImlibImage * im)
|
|||
return NULL;
|
||||
|
||||
if (im->data_memory_func)
|
||||
im->data = im->data_memory_func(NULL, w * h * sizeof(DATA32));
|
||||
im->data = im->data_memory_func(NULL, w * h * sizeof(uint32_t));
|
||||
else
|
||||
im->data = malloc(w * h * sizeof(DATA32));
|
||||
im->data = malloc(w * h * sizeof(uint32_t));
|
||||
|
||||
return im->data;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ __imlib_FreeData(ImlibImage * im)
|
|||
if (im->data)
|
||||
{
|
||||
if (im->data_memory_func)
|
||||
im->data_memory_func(im->data, im->w * im->h * sizeof(DATA32));
|
||||
im->data_memory_func(im->data, im->w * im->h * sizeof(uint32_t));
|
||||
else
|
||||
free(im->data);
|
||||
|
||||
|
@ -74,7 +74,7 @@ __imlib_ReplaceData(ImlibImage * im, unsigned int *new_data)
|
|||
if (im->data)
|
||||
{
|
||||
if (im->data_memory_func)
|
||||
im->data_memory_func(im->data, im->w * im->h * sizeof(DATA32));
|
||||
im->data_memory_func(im->data, im->w * im->h * sizeof(uint32_t));
|
||||
else
|
||||
free(im->data);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ __imlib_CurrentCacheSize(void)
|
|||
}
|
||||
/* it's valid but has 0 ref's - append to cache size count */
|
||||
else
|
||||
current_cache += im->w * im->h * sizeof(DATA32);
|
||||
current_cache += im->w * im->h * sizeof(uint32_t);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ __imlib_GetCacheSize(void)
|
|||
/* create a new image struct from data passed that is wize w x h then return */
|
||||
/* a pointer to that image sturct */
|
||||
ImlibImage *
|
||||
__imlib_CreateImage(int w, int h, DATA32 * data)
|
||||
__imlib_CreateImage(int w, int h, uint32_t * data)
|
||||
{
|
||||
ImlibImage *im;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef struct _ImlibImageTag {
|
|||
struct _ImlibImage {
|
||||
char *file;
|
||||
int w, h;
|
||||
DATA32 *data;
|
||||
uint32_t *data;
|
||||
ImlibImageFlags flags;
|
||||
time_t moddate;
|
||||
ImlibBorder border;
|
||||
|
@ -85,7 +85,7 @@ void __imlib_LoaderSetFormats(ImlibLoader * l,
|
|||
const char *const *fmt,
|
||||
unsigned int num);
|
||||
|
||||
ImlibImage *__imlib_CreateImage(int w, int h, DATA32 * data);
|
||||
ImlibImage *__imlib_CreateImage(int w, int h, uint32_t * data);
|
||||
ImlibImage *__imlib_LoadImage(const char *file, ImlibLoadArgs * ila);
|
||||
int __imlib_LoadEmbedded(ImlibLoader * l, ImlibImage * im,
|
||||
const char *file, int load_data);
|
||||
|
@ -95,9 +95,9 @@ void __imlib_FreeImage(ImlibImage * im);
|
|||
void __imlib_SaveImage(ImlibImage * im, const char *file,
|
||||
ImlibLoadArgs * ila);
|
||||
|
||||
DATA32 *__imlib_AllocateData(ImlibImage * im);
|
||||
uint32_t *__imlib_AllocateData(ImlibImage * im);
|
||||
void __imlib_FreeData(ImlibImage * im);
|
||||
void __imlib_ReplaceData(ImlibImage * im, DATA32 * new_data);
|
||||
void __imlib_ReplaceData(ImlibImage * im, uint32_t * new_data);
|
||||
|
||||
void __imlib_LoadProgressSetPass(ImlibImage * im,
|
||||
int pass, int n_pass);
|
||||
|
@ -135,7 +135,7 @@ int __imlib_CurrentCacheSize(void);
|
|||
#define LOAD_BADFRAME -4 /* Requested frame not found */
|
||||
|
||||
/* 32767 is the maximum pixmap dimension and ensures that
|
||||
* (w * h * sizeof(DATA32)) won't exceed ULONG_MAX */
|
||||
* (w * h * sizeof(uint32_t)) won't exceed ULONG_MAX */
|
||||
#define X_MAX_DIM 32767
|
||||
/* NB! The image dimensions are sometimes used in (dim << 16) like expressions
|
||||
* so great care must be taken if ever it is attempted to change this
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
void
|
||||
__imlib_FlipImageHoriz(ImlibImage * im)
|
||||
{
|
||||
DATA32 *p1, *p2, tmp;
|
||||
uint32_t *p1, *p2, tmp;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < im->h; y++)
|
||||
|
@ -33,7 +33,7 @@ __imlib_FlipImageHoriz(ImlibImage * im)
|
|||
void
|
||||
__imlib_FlipImageVert(ImlibImage * im)
|
||||
{
|
||||
DATA32 *p1, *p2, tmp;
|
||||
uint32_t *p1, *p2, tmp;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < (im->h >> 1); y++)
|
||||
|
@ -57,7 +57,7 @@ __imlib_FlipImageVert(ImlibImage * im)
|
|||
void
|
||||
__imlib_FlipImageBoth(ImlibImage * im)
|
||||
{
|
||||
DATA32 *p1, *p2, tmp;
|
||||
uint32_t *p1, *p2, tmp;
|
||||
int x;
|
||||
|
||||
p1 = im->data;
|
||||
|
@ -87,10 +87,10 @@ __imlib_FlipImageBoth(ImlibImage * im)
|
|||
void
|
||||
__imlib_FlipImageDiagonal(ImlibImage * im, int direction)
|
||||
{
|
||||
DATA32 *data, *to, *from;
|
||||
uint32_t *data, *to, *from;
|
||||
int x, y, w, hw, tmp;
|
||||
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
w = im->h;
|
||||
im->h = im->w;
|
||||
im->w = w;
|
||||
|
@ -157,14 +157,14 @@ __imlib_FlipImageDiagonal(ImlibImage * im, int direction)
|
|||
void
|
||||
__imlib_BlurImage(ImlibImage * im, int rad)
|
||||
{
|
||||
DATA32 *p1, *p2, *data;
|
||||
uint32_t *p1, *p2, *data;
|
||||
int x, y, mx, my, mw, mh, mt, xx, yy;
|
||||
int a, r, g, b;
|
||||
int *as, *rs, *gs, *bs;
|
||||
|
||||
if (rad < 1)
|
||||
return;
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
as = malloc(sizeof(int) * im->w);
|
||||
rs = malloc(sizeof(int) * im->w);
|
||||
gs = malloc(sizeof(int) * im->w);
|
||||
|
@ -247,13 +247,13 @@ __imlib_BlurImage(ImlibImage * im, int rad)
|
|||
void
|
||||
__imlib_SharpenImage(ImlibImage * im, int rad)
|
||||
{
|
||||
DATA32 *data, *p1, *p2;
|
||||
uint32_t *data, *p1, *p2;
|
||||
int a, r, g, b, x, y;
|
||||
|
||||
if (rad == 0)
|
||||
return;
|
||||
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
@ -305,11 +305,11 @@ __imlib_SharpenImage(ImlibImage * im, int rad)
|
|||
void
|
||||
__imlib_TileImageHoriz(ImlibImage * im)
|
||||
{
|
||||
DATA32 *p1, *p2, *p3, *p, *data;
|
||||
uint32_t *p1, *p2, *p3, *p, *data;
|
||||
int x, y, per, tmp, na, nr, ng, nb, mix, a, r, g, b, aa, rr,
|
||||
gg, bb;
|
||||
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
p1 = im->data;
|
||||
p = data;
|
||||
for (y = 0; y < im->h; y++)
|
||||
|
@ -378,11 +378,11 @@ __imlib_TileImageHoriz(ImlibImage * im)
|
|||
void
|
||||
__imlib_TileImageVert(ImlibImage * im)
|
||||
{
|
||||
DATA32 *p1, *p2, *p, *data;
|
||||
uint32_t *p1, *p2, *p, *data;
|
||||
int x, y, tmp, na, nr, ng, nb, mix, a, r, g, b, aa, rr, gg,
|
||||
bb;
|
||||
|
||||
data = malloc(im->w * im->h * sizeof(DATA32));
|
||||
data = malloc(im->w * im->h * sizeof(uint32_t));
|
||||
p = data;
|
||||
for (y = 0; y < im->h; y++)
|
||||
{
|
||||
|
@ -431,7 +431,7 @@ __imlib_copy_image_data(ImlibImage * im, int x, int y, int w, int h, int nx,
|
|||
int ny)
|
||||
{
|
||||
int xx, yy, jump;
|
||||
DATA32 *p1, *p2;
|
||||
uint32_t *p1, *p2;
|
||||
|
||||
/* clip horizontal co-ordinates so that both dest and src fit inside */
|
||||
/* the image */
|
||||
|
@ -533,7 +533,7 @@ __imlib_copy_alpha_data(ImlibImage * src, ImlibImage * dst, int x, int y,
|
|||
int w, int h, int nx, int ny)
|
||||
{
|
||||
int xx, yy, jump, jump2;
|
||||
DATA32 *p1, *p2;
|
||||
uint32_t *p1, *p2;
|
||||
|
||||
/* clip horizontal co-ordinates so that both dest and src fit inside */
|
||||
/* the image */
|
||||
|
|
|
@ -57,7 +57,7 @@ void __imlib_copy_image_data(ImlibImage * im, int x, int y,
|
|||
|
||||
/* point and line drawing: in line.c */
|
||||
|
||||
ImlibUpdate *__imlib_Point_DrawToImage(int x, int y, DATA32 color,
|
||||
ImlibUpdate *__imlib_Point_DrawToImage(int x, int y, uint32_t color,
|
||||
ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
|
@ -65,7 +65,7 @@ ImlibUpdate *__imlib_Point_DrawToImage(int x, int y, DATA32 color,
|
|||
char make_updates);
|
||||
|
||||
ImlibUpdate *__imlib_Line_DrawToImage(int x0, int y0, int x1, int y1,
|
||||
DATA32 color, ImlibImage * im,
|
||||
uint32_t color, ImlibImage * im,
|
||||
int clx, int cly, int clw, int clh,
|
||||
ImlibOp op, char blend,
|
||||
char anti_alias,
|
||||
|
@ -74,28 +74,28 @@ ImlibUpdate *__imlib_Line_DrawToImage(int x0, int y0, int x1, int y1,
|
|||
/* rectangle drawing and filling: in rectangle.c */
|
||||
|
||||
void __imlib_Rectangle_DrawToImage(int xc, int yc, int w, int h,
|
||||
DATA32 color, ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
uint32_t color,
|
||||
ImlibImage * im, int clx,
|
||||
int cly, int clw, int clh,
|
||||
ImlibOp op, char blend);
|
||||
|
||||
void __imlib_Rectangle_FillToImage(int xc, int yc, int w, int h,
|
||||
DATA32 color, ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
uint32_t color,
|
||||
ImlibImage * im, int clx,
|
||||
int cly, int clw, int clh,
|
||||
ImlibOp op, char blend);
|
||||
|
||||
/* ellipse drawing and filling: in ellipse.c */
|
||||
|
||||
void __imlib_Ellipse_DrawToImage(int xc, int yc, int a, int b,
|
||||
DATA32 color, ImlibImage * im,
|
||||
uint32_t color, ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
ImlibOp op, char blend,
|
||||
char anti_alias);
|
||||
|
||||
void __imlib_Ellipse_FillToImage(int xc, int yc, int a, int b,
|
||||
DATA32 color, ImlibImage * im,
|
||||
uint32_t color, ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
ImlibOp op, char blend,
|
||||
|
@ -115,16 +115,15 @@ void __imlib_polygon_get_bounds(ImlibPoly * poly,
|
|||
/* polygon drawing and filling: in polygon.c */
|
||||
|
||||
void __imlib_Polygon_DrawToImage(ImlibPoly * poly, char closed,
|
||||
DATA32 color, ImlibImage * im,
|
||||
uint32_t color, ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
ImlibOp op, char blend,
|
||||
char anti_alias);
|
||||
void __imlib_Polygon_FillToImage(ImlibPoly * poly, DATA32 color,
|
||||
ImlibImage * im,
|
||||
int clx, int cly,
|
||||
int clw, int clh,
|
||||
ImlibOp op, char blend,
|
||||
void __imlib_Polygon_FillToImage(ImlibPoly * poly,
|
||||
uint32_t color, ImlibImage * im,
|
||||
int clx, int cly, int clw,
|
||||
int clh, ImlibOp op, char blend,
|
||||
char anti_alias);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
/*\ Rotate by pixel sampling only, target inside source \*/
|
||||
static void
|
||||
__imlib_RotateSampleInside(DATA32 * src, DATA32 * dest, int sow, int dow,
|
||||
__imlib_RotateSampleInside(uint32_t * src, uint32_t * dest, int sow, int dow,
|
||||
int dw, int dh, int x, int y,
|
||||
int dxh, int dyh, int dxv, int dyv)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ __imlib_RotateSampleInside(DATA32 * src, DATA32 * dest, int sow, int dow,
|
|||
|
||||
/*\ Same as last function, but with antialiasing \*/
|
||||
static void
|
||||
__imlib_RotateAAInside(DATA32 * src, DATA32 * dest, int sow, int dow,
|
||||
__imlib_RotateAAInside(uint32_t * src, uint32_t * dest, int sow, int dow,
|
||||
int dw, int dh, int x, int y,
|
||||
int dxh, int dyh, int dxv, int dyv)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ __imlib_RotateAAInside(DATA32 * src, DATA32 * dest, int sow, int dow,
|
|||
i = dw - 1;
|
||||
do
|
||||
{
|
||||
DATA32 *src_x_y = (src + (x >> _ROTATE_PREC) +
|
||||
uint32_t *src_x_y = (src + (x >> _ROTATE_PREC) +
|
||||
((y >> _ROTATE_PREC) * sow));
|
||||
INTERP_ARGB(dest, src_x_y, sow, x, y);
|
||||
/*\ RIGHT; \ */
|
||||
|
@ -153,7 +153,7 @@ __check_inside_coords(int x, int y, int dxh, int dyh, int dxv, int dyv,
|
|||
|
||||
/*\ These ones don't need the target to be inside the source \*/
|
||||
void
|
||||
__imlib_RotateSample(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
|
||||
__imlib_RotateSample(uint32_t * src, uint32_t * dest, int sow, int sw, int sh,
|
||||
int dow, int dw, int dh, int x, int y,
|
||||
int dxh, int dyh, int dxv, int dyv)
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ __imlib_RotateSample(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
|
|||
|*| the bounding box.
|
||||
\*/
|
||||
void
|
||||
__imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
|
||||
__imlib_RotateAA(uint32_t * src, uint32_t * dest, int sow, int sw, int sh,
|
||||
int dow, int dw, int dh, int x, int y,
|
||||
int dxh, int dyh, int dxv, int dyv)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ __imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
|
|||
i = dw - 1;
|
||||
do
|
||||
{
|
||||
DATA32 *src_x_y = (src + (x >> _ROTATE_PREC) +
|
||||
uint32_t *src_x_y = (src + (x >> _ROTATE_PREC) +
|
||||
((y >> _ROTATE_PREC) * sow));
|
||||
if ((unsigned)x < (unsigned)sw)
|
||||
{
|
||||
|
@ -355,7 +355,7 @@ __imlib_BlendImageToImageSkewed(ImlibImage * im_src, ImlibImage * im_dst,
|
|||
{
|
||||
int x, y, dxh, dyh, dxv, dyv, i;
|
||||
double xy2;
|
||||
DATA32 *data, *src;
|
||||
uint32_t *data, *src;
|
||||
|
||||
if ((ssw < 0) || (ssh < 0))
|
||||
return;
|
||||
|
@ -411,7 +411,7 @@ __imlib_BlendImageToImageSkewed(ImlibImage * im_src, ImlibImage * im_dst,
|
|||
ssh = im_src->h - ssy;
|
||||
|
||||
src = im_src->data + ssx + ssy * im_src->w;
|
||||
data = malloc(im_dst->w * LINESIZE * sizeof(DATA32));
|
||||
data = malloc(im_dst->w * LINESIZE * sizeof(uint32_t));
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
#define _ROTATE_PREC_MAX (1 << _ROTATE_PREC)
|
||||
#define _ROTATE_PREC_BITS (_ROTATE_PREC_MAX - 1)
|
||||
|
||||
void __imlib_RotateSample(DATA32 * src, DATA32 * dest,
|
||||
void __imlib_RotateSample(uint32_t * src, uint32_t * dest,
|
||||
int sow, int sw, int sh,
|
||||
int dow, int dw, int dh,
|
||||
int x, int y,
|
||||
int dxh, int dyh, int dxv, int dyv);
|
||||
void __imlib_RotateAA(DATA32 * src, DATA32 * dest,
|
||||
void __imlib_RotateAA(uint32_t * src, uint32_t * dest,
|
||||
int sow, int sw, int sh,
|
||||
int dow, int dw, int dh,
|
||||
int x, int y, int dx, int dy,
|
||||
|
@ -33,9 +33,9 @@ void __imlib_BlendImageToImageSkewed(ImlibImage * im_src,
|
|||
int clw, int clh);
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
void __imlib_mmx_RotateAA(DATA32 * src, DATA32 * dest, int sow,
|
||||
int sw, int sh, int dow, int dw,
|
||||
int dh, int x, int y, int dx, int dy,
|
||||
int dxv, int dyv);
|
||||
void __imlib_mmx_RotateAA(uint32_t * src, uint32_t * dest,
|
||||
int sow, int sw, int sh, int dow,
|
||||
int dw, int dh, int x, int y, int dx,
|
||||
int dy, int dxv, int dyv);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
/*\ NB: If you change this, don't forget asm_scale.S \*/
|
||||
struct _imlib_scale_info {
|
||||
int *xpoints;
|
||||
DATA32 **ypoints;
|
||||
uint32_t **ypoints;
|
||||
int *xapoints, *yapoints;
|
||||
int xup_yup;
|
||||
DATA32 *pix_assert;
|
||||
uint32_t *pix_assert;
|
||||
};
|
||||
|
||||
#define INV_XAP (256 - xapoints[x])
|
||||
|
@ -22,10 +22,10 @@ struct _imlib_scale_info {
|
|||
#define INV_YAP (256 - yapoints[dyy + y])
|
||||
#define YAP (yapoints[dyy + y])
|
||||
|
||||
static DATA32 **
|
||||
__imlib_CalcYPoints(DATA32 * src, int sw, int sh, int dh, int b1, int b2)
|
||||
static uint32_t **
|
||||
__imlib_CalcYPoints(uint32_t * src, int sw, int sh, int dh, int b1, int b2)
|
||||
{
|
||||
DATA32 **p;
|
||||
uint32_t **p;
|
||||
int i, j = 0;
|
||||
int val, inc, rv = 0;
|
||||
|
||||
|
@ -35,7 +35,7 @@ __imlib_CalcYPoints(DATA32 * src, int sw, int sh, int dh, int b1, int b2)
|
|||
rv = 1;
|
||||
}
|
||||
|
||||
p = malloc((dh + 1) * sizeof(DATA32 *));
|
||||
p = malloc((dh + 1) * sizeof(uint32_t *));
|
||||
|
||||
val = MIN(sh, dh);
|
||||
inc = b1 + b2;
|
||||
|
@ -73,7 +73,7 @@ __imlib_CalcYPoints(DATA32 * src, int sw, int sh, int dh, int b1, int b2)
|
|||
if (rv)
|
||||
for (i = dh / 2; --i >= 0;)
|
||||
{
|
||||
DATA32 *tmp = p[i];
|
||||
uint32_t *tmp = p[i];
|
||||
|
||||
p[i] = p[dh - i - 1];
|
||||
p[dh - i - 1] = tmp;
|
||||
|
@ -281,12 +281,12 @@ __imlib_CalcScaleInfo(ImlibImage * im, int sw, int sh, int dw, int dh, char aa)
|
|||
|
||||
/* scale by pixel sampling only */
|
||||
void
|
||||
__imlib_ScaleSampleRGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
||||
__imlib_ScaleSampleRGBA(ImlibScaleInfo * isi, uint32_t * dest, int dxx, int dyy,
|
||||
int dx, int dy, int dw, int dh, int dow)
|
||||
{
|
||||
DATA32 *sptr, *dptr;
|
||||
uint32_t *sptr, *dptr;
|
||||
int x, y, end;
|
||||
DATA32 **ypoints = isi->ypoints;
|
||||
uint32_t **ypoints = isi->ypoints;
|
||||
int *xpoints = isi->xpoints;
|
||||
|
||||
/* whats the last pixel on the line so we stop there */
|
||||
|
@ -308,12 +308,12 @@ __imlib_ScaleSampleRGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
|
||||
/* scale by area sampling */
|
||||
void
|
||||
__imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
||||
__imlib_ScaleAARGBA(ImlibScaleInfo * isi, uint32_t * dest, int dxx, int dyy,
|
||||
int dx, int dy, int dw, int dh, int dow, int sow)
|
||||
{
|
||||
DATA32 *sptr, *dptr;
|
||||
uint32_t *sptr, *dptr;
|
||||
int x, y, end;
|
||||
DATA32 **ypoints;
|
||||
uint32_t **ypoints;
|
||||
int *xpoints;
|
||||
int *xapoints;
|
||||
int *yapoints;
|
||||
|
@ -347,7 +347,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r, g, b, a;
|
||||
int rr, gg, bb, aa;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
for (x = dxx; x < end; x++)
|
||||
{
|
||||
int r, g, b, a;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -434,7 +434,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
/*\ 'Correct' version, with math units prepared for MMXification \ */
|
||||
int Cy, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b, a, rr, gg, bb, aa;
|
||||
int yap;
|
||||
|
||||
|
@ -532,7 +532,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0, a = 0;
|
||||
int rr = 0, gg = 0, bb = 0, aa = 0;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -584,7 +584,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0, a = 0;
|
||||
int count;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -617,7 +617,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
/*\ 'Correct' version, with math units prepared for MMXification \ */
|
||||
int Cx, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b, a, rr, gg, bb, aa;
|
||||
int xap;
|
||||
|
||||
|
@ -712,7 +712,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
int r = 0, g = 0, b = 0, a = 0;
|
||||
int rr = 0, gg = 0, bb = 0, aa = 0;
|
||||
int xap;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
xap = xpoints[x + 1] - xpoints[x];
|
||||
if (xap > 1)
|
||||
|
@ -769,7 +769,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0, a = 0;
|
||||
int xap;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
xap = xpoints[x + 1] - xpoints[x];
|
||||
if (xap > 1)
|
||||
|
@ -805,7 +805,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
* |*| psllw (16 - d), %mmb; pmulh %mmc, %mmb
|
||||
* \ */
|
||||
int Cx, Cy, i, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int a, r, g, b, ax, rx, gx, bx;
|
||||
int xap, yap;
|
||||
|
||||
|
@ -920,7 +920,7 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
#else
|
||||
{
|
||||
int count;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int a, r, g, b;
|
||||
|
||||
/* go through every scanline in the output buffer */
|
||||
|
@ -969,12 +969,12 @@ __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
|
||||
/* scale by area sampling - IGNORE the ALPHA byte*/
|
||||
void
|
||||
__imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
||||
__imlib_ScaleAARGB(ImlibScaleInfo * isi, uint32_t * dest, int dxx, int dyy,
|
||||
int dx, int dy, int dw, int dh, int dow, int sow)
|
||||
{
|
||||
DATA32 *sptr, *dptr;
|
||||
uint32_t *sptr, *dptr;
|
||||
int x, y, end;
|
||||
DATA32 **ypoints;
|
||||
uint32_t **ypoints;
|
||||
int *xpoints;
|
||||
int *xapoints;
|
||||
int *yapoints;
|
||||
|
@ -1008,7 +1008,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0;
|
||||
int rr = 0, gg = 0, bb = 0;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -1055,7 +1055,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
for (x = dxx; x < end; x++)
|
||||
{
|
||||
int r = 0, g = 0, b = 0;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -1084,7 +1084,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
/*\ 'Correct' version, with math units prepared for MMXification \ */
|
||||
int Cy, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b, rr, gg, bb;
|
||||
int yap;
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0;
|
||||
int rr = 0, gg = 0, bb = 0;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -1216,7 +1216,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
for (x = dxx; x < end; x++)
|
||||
{
|
||||
int r = 0, g = 0, b = 0;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
if (XAP > 0)
|
||||
{
|
||||
|
@ -1246,7 +1246,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
/*\ 'Correct' version, with math units prepared for MMXification \ */
|
||||
int Cx, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b, rr, gg, bb;
|
||||
int xap;
|
||||
|
||||
|
@ -1330,7 +1330,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
int r = 0, g = 0, b = 0;
|
||||
int rr = 0, gg = 0, bb = 0;
|
||||
int xap;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
xap = xpoints[x + 1] - xpoints[x];
|
||||
if (xap > 1)
|
||||
|
@ -1380,7 +1380,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
int r = 0, g = 0, b = 0;
|
||||
int xap;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
|
||||
xap = xpoints[x + 1] - xpoints[x];
|
||||
if (xap > 1)
|
||||
|
@ -1411,7 +1411,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
{
|
||||
/*\ 'Correct' version, with math units prepared for MMXification \ */
|
||||
int Cx, Cy, i, j;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b, rx, gx, bx;
|
||||
int xap, yap;
|
||||
|
||||
|
@ -1513,7 +1513,7 @@ __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest, int dxx, int dyy,
|
|||
#else
|
||||
{
|
||||
int count;
|
||||
DATA32 *pix;
|
||||
uint32_t *pix;
|
||||
int r, g, b;
|
||||
|
||||
/* go through every scanline in the output buffer */
|
||||
|
|
|
@ -9,19 +9,20 @@ ImlibScaleInfo *__imlib_CalcScaleInfo(ImlibImage * im,
|
|||
int sw, int sh,
|
||||
int dw, int dh, char aa);
|
||||
ImlibScaleInfo *__imlib_FreeScaleInfo(ImlibScaleInfo * isi);
|
||||
void __imlib_ScaleSampleRGBA(ImlibScaleInfo * isi, DATA32 * dest,
|
||||
int dxx, int dyy, int dx, int dy,
|
||||
int dw, int dh, int dow);
|
||||
void __imlib_ScaleAARGBA(ImlibScaleInfo * isi, DATA32 * dest,
|
||||
void __imlib_ScaleSampleRGBA(ImlibScaleInfo * isi,
|
||||
uint32_t * dest, int dxx, int dyy,
|
||||
int dx, int dy, int dw, int dh,
|
||||
int dow);
|
||||
void __imlib_ScaleAARGBA(ImlibScaleInfo * isi, uint32_t * dest,
|
||||
int dxx, int dyy, int dx, int dy,
|
||||
int dw, int dh, int dow, int sow);
|
||||
void __imlib_ScaleAARGB(ImlibScaleInfo * isi, DATA32 * dest,
|
||||
int dxx, int dyy, int dx, int dy,
|
||||
int dw, int dh, int dow, int sow);
|
||||
void __imlib_ScaleAARGB(ImlibScaleInfo * isi, uint32_t * dest,
|
||||
int dxx, int dyy, int dx, int dy, int dw,
|
||||
int dh, int dow, int sow);
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
void __imlib_Scale_mmx_AARGBA(ImlibScaleInfo * isi,
|
||||
DATA32 * dest,
|
||||
uint32_t * dest,
|
||||
int dxx, int dyy, int dx, int dy,
|
||||
int dw, int dh, int dow, int sow);
|
||||
#endif
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define VAR_CHAR 1
|
||||
#define VAR_PTR 2
|
||||
|
||||
#define ASSIGN_DATA8( var, v ) if( strcmp( ptr->key, var ) == 0 ) v = (DATA8)atoi( (char *)ptr->data )
|
||||
#define ASSIGN_uint8_t( var, v ) if( strcmp( ptr->key, var ) == 0 ) v = (uint8_t)atoi( (char *)ptr->data )
|
||||
#define ASSIGN_INT(k, v) \
|
||||
if (!strcmp((k), ptr->key)) { \
|
||||
if (ptr->type == VAR_PTR) { \
|
||||
|
|
257
src/lib/span.c
257
src/lib/span.c
|
@ -32,37 +32,37 @@ do { \
|
|||
na = (tmp + (tmp >> 8)) >> 8; \
|
||||
} while (0)
|
||||
|
||||
extern DATA8 pow_lut[256][256];
|
||||
extern uint8_t pow_lut[256][256];
|
||||
|
||||
/* point drawing functions */
|
||||
|
||||
/* COPY OPS */
|
||||
|
||||
static void
|
||||
__imlib_CopyToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_CopyToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
*dst = color;
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_CopyToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
*dst = (*dst & 0xff000000) | (color & 0x00ffffff);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_BlendToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_BlendToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -72,35 +72,35 @@ __imlib_BlendToRGBA(DATA32 color, DATA32 * dst)
|
|||
/* ADD OPS */
|
||||
|
||||
static void
|
||||
__imlib_AddCopyToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_AddCopyToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
ADD_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_AddCopyToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
ADD_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_AddBlendToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_ADD(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_AddBlendToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -110,35 +110,35 @@ __imlib_AddBlendToRGBA(DATA32 color, DATA32 * dst)
|
|||
/* SUBTRACT OPS */
|
||||
|
||||
static void
|
||||
__imlib_SubCopyToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_SubCopyToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
SUB_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_SubCopyToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
SUB_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_SubBlendToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_SUB(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_SubBlendToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -148,35 +148,35 @@ __imlib_SubBlendToRGBA(DATA32 color, DATA32 * dst)
|
|||
/* RESHADE OPS */
|
||||
|
||||
static void
|
||||
__imlib_ReCopyToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_ReCopyToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
RE_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_ReCopyToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
RE_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendToRGB(DATA32 color, DATA32 * dst)
|
||||
__imlib_ReBlendToRGB(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_RE(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color), dst);
|
||||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendToRGBA(DATA32 color, DATA32 * dst)
|
||||
__imlib_ReBlendToRGBA(uint32_t color, uint32_t * dst)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -188,7 +188,7 @@ __imlib_ReBlendToRGBA(DATA32 color, DATA32 * dst)
|
|||
/* COPY OPS */
|
||||
|
||||
static void
|
||||
__imlib_CopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_CopySpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
|
@ -198,7 +198,7 @@ __imlib_CopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_CopySpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
|
@ -208,11 +208,11 @@ __imlib_CopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_BlendSpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color), dst);
|
||||
dst++;
|
||||
|
@ -220,12 +220,12 @@ __imlib_BlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_BlendSpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -237,11 +237,11 @@ __imlib_BlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
/* ADD OPS */
|
||||
|
||||
static void
|
||||
__imlib_AddCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_AddCopySpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
ADD_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
|
@ -250,11 +250,11 @@ __imlib_AddCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_AddCopySpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
ADD_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
dst++;
|
||||
|
@ -262,11 +262,11 @@ __imlib_AddCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_AddBlendSpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_ADD(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color),
|
||||
dst);
|
||||
|
@ -275,12 +275,12 @@ __imlib_AddBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_AddBlendSpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -292,11 +292,11 @@ __imlib_AddBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
/* SUBTRACT OPS */
|
||||
|
||||
static void
|
||||
__imlib_SubCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_SubCopySpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
SUB_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
|
@ -305,11 +305,11 @@ __imlib_SubCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_SubCopySpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
SUB_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
dst++;
|
||||
|
@ -317,11 +317,11 @@ __imlib_SubCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_SubBlendSpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_SUB(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color),
|
||||
dst);
|
||||
|
@ -330,12 +330,12 @@ __imlib_SubBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_SubBlendSpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -347,11 +347,11 @@ __imlib_SubBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
/* RESHADE OPS */
|
||||
|
||||
static void
|
||||
__imlib_ReCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReCopySpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
A_VAL(dst) = A_VAL(&color);
|
||||
RE_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
|
@ -360,11 +360,11 @@ __imlib_ReCopySpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReCopySpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
RE_COPY(R_VAL(&color), G_VAL(&color), B_VAL(&color), dst);
|
||||
dst++;
|
||||
|
@ -372,11 +372,11 @@ __imlib_ReCopySpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReBlendSpanToRGB(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
BLEND_RE(R_VAL(&color), G_VAL(&color), B_VAL(&color), A_VAL(&color),
|
||||
dst);
|
||||
|
@ -385,12 +385,12 @@ __imlib_ReBlendSpanToRGB(DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReBlendSpanToRGBA(uint32_t color, uint32_t * dst, int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
a = pow_lut[A_VAL(&color)][A_VAL(dst)];
|
||||
BLEND_COLOR(A_VAL(&color), A_VAL(dst), 255, A_VAL(dst));
|
||||
|
@ -404,15 +404,16 @@ __imlib_ReBlendSpanToRGBA(DATA32 color, DATA32 * dst, int len)
|
|||
/* COPY OPS */
|
||||
|
||||
static void
|
||||
__imlib_CopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_CopyShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
DATA32 col = color;
|
||||
uint32_t col = color;
|
||||
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -460,7 +461,8 @@ __imlib_CopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_CopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_CopyShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
|
@ -473,14 +475,15 @@ __imlib_CopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_BlendShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -507,7 +510,7 @@ __imlib_BlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -530,14 +533,15 @@ __imlib_BlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_BlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_BlendShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -567,8 +571,8 @@ __imlib_BlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -595,14 +599,14 @@ __imlib_BlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
/* ADD OPS */
|
||||
|
||||
static void
|
||||
__imlib_AddCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_AddCopyShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -629,7 +633,7 @@ __imlib_AddCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -642,11 +646,12 @@ __imlib_AddCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_AddCopyShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -659,15 +664,15 @@ __imlib_AddCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_AddBlendShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -695,7 +700,7 @@ __imlib_AddBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -719,15 +724,15 @@ __imlib_AddBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_AddBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_AddBlendShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -759,8 +764,8 @@ __imlib_AddBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -788,14 +793,14 @@ __imlib_AddBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
/* SUBTRACT OPS */
|
||||
|
||||
static void
|
||||
__imlib_SubCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_SubCopyShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -822,7 +827,7 @@ __imlib_SubCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -835,11 +840,12 @@ __imlib_SubCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_SubCopyShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -852,15 +858,15 @@ __imlib_SubCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_SubBlendShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -888,7 +894,7 @@ __imlib_SubBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -912,15 +918,15 @@ __imlib_SubBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_SubBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_SubBlendShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -952,8 +958,8 @@ __imlib_SubBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -981,13 +987,14 @@ __imlib_SubBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
/* RESHADE OPS */
|
||||
|
||||
static void
|
||||
__imlib_ReCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReCopyShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -1014,7 +1021,7 @@ __imlib_ReCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -1027,11 +1034,12 @@ __imlib_ReCopyShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReCopyShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
if (*src)
|
||||
{
|
||||
|
@ -1044,14 +1052,15 @@ __imlib_ReCopyShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
||||
__imlib_ReBlendShapedSpanToRGB(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -1079,7 +1088,7 @@ __imlib_ReBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -1103,15 +1112,15 @@ __imlib_ReBlendShapedSpanToRGB(DATA8 * src, DATA32 color, DATA32 * dst, int len)
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_ReBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
||||
__imlib_ReBlendShapedSpanToRGBA(uint8_t * src, uint32_t color, uint32_t * dst,
|
||||
int len)
|
||||
{
|
||||
if (A_VAL(&color) < 255)
|
||||
{
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a, aa;
|
||||
uint32_t tmp;
|
||||
uint8_t a, aa;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
@ -1143,8 +1152,8 @@ __imlib_ReBlendShapedSpanToRGBA(DATA8 * src, DATA32 color, DATA32 * dst,
|
|||
|
||||
while (len--)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
uint32_t tmp;
|
||||
uint8_t a;
|
||||
|
||||
switch (*src)
|
||||
{
|
||||
|
|
|
@ -3,18 +3,18 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
typedef void (*ImlibPointDrawFunction)(DATA32, DATA32 *);
|
||||
typedef void (*ImlibPointDrawFunction)(uint32_t, uint32_t *);
|
||||
|
||||
ImlibPointDrawFunction
|
||||
__imlib_GetPointDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
||||
typedef void (*ImlibSpanDrawFunction)(DATA32, DATA32 *, int);
|
||||
typedef void (*ImlibSpanDrawFunction)(uint32_t, uint32_t *, int);
|
||||
|
||||
ImlibSpanDrawFunction
|
||||
__imlib_GetSpanDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
||||
typedef void (*ImlibShapedSpanDrawFunction)(DATA8 *, DATA32, DATA32 *,
|
||||
int);
|
||||
typedef void (*ImlibShapedSpanDrawFunction)(uint8_t *, uint32_t,
|
||||
uint32_t *, int);
|
||||
|
||||
ImlibShapedSpanDrawFunction
|
||||
__imlib_GetShapedSpanDrawFunction(ImlibOp op, char dst_alpha, char blend);
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
#ifndef TYPES_H
|
||||
#define TYPES_H 1
|
||||
|
||||
#define DATABIG unsigned long long
|
||||
#define DATA64 unsigned long long
|
||||
#define DATA32 unsigned int
|
||||
#define DATA16 unsigned short
|
||||
#define DATA8 unsigned char
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct _ImlibLoader ImlibLoader;
|
||||
|
||||
|
|
|
@ -70,18 +70,18 @@ __imlib_BestVisual(Display * d, int screen, int *depth_return)
|
|||
return v;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors332(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(256 * sizeof(DATA8));
|
||||
color_lut = malloc(256 * sizeof(uint8_t));
|
||||
for (r = 0; r < 8; r++)
|
||||
{
|
||||
for (g = 0; g < 8; g++)
|
||||
|
@ -126,18 +126,18 @@ __imlib_AllocColors332(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors666(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(256 * sizeof(DATA8));
|
||||
color_lut = malloc(256 * sizeof(uint8_t));
|
||||
for (r = 0; r < 6; r++)
|
||||
{
|
||||
for (g = 0; g < 6; g++)
|
||||
|
@ -182,18 +182,18 @@ __imlib_AllocColors666(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors232(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(128 * sizeof(DATA8));
|
||||
color_lut = malloc(128 * sizeof(uint8_t));
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (g = 0; g < 8; g++)
|
||||
|
@ -238,18 +238,18 @@ __imlib_AllocColors232(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors222(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(64 * sizeof(DATA8));
|
||||
color_lut = malloc(64 * sizeof(uint8_t));
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (g = 0; g < 4; g++)
|
||||
|
@ -294,18 +294,18 @@ __imlib_AllocColors222(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors221(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(32 * sizeof(DATA8));
|
||||
color_lut = malloc(32 * sizeof(uint8_t));
|
||||
for (r = 0; r < 4; r++)
|
||||
{
|
||||
for (g = 0; g < 4; g++)
|
||||
|
@ -351,18 +351,18 @@ __imlib_AllocColors221(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors121(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(16 * sizeof(DATA8));
|
||||
color_lut = malloc(16 * sizeof(uint8_t));
|
||||
for (r = 0; r < 2; r++)
|
||||
{
|
||||
for (g = 0; g < 4; g++)
|
||||
|
@ -409,18 +409,18 @@ __imlib_AllocColors121(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors111(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
int r, g, b, i;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
int sig_mask = 0;
|
||||
|
||||
for (i = 0; i < v->bits_per_rgb; i++)
|
||||
sig_mask |= (0x1 << i);
|
||||
sig_mask <<= (16 - v->bits_per_rgb);
|
||||
i = 0;
|
||||
color_lut = malloc(8 * sizeof(DATA8));
|
||||
color_lut = malloc(8 * sizeof(uint8_t));
|
||||
for (r = 0; r < 2; r++)
|
||||
{
|
||||
for (g = 0; g < 2; g++)
|
||||
|
@ -468,13 +468,13 @@ __imlib_AllocColors111(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
static DATA8 *
|
||||
static uint8_t *
|
||||
__imlib_AllocColors1(Display * d, Colormap cmap, Visual * v)
|
||||
{
|
||||
XColor xcl;
|
||||
DATA8 *color_lut;
|
||||
uint8_t *color_lut;
|
||||
|
||||
color_lut = malloc(2 * sizeof(DATA8));
|
||||
color_lut = malloc(2 * sizeof(uint8_t));
|
||||
xcl.red = (unsigned short)(0x0000);
|
||||
xcl.green = (unsigned short)(0x0000);
|
||||
xcl.blue = (unsigned short)(0x0000);
|
||||
|
@ -488,11 +488,11 @@ __imlib_AllocColors1(Display * d, Colormap cmap, Visual * v)
|
|||
return color_lut;
|
||||
}
|
||||
|
||||
DATA8 *
|
||||
uint8_t *
|
||||
__imlib_AllocColorTable(Display * d, Colormap cmap,
|
||||
unsigned char *type_return, Visual * v)
|
||||
{
|
||||
DATA8 *color_lut = NULL;
|
||||
uint8_t *color_lut = NULL;
|
||||
|
||||
if (v->bits_per_rgb > 1)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ int __imlib_XActualDepth(Display * d, Visual * v);
|
|||
Visual *__imlib_BestVisual(Display * d, int screen,
|
||||
int *depth_return);
|
||||
|
||||
DATA8 *__imlib_AllocColorTable(Display * d, Colormap cmap,
|
||||
uint8_t *__imlib_AllocColorTable(Display * d, Colormap cmap,
|
||||
unsigned char *type_return,
|
||||
Visual * v);
|
||||
|
||||
|
|
|
@ -110,9 +110,9 @@ __imlib_NewContext(Display * d, Visual * v, Colormap c, int depth)
|
|||
if (depth <= 8)
|
||||
{
|
||||
ct->palette = __imlib_AllocColorTable(d, c, &(ct->palette_type), v);
|
||||
ct->r_dither = malloc(sizeof(DATA8) * DM_X * DM_Y * 256);
|
||||
ct->g_dither = malloc(sizeof(DATA8) * DM_X * DM_Y * 256);
|
||||
ct->b_dither = malloc(sizeof(DATA8) * DM_X * DM_Y * 256);
|
||||
ct->r_dither = malloc(sizeof(uint8_t) * DM_X * DM_Y * 256);
|
||||
ct->g_dither = malloc(sizeof(uint8_t) * DM_X * DM_Y * 256);
|
||||
ct->b_dither = malloc(sizeof(uint8_t) * DM_X * DM_Y * 256);
|
||||
__imlib_RGBA_init((void *)ct->r_dither, (void *)ct->g_dither,
|
||||
(void *)ct->b_dither, depth, ct->palette_type);
|
||||
}
|
||||
|
@ -122,9 +122,9 @@ __imlib_NewContext(Display * d, Visual * v, Colormap c, int depth)
|
|||
ct->palette_type = 0;
|
||||
if ((depth > 8) && (depth <= 16))
|
||||
{
|
||||
ct->r_dither = malloc(sizeof(DATA16) * 4 * 4 * 256);
|
||||
ct->g_dither = malloc(sizeof(DATA16) * 4 * 4 * 256);
|
||||
ct->b_dither = malloc(sizeof(DATA16) * 4 * 4 * 256);
|
||||
ct->r_dither = malloc(sizeof(uint16_t) * 4 * 4 * 256);
|
||||
ct->g_dither = malloc(sizeof(uint16_t) * 4 * 4 * 256);
|
||||
ct->b_dither = malloc(sizeof(uint16_t) * 4 * 4 * 256);
|
||||
__imlib_RGBA_init((void *)ct->r_dither, (void *)ct->g_dither,
|
||||
(void *)ct->b_dither, depth, 0);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ typedef struct _Context {
|
|||
int depth;
|
||||
struct _Context *next;
|
||||
|
||||
DATA8 *palette;
|
||||
uint8_t *palette;
|
||||
unsigned char palette_type;
|
||||
void *r_dither;
|
||||
void *g_dither;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "x11_ximage.h"
|
||||
|
||||
static char _x_err = 0;
|
||||
static DATA8 rtab[256], gtab[256], btab[256];
|
||||
static uint8_t rtab[256], gtab[256], btab[256];
|
||||
|
||||
static int
|
||||
Tmp_HandleXError(Display * d, XErrorEvent * ev)
|
||||
|
@ -21,18 +21,18 @@ Tmp_HandleXError(Display * d, XErrorEvent * ev)
|
|||
}
|
||||
|
||||
void
|
||||
__imlib_GrabXImageToRGBA(DATA32 * data,
|
||||
__imlib_GrabXImageToRGBA(uint32_t * data,
|
||||
int x_dst, int y_dst, int w_dst, int h_dst,
|
||||
Display * d, XImage * xim, XImage * mxim, Visual * v,
|
||||
int depth,
|
||||
int x_src, int y_src, int w_src, int h_src, int grab)
|
||||
{
|
||||
int x, y, inx, iny;
|
||||
const DATA32 *src;
|
||||
const DATA16 *s16;
|
||||
DATA32 *ptr;
|
||||
const uint32_t *src;
|
||||
const uint16_t *s16;
|
||||
uint32_t *ptr;
|
||||
int pixel;
|
||||
DATA16 p16;
|
||||
uint16_t p16;
|
||||
int bgr = 0;
|
||||
|
||||
if (!data)
|
||||
|
@ -179,7 +179,7 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
s16 = (DATA16 *) (xim->data + (xim->bytes_per_line * y));
|
||||
s16 = (uint16_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -193,7 +193,7 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
s16 = (DATA16 *) (xim->data + (xim->bytes_per_line * y));
|
||||
s16 = (uint16_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -226,7 +226,7 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
s16 = (DATA16 *) (xim->data + (xim->bytes_per_line * y));
|
||||
s16 = (uint16_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
s16 = (DATA16 *) (xim->data + (xim->bytes_per_line * y));
|
||||
s16 = (uint16_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -324,7 +324,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -341,7 +342,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -359,7 +361,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -375,7 +378,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -393,7 +397,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -411,7 +416,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -430,7 +436,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -448,7 +455,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -469,7 +477,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -485,7 +494,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -501,7 +511,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -516,7 +527,8 @@ __imlib_GrabXImageToRGBA(DATA32 * data,
|
|||
{
|
||||
for (y = 0; y < h_src; y++)
|
||||
{
|
||||
src = (DATA32 *) (xim->data + (xim->bytes_per_line * y));
|
||||
src =
|
||||
(uint32_t *) (xim->data + (xim->bytes_per_line * y));
|
||||
ptr = data + ((y + iny) * w_dst) + inx;
|
||||
for (x = 0; x < w_src; x++)
|
||||
{
|
||||
|
@ -578,7 +590,7 @@ _WindowGetShapeMask(Display * d, Window p,
|
|||
}
|
||||
|
||||
int
|
||||
__imlib_GrabDrawableToRGBA(DATA32 * data, int x_dst, int y_dst, int w_dst,
|
||||
__imlib_GrabDrawableToRGBA(uint32_t * data, int x_dst, int y_dst, int w_dst,
|
||||
int h_dst, Display * d, Drawable p, Pixmap m_,
|
||||
Visual * v, Colormap cm, int depth, int x_src,
|
||||
int y_src, int w_src, int h_src, char *pdomask,
|
||||
|
@ -808,7 +820,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int x_dst, int y_dst, int w_dst,
|
|||
}
|
||||
|
||||
int
|
||||
__imlib_GrabDrawableScaledToRGBA(DATA32 * data, int nu_x_dst, int nu_y_dst,
|
||||
__imlib_GrabDrawableScaledToRGBA(uint32_t * data, int nu_x_dst, int nu_y_dst,
|
||||
int w_dst, int h_dst,
|
||||
Display * d, Drawable p, Pixmap m_,
|
||||
Visual * v, Colormap cm, int depth,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <X11/Xlib.h>
|
||||
#include "types.h"
|
||||
|
||||
int __imlib_GrabDrawableToRGBA(DATA32 * data, int x_dst,
|
||||
int __imlib_GrabDrawableToRGBA(uint32_t * data, int x_dst,
|
||||
int y_dst, int w_dst, int h_dst,
|
||||
Display * d, Drawable p,
|
||||
Pixmap m, Visual * v,
|
||||
|
@ -13,7 +13,7 @@ int __imlib_GrabDrawableToRGBA(DATA32 * data, int x_dst,
|
|||
int h_src, char *domask,
|
||||
int grab);
|
||||
|
||||
int __imlib_GrabDrawableScaledToRGBA(DATA32 * data, int x_dst,
|
||||
int __imlib_GrabDrawableScaledToRGBA(uint32_t * data, int x_dst,
|
||||
int y_dst, int w_dst,
|
||||
int h_dst, Display * d,
|
||||
Drawable p, Pixmap m,
|
||||
|
@ -23,7 +23,7 @@ int __imlib_GrabDrawableScaledToRGBA(DATA32 * data, int x_dst,
|
|||
int h_src, char *pdomask,
|
||||
int grab);
|
||||
|
||||
void __imlib_GrabXImageToRGBA(DATA32 * data, int x_dst,
|
||||
void __imlib_GrabXImageToRGBA(uint32_t * data, int x_dst,
|
||||
int y_dst, int w_dst, int h_dst,
|
||||
Display * d, XImage * xim,
|
||||
XImage * mxim, Visual * v,
|
||||
|
|
|
@ -24,7 +24,7 @@ typedef struct _ImlibImagePixmap {
|
|||
char *file;
|
||||
char dirty;
|
||||
int references;
|
||||
DATABIG modification_count;
|
||||
uint64_t modification_count;
|
||||
struct _ImlibImagePixmap *next;
|
||||
} ImlibImagePixmap;
|
||||
|
||||
|
@ -62,7 +62,7 @@ static ImlibImagePixmap *
|
|||
__imlib_FindCachedImagePixmap(ImlibImage * im, int w, int h, Display * d,
|
||||
Visual * v, int depth, int sx, int sy, int sw,
|
||||
int sh, Colormap cm, char aa, char hiq,
|
||||
char dmask, DATABIG modification_count)
|
||||
char dmask, uint64_t modification_count)
|
||||
{
|
||||
ImlibImagePixmap *ip, *ip_prev;
|
||||
|
||||
|
@ -103,7 +103,7 @@ __imlib_AddImagePixmapToCache(ImlibImage * im, Pixmap pmap, Pixmap mask,
|
|||
Display * d, Visual * v, int depth,
|
||||
int sx, int sy, int sw, int sh,
|
||||
Colormap cm, char aa, char hiq, char dmask,
|
||||
DATABIG modification_count)
|
||||
uint64_t modification_count)
|
||||
{
|
||||
ImlibImagePixmap *ip;
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
/* size of the lines per segment we scale / render at a time */
|
||||
#define LINESIZE 16
|
||||
|
||||
DATA32
|
||||
uint32_t
|
||||
__imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
|
||||
int depth, DATA8 r, DATA8 g, DATA8 b)
|
||||
int depth, uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
Context *ct;
|
||||
|
||||
|
@ -74,7 +74,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
|
|||
{
|
||||
unsigned int rm, gm, bm;
|
||||
int i, rshift = 0, gshift = 0, bshift = 0;
|
||||
DATA32 val;
|
||||
uint32_t val;
|
||||
|
||||
rm = v->red_mask;
|
||||
gm = v->green_mask;
|
||||
|
@ -136,7 +136,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
|
|||
}
|
||||
|
||||
static void
|
||||
__imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy,
|
||||
__imlib_generic_render(uint32_t * src, int jump, int w, int h, int dx, int dy,
|
||||
XImage * xim, Visual * v, Context * ct)
|
||||
{
|
||||
int x, y, hh;
|
||||
|
@ -144,7 +144,7 @@ __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy,
|
|||
unsigned int rmask, gmask, bmask;
|
||||
int i, rshift, gshift, bshift;
|
||||
|
||||
static const DATA8 _dither_88[8][8] = {
|
||||
static const uint8_t _dither_88[8][8] = {
|
||||
{0, 32, 8, 40, 2, 34, 10, 42},
|
||||
{48, 16, 56, 24, 50, 18, 58, 26},
|
||||
{12, 44, 4, 36, 14, 46, 6, 38},
|
||||
|
@ -257,7 +257,7 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
{
|
||||
XImage *xim = NULL, *mxim = NULL;
|
||||
Context *ct;
|
||||
DATA32 *buf = NULL, *pointer = NULL, *back = NULL;
|
||||
uint32_t *buf = NULL, *pointer = NULL, *back = NULL;
|
||||
int y, h, hh, jump;
|
||||
XGCValues gcv;
|
||||
ImlibScaleInfo *scaleinfo = NULL;
|
||||
|
@ -318,7 +318,7 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
__imlib_RGBASetupContext(ct);
|
||||
if (blend && IM_FLAG_ISSET(im, F_HAS_ALPHA))
|
||||
{
|
||||
back = malloc(dw * dh * sizeof(DATA32));
|
||||
back = malloc(dw * dh * sizeof(uint32_t));
|
||||
if (!__imlib_GrabDrawableToRGBA
|
||||
(back, 0, 0, dw, dh, d, w, 0, v, cm, depth, dx, dy, dw, dh, 0, 1))
|
||||
{
|
||||
|
@ -350,7 +350,7 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
if (scaleinfo)
|
||||
{
|
||||
/* allocate a buffer to render scaled RGBA data into */
|
||||
buf = malloc(dw * LINESIZE * sizeof(DATA32));
|
||||
buf = malloc(dw * LINESIZE * sizeof(uint32_t));
|
||||
if (!buf)
|
||||
{
|
||||
__imlib_ConsumeXImage(d, xim);
|
||||
|
@ -403,7 +403,7 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
if (cmod)
|
||||
{
|
||||
if (!buf)
|
||||
buf = malloc(im->w * LINESIZE * sizeof(DATA32));
|
||||
buf = malloc(im->w * LINESIZE * sizeof(uint32_t));
|
||||
if (!buf)
|
||||
{
|
||||
__imlib_ConsumeXImage(d, xim);
|
||||
|
@ -414,7 +414,7 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
return;
|
||||
}
|
||||
memcpy(buf, im->data + ((y + sy) * im->w),
|
||||
im->w * hh * sizeof(DATA32));
|
||||
im->w * hh * sizeof(uint32_t));
|
||||
__imlib_DataCmodApply(buf, im->w, hh, 0, NULL, cmod);
|
||||
pointer = buf + sx;
|
||||
jump = im->w - sw;
|
||||
|
@ -435,13 +435,13 @@ __imlib_RenderImage(Display * d, ImlibImage * im,
|
|||
/* once scaled... convert chunk to bit depth into XImage bufer */
|
||||
if (rgbaer)
|
||||
rgbaer(pointer, jump,
|
||||
((DATA8 *) xim->data) + (y * (xim->bytes_per_line)),
|
||||
((uint8_t *) xim->data) + (y * (xim->bytes_per_line)),
|
||||
xim->bytes_per_line, dw, hh, dx, dy + y);
|
||||
else
|
||||
__imlib_generic_render(pointer, jump, dw, hh, 0, y, xim, v, ct);
|
||||
if (m)
|
||||
masker(pointer, jump,
|
||||
((DATA8 *) mxim->data) + (y * (mxim->bytes_per_line)),
|
||||
((uint8_t *) mxim->data) + (y * (mxim->bytes_per_line)),
|
||||
mxim->bytes_per_line, dw, hh, dx, dy + y, mat);
|
||||
h -= LINESIZE;
|
||||
}
|
||||
|
@ -566,7 +566,7 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m,
|
|||
__imlib_GetContext(d, v, cm, depth);
|
||||
|
||||
back = __imlib_CreateImage(dw, dh, NULL);
|
||||
back->data = calloc(dw * dh, sizeof(DATA32));
|
||||
back->data = calloc(dw * dh, sizeof(uint32_t));
|
||||
__imlib_GrabDrawableToRGBA(back->data, 0, 0, dw, dh, d, w, 0, v, cm,
|
||||
depth, dx1, dy1, dw, dh, 0, 1);
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
DATA32 __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v,
|
||||
Colormap cm, int depth, DATA8 r,
|
||||
DATA8 g, DATA8 b);
|
||||
uint32_t __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v,
|
||||
Colormap cm, int depth, uint8_t r,
|
||||
uint8_t g, uint8_t b);
|
||||
|
||||
void __imlib_RenderDisconnect(Display * d);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,9 +12,9 @@ void __imlib_RGBASetupContext(Context * ct);
|
|||
void __imlib_RGBA_init(void *rd, void *gd, void *bd, int depth,
|
||||
int palette_type);
|
||||
|
||||
typedef void (*ImlibRGBAFunction)(DATA32 *, int, DATA8 *,
|
||||
typedef void (*ImlibRGBAFunction)(uint32_t *, int, uint8_t *,
|
||||
int, int, int, int, int);
|
||||
typedef void (*ImlibMaskFunction)(DATA32 *, int, DATA8 *,
|
||||
typedef void (*ImlibMaskFunction)(uint32_t *, int, uint8_t *,
|
||||
int, int, int, int, int, int);
|
||||
ImlibRGBAFunction __imlib_GetRGBAFunction(int depth, unsigned long rm,
|
||||
unsigned long gm, unsigned long bm,
|
||||
|
@ -22,14 +22,14 @@ ImlibRGBAFunction __imlib_GetRGBAFunction(int depth, unsigned long rm,
|
|||
ImlibMaskFunction __imlib_GetMaskFunction(char hiq);
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
void __imlib_mmx_rgb555_fast(DATA32 *, int, DATA8 *, int, int,
|
||||
int, int, int);
|
||||
void __imlib_mmx_bgr555_fast(DATA32 *, int, DATA8 *, int, int,
|
||||
int, int, int);
|
||||
void __imlib_mmx_rgb565_fast(DATA32 *, int, DATA8 *, int, int,
|
||||
int, int, int);
|
||||
void __imlib_mmx_bgr565_fast(DATA32 *, int, DATA8 *, int, int,
|
||||
int, int, int);
|
||||
void __imlib_mmx_rgb555_fast(uint32_t *, int, uint8_t *, int,
|
||||
int, int, int, int);
|
||||
void __imlib_mmx_bgr555_fast(uint32_t *, int, uint8_t *, int,
|
||||
int, int, int, int);
|
||||
void __imlib_mmx_rgb565_fast(uint32_t *, int, uint8_t *, int,
|
||||
int, int, int, int);
|
||||
void __imlib_mmx_bgr565_fast(uint32_t *, int, uint8_t *, int,
|
||||
int, int, int, int);
|
||||
#endif
|
||||
|
||||
#endif /* X11_RGBA_H */
|
||||
|
|
|
@ -20,8 +20,8 @@ bump_map(Imlib_Image im, IFunctionParam * par)
|
|||
double ambient = 0;
|
||||
|
||||
int free_map = 0;
|
||||
DATA32 *src;
|
||||
DATA32 *mp, *mpy, *mpp;
|
||||
uint32_t *src;
|
||||
uint32_t *mp, *mpy, *mpp;
|
||||
double z, x2, y2;
|
||||
int w, h, i, j, w2, h2, wh2, mx, my;
|
||||
|
||||
|
@ -138,8 +138,8 @@ bump_map_point(Imlib_Image im, IFunctionParam * par)
|
|||
double ambient = 0;
|
||||
|
||||
int free_map = 0;
|
||||
DATA32 *src;
|
||||
DATA32 *mp, *mpy, *mpp;
|
||||
uint32_t *src;
|
||||
uint32_t *mp, *mpy, *mpp;
|
||||
double z_2, x2, y2;
|
||||
int w, h, i, j, w2, h2, wh2, mx, my;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static Imlib_Image
|
|||
colormod(Imlib_Image im, IFunctionParam * par)
|
||||
{
|
||||
double a_d[256], r_d[256], g_d[256], b_d[256];
|
||||
DATA8 a_b[256], r_b[256], g_b[256], b_b[256];
|
||||
uint8_t a_b[256], r_b[256], g_b[256], b_b[256];
|
||||
IFunctionParam *ptr;
|
||||
int x = 0, y = 0, h, w, i;
|
||||
double v = 0.0;
|
||||
|
|
|
@ -39,9 +39,9 @@ exec(char *filter, void *im, IFunctionParam * params)
|
|||
if (strcmp(filter, "tint") == 0)
|
||||
{
|
||||
Imlib_Color_Modifier cm;
|
||||
DATA8 atab[256];
|
||||
uint8_t atab[256];
|
||||
int x = 0, y = 0, w = 0, h = 0;
|
||||
DATA8 r = 255, b = 255, g = 255, a = 255;
|
||||
uint8_t r = 255, b = 255, g = 255, a = 255;
|
||||
|
||||
/*
|
||||
printf( "filter_test.c: tint called\n" );
|
||||
|
@ -53,14 +53,14 @@ exec(char *filter, void *im, IFunctionParam * params)
|
|||
|
||||
for (ptr = params; ptr; ptr = ptr->next)
|
||||
{
|
||||
ASSIGN_DATA8("red", r);
|
||||
ASSIGN_DATA8("blue", b);
|
||||
ASSIGN_DATA8("green", g);
|
||||
ASSIGN_uint8_t("red", r);
|
||||
ASSIGN_uint8_t("blue", b);
|
||||
ASSIGN_uint8_t("green", g);
|
||||
ASSIGN_INT("x", x);
|
||||
ASSIGN_INT("y", y);
|
||||
ASSIGN_INT("w", w);
|
||||
ASSIGN_INT("h", h);
|
||||
ASSIGN_DATA8("alpha", a);
|
||||
ASSIGN_uint8_t("alpha", a);
|
||||
}
|
||||
/*
|
||||
printf( "Using values red=%d,blue=%d,green=%d,x=%d,y=%d,height=%d,width=%d,alpha=%d\n", r,b,g,x,y,w,h,a );
|
||||
|
|
|
@ -36,7 +36,7 @@ load2(ImlibImage * im, int load_data)
|
|||
int rc;
|
||||
void *fdata;
|
||||
int alpha;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
int y;
|
||||
const char *fptr, *row;
|
||||
unsigned int size;
|
||||
|
@ -116,7 +116,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
{
|
||||
int rc;
|
||||
FILE *f;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
int y, alpha = 0;
|
||||
|
||||
f = fopen(im->real_file, "wb");
|
||||
|
@ -124,7 +124,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
return LOAD_FAIL;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
DATA32 *buf = (DATA32 *) malloc(im->w * 4);
|
||||
uint32_t *buf = (uint32_t *) malloc(im->w * 4);
|
||||
#endif
|
||||
|
||||
if (IM_FLAG_ISSET(im, F_HAS_ALPHA))
|
||||
|
|
|
@ -38,42 +38,42 @@ mm_read(void *dst, unsigned int len)
|
|||
|
||||
/* The BITMAPFILEHEADER (size 14) */
|
||||
typedef struct {
|
||||
DATA8 header[2];
|
||||
DATA8 size[4];
|
||||
DATA8 rsvd1[2];
|
||||
DATA8 rsvd2[2];
|
||||
DATA8 offs[4];
|
||||
uint8_t header[2];
|
||||
uint8_t size[4];
|
||||
uint8_t rsvd1[2];
|
||||
uint8_t rsvd2[2];
|
||||
uint8_t offs[4];
|
||||
} bfh_t;
|
||||
|
||||
/* The BITMAPINFOHEADER */
|
||||
typedef union {
|
||||
DATA32 header_size;
|
||||
uint32_t header_size;
|
||||
struct {
|
||||
/* BITMAPCOREHEADER (size 12) */
|
||||
DATA32 header_size;
|
||||
DATA16 width;
|
||||
DATA16 height;
|
||||
DATA16 planes;
|
||||
DATA16 bpp;
|
||||
uint32_t header_size;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
} bch;
|
||||
struct {
|
||||
/* BITMAPINFOHEADER (size 40) */
|
||||
DATA32 header_size;
|
||||
DATA32 width;
|
||||
DATA32 height;
|
||||
DATA16 planes;
|
||||
DATA16 bpp;
|
||||
DATA32 compression;
|
||||
DATA32 size;
|
||||
DATA32 res_hor;
|
||||
DATA32 res_ver;
|
||||
DATA32 colors;
|
||||
DATA32 colors_important;
|
||||
uint32_t header_size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
uint32_t compression;
|
||||
uint32_t size;
|
||||
uint32_t res_hor;
|
||||
uint32_t res_ver;
|
||||
uint32_t colors;
|
||||
uint32_t colors_important;
|
||||
/* BITMAPV3INFOHEADER (size 56) */
|
||||
DATA32 mask_r;
|
||||
DATA32 mask_g;
|
||||
DATA32 mask_b;
|
||||
DATA32 mask_a;
|
||||
uint32_t mask_r;
|
||||
uint32_t mask_g;
|
||||
uint32_t mask_b;
|
||||
uint32_t mask_a;
|
||||
} bih;
|
||||
char bytes[124];
|
||||
} bih_t;
|
||||
|
@ -165,10 +165,10 @@ load2(ImlibImage * im, int load_data)
|
|||
unsigned char byte = 0, byte1, byte2;
|
||||
unsigned int i, k;
|
||||
int w, h, x, y, j, l;
|
||||
DATA32 *ptr, pixel;
|
||||
uint32_t *ptr, pixel;
|
||||
const unsigned char *buffer_ptr, *buffer_end, *buffer_end_safe;
|
||||
RGBQUAD rgbQuads[256];
|
||||
DATA32 argbCmap[256];
|
||||
uint32_t argbCmap[256];
|
||||
unsigned int amask, rmask, gmask, bmask;
|
||||
int ashift1, rshift1, gshift1, bshift1;
|
||||
int ashift2, rshift2, gshift2, bshift2;
|
||||
|
@ -465,7 +465,7 @@ load2(ImlibImage * im, int load_data)
|
|||
x, y, byte1, byte2, byte2 >> 4, byte2 & 0xf);
|
||||
if (byte1)
|
||||
{
|
||||
DATA32 t1, t2;
|
||||
uint32_t t1, t2;
|
||||
|
||||
l = byte1;
|
||||
/* Check for invalid length */
|
||||
|
@ -769,7 +769,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
int rc;
|
||||
FILE *f;
|
||||
int i, j, pad;
|
||||
DATA32 pixel;
|
||||
uint32_t pixel;
|
||||
|
||||
f = fopen(im->real_file, "wb");
|
||||
if (!f)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* Farbfeld (http://tools.suckless.org/farbfeld) */
|
||||
#include "loader_common.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#define mm_check(p) ((const char *)(p) <= (const char *)fdata + im->fsize)
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
#define DBG_PFX "LDR-gif"
|
||||
|
||||
static void
|
||||
make_colormap(DATA32 * cmi, ColorMapObject * cmg, int bg, int tr)
|
||||
make_colormap(uint32_t * cmi, ColorMapObject * cmg, int bg, int tr)
|
||||
{
|
||||
int i, r, g, b;
|
||||
|
||||
memset(cmi, 0, 256 * sizeof(DATA32));
|
||||
memset(cmi, 0, 256 * sizeof(uint32_t));
|
||||
if (!cmg)
|
||||
return;
|
||||
|
||||
|
@ -30,7 +30,7 @@ int
|
|||
load2(ImlibImage * im, int load_data)
|
||||
{
|
||||
int rc;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
GifFileType *gif;
|
||||
GifRowType *rows;
|
||||
GifRecordType rec;
|
||||
|
@ -38,7 +38,7 @@ load2(ImlibImage * im, int load_data)
|
|||
int i, j, bg, bits;
|
||||
int transp;
|
||||
int fd;
|
||||
DATA32 colormap[256];
|
||||
uint32_t colormap[256];
|
||||
int fcount, frame, multiframe;
|
||||
|
||||
fd = dup(fileno(im->fp));
|
||||
|
|
|
@ -27,7 +27,7 @@ load2(ImlibImage * im, int load_data)
|
|||
struct heif_image_handle *img_handle = NULL;
|
||||
struct heif_image *img_data = NULL;
|
||||
struct heif_decoding_options *decode_opts = NULL;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
const uint8_t *img_plane = NULL;
|
||||
|
||||
rc = LOAD_FAIL;
|
||||
|
|
|
@ -43,36 +43,36 @@ mm_read(void *dst, unsigned int len)
|
|||
|
||||
/* The ICONDIR */
|
||||
typedef struct {
|
||||
DATA16 rsvd;
|
||||
DATA16 type;
|
||||
DATA16 icons;
|
||||
uint16_t rsvd;
|
||||
uint16_t type;
|
||||
uint16_t icons;
|
||||
} idir_t;
|
||||
|
||||
/* The ICONDIRENTRY */
|
||||
typedef struct {
|
||||
DATA8 width;
|
||||
DATA8 height;
|
||||
DATA8 colors;
|
||||
DATA8 rsvd;
|
||||
DATA16 planes;
|
||||
DATA16 bpp;
|
||||
DATA32 size;
|
||||
DATA32 offs;
|
||||
uint8_t width;
|
||||
uint8_t height;
|
||||
uint8_t colors;
|
||||
uint8_t rsvd;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
uint32_t size;
|
||||
uint32_t offs;
|
||||
} ide_t;
|
||||
|
||||
/* The BITMAPINFOHEADER */
|
||||
typedef struct {
|
||||
DATA32 header_size;
|
||||
DATA32 width;
|
||||
DATA32 height;
|
||||
DATA16 planes;
|
||||
DATA16 bpp;
|
||||
DATA32 compression;
|
||||
DATA32 size;
|
||||
DATA32 res_hor;
|
||||
DATA32 res_ver;
|
||||
DATA32 colors;
|
||||
DATA32 colors_important;
|
||||
uint32_t header_size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint16_t planes;
|
||||
uint16_t bpp;
|
||||
uint32_t compression;
|
||||
uint32_t size;
|
||||
uint32_t res_hor;
|
||||
uint32_t res_ver;
|
||||
uint32_t colors;
|
||||
uint32_t colors_important;
|
||||
} bih_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -82,9 +82,9 @@ typedef struct {
|
|||
unsigned short w;
|
||||
unsigned short h;
|
||||
|
||||
DATA32 *cmap; /* Colormap (bpp <= 8) */
|
||||
DATA8 *pxls; /* Pixel data */
|
||||
DATA8 *mask; /* Bitmask */
|
||||
uint32_t *cmap; /* Colormap (bpp <= 8) */
|
||||
uint8_t *pxls; /* Pixel data */
|
||||
uint8_t *mask; /* Bitmask */
|
||||
} ie_t;
|
||||
|
||||
typedef struct {
|
||||
|
@ -188,9 +188,9 @@ ico_read_icon(ico_t * ico, int ino)
|
|||
case 4:
|
||||
case 8:
|
||||
DL("Allocating a %d slot colormap\n", ie->bih.colors);
|
||||
if (UINT_MAX / sizeof(DATA32) < ie->bih.colors)
|
||||
if (UINT_MAX / sizeof(uint32_t) < ie->bih.colors)
|
||||
goto bail;
|
||||
size = ie->bih.colors * sizeof(DATA32);
|
||||
size = ie->bih.colors * sizeof(uint32_t);
|
||||
ie->cmap = malloc(size);
|
||||
if (ie->cmap == NULL)
|
||||
goto bail;
|
||||
|
@ -232,7 +232,7 @@ ico_read_icon(ico_t * ico, int ino)
|
|||
}
|
||||
|
||||
static int
|
||||
ico_data_get_bit(DATA8 * data, int w, int x, int y)
|
||||
ico_data_get_bit(uint8_t * data, int w, int x, int y)
|
||||
{
|
||||
int w32, res;
|
||||
|
||||
|
@ -245,7 +245,7 @@ ico_data_get_bit(DATA8 * data, int w, int x, int y)
|
|||
}
|
||||
|
||||
static int
|
||||
ico_data_get_nibble(DATA8 * data, int w, int x, int y)
|
||||
ico_data_get_nibble(uint8_t * data, int w, int x, int y)
|
||||
{
|
||||
int w32, res;
|
||||
|
||||
|
@ -261,11 +261,11 @@ static int
|
|||
ico_load(ico_t * ico, ImlibImage * im, int load_data)
|
||||
{
|
||||
int ic, x, y, w, h, d, frame;
|
||||
DATA32 *cmap;
|
||||
DATA8 *pxls, *mask, *psrc;
|
||||
uint32_t *cmap;
|
||||
uint8_t *pxls, *mask, *psrc;
|
||||
ie_t *ie;
|
||||
DATA32 *pdst;
|
||||
DATA32 pixel;
|
||||
uint32_t *pdst;
|
||||
uint32_t pixel;
|
||||
|
||||
frame = 0; /* Select default */
|
||||
if (im->frame_num > 0)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
typedef struct {
|
||||
struct jpeg_error_mgr jem;
|
||||
sigjmp_buf setjmp_buffer;
|
||||
DATA8 *data;
|
||||
uint8_t *data;
|
||||
} ImLib_JPEG_data;
|
||||
|
||||
static void
|
||||
|
@ -67,8 +67,8 @@ load2(ImlibImage * im, int load_data)
|
|||
int w, h, rc;
|
||||
struct jpeg_decompress_struct jds;
|
||||
ImLib_JPEG_data jdata;
|
||||
DATA8 *ptr, *line[16];
|
||||
DATA32 *ptr2;
|
||||
uint8_t *ptr, *line[16];
|
||||
uint32_t *ptr2;
|
||||
int x, y, l, scans, inc;
|
||||
ExifInfo ei = { 0 };
|
||||
|
||||
|
@ -256,15 +256,15 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
struct jpeg_compress_struct jcs;
|
||||
ImLib_JPEG_data jdata;
|
||||
FILE *f;
|
||||
DATA8 *buf;
|
||||
DATA32 *ptr;
|
||||
uint8_t *buf;
|
||||
uint32_t *ptr;
|
||||
JSAMPROW *jbuf;
|
||||
int y, quality, compression;
|
||||
ImlibImageTag *tag;
|
||||
int i, j;
|
||||
|
||||
/* allocate a small buffer to convert image data */
|
||||
buf = malloc(im->w * 3 * sizeof(DATA8));
|
||||
buf = malloc(im->w * 3 * sizeof(uint8_t));
|
||||
if (!buf)
|
||||
return LOAD_FAIL;
|
||||
|
||||
|
@ -331,7 +331,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
/* convcert scaline from ARGB to RGB packed */
|
||||
for (j = 0, i = 0; i < im->w; i++)
|
||||
{
|
||||
DATA32 pixel = *ptr++;
|
||||
uint32_t pixel = *ptr++;
|
||||
|
||||
buf[j++] = PIXEL_R(pixel);
|
||||
buf[j++] = PIXEL_G(pixel);
|
||||
|
|
|
@ -274,11 +274,11 @@ scalecmap(ILBM * ilbm)
|
|||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Deplanes and converts an array of bitplanes to a single scanline of DATA32
|
||||
* (unsigned int) values. DATA32 is ARGB.
|
||||
* Deplanes and converts an array of bitplanes to a single scanline of uint32_t
|
||||
* (unsigned int) values. uint32_t is ARGB.
|
||||
*------------------------------------------------------------------------------*/
|
||||
static void
|
||||
deplane(DATA32 * row, int w, ILBM * ilbm, unsigned char *plane[])
|
||||
deplane(uint32_t * row, int w, ILBM * ilbm, unsigned char *plane[])
|
||||
{
|
||||
unsigned int l, r, g, b, a;
|
||||
int i, o, x;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "loader_common.h"
|
||||
|
||||
#include <png.h>
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#define DBG_PFX "LDR-png"
|
||||
|
@ -217,8 +216,8 @@ row_callback(png_struct * png_ptr, png_byte * new_row,
|
|||
{
|
||||
ctx_t *ctx = png_get_progressive_ptr(png_ptr);
|
||||
ImlibImage *im = ctx->im;
|
||||
DATA32 *dptr;
|
||||
const DATA32 *sptr;
|
||||
uint32_t *dptr;
|
||||
const uint32_t *sptr;
|
||||
int x, y, x0, dx, y0, dy;
|
||||
int done;
|
||||
|
||||
|
@ -240,7 +239,7 @@ row_callback(png_struct * png_ptr, png_byte * new_row,
|
|||
PNG_PASS_COLS(im->w, pass), PNG_PASS_ROWS(im->h, pass));
|
||||
y = y0 + dy * row_num;
|
||||
|
||||
sptr = (const DATA32 *)new_row; /* Assuming aligned */
|
||||
sptr = (const uint32_t *)new_row; /* Assuming aligned */
|
||||
dptr = im->data + y * im->w;
|
||||
for (x = x0; x < im->w; x += dx)
|
||||
{
|
||||
|
@ -263,7 +262,7 @@ row_callback(png_struct * png_ptr, png_byte * new_row,
|
|||
y = row_num;
|
||||
|
||||
dptr = im->data + y * im->w;
|
||||
memcpy(dptr, new_row, sizeof(DATA32) * im->w);
|
||||
memcpy(dptr, new_row, sizeof(uint32_t) * im->w);
|
||||
|
||||
done = (int)row_num >= im->h - 1;
|
||||
|
||||
|
@ -578,7 +577,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
FILE *f;
|
||||
png_structp png_ptr;
|
||||
png_infop info_ptr;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
int x, y, j, interlace;
|
||||
png_bytep row_ptr, data;
|
||||
png_color_8 sig_bit;
|
||||
|
@ -702,7 +701,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
{
|
||||
for (j = 0, x = 0; x < im->w; x++)
|
||||
{
|
||||
DATA32 pixel = ptr[x];
|
||||
uint32_t pixel = ptr[x];
|
||||
|
||||
data[j++] = PIXEL_R(pixel);
|
||||
data[j++] = PIXEL_G(pixel);
|
||||
|
|
|
@ -118,10 +118,10 @@ load2(ImlibImage * im, int load_data)
|
|||
void *fdata;
|
||||
int c, p;
|
||||
int w, h, v, numbers, count;
|
||||
DATA8 *data = NULL; /* for the binary versions */
|
||||
DATA8 *ptr = NULL;
|
||||
uint8_t *data = NULL; /* for the binary versions */
|
||||
uint8_t *ptr = NULL;
|
||||
int *idata = NULL; /* for the ASCII versions */
|
||||
DATA32 *ptr2, rval, gval, bval;
|
||||
uint32_t *ptr2, rval, gval, bval;
|
||||
int i, j, x, y;
|
||||
|
||||
rc = LOAD_FAIL;
|
||||
|
@ -272,7 +272,7 @@ load2(ImlibImage * im, int load_data)
|
|||
}
|
||||
break;
|
||||
case '4': /* binary 1bit monochrome */
|
||||
data = malloc((w + 7) / 8 * sizeof(DATA8));
|
||||
data = malloc((w + 7) / 8 * sizeof(uint8_t));
|
||||
if (!data)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
@ -302,7 +302,7 @@ load2(ImlibImage * im, int load_data)
|
|||
}
|
||||
break;
|
||||
case '5': /* binary 8bit grayscale GGGGGGGG */
|
||||
data = malloc(1 * sizeof(DATA8) * w);
|
||||
data = malloc(1 * sizeof(uint8_t) * w);
|
||||
if (!data)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
@ -341,7 +341,7 @@ load2(ImlibImage * im, int load_data)
|
|||
}
|
||||
break;
|
||||
case '6': /* 24bit binary RGBRGBRGB */
|
||||
data = malloc(3 * sizeof(DATA8) * w);
|
||||
data = malloc(3 * sizeof(uint8_t) * w);
|
||||
if (!data)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
@ -380,7 +380,7 @@ load2(ImlibImage * im, int load_data)
|
|||
}
|
||||
break;
|
||||
case '7': /* XV's 8bit 332 format */
|
||||
data = malloc(1 * sizeof(DATA8) * w);
|
||||
data = malloc(1 * sizeof(uint8_t) * w);
|
||||
if (!data)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
@ -412,7 +412,7 @@ load2(ImlibImage * im, int load_data)
|
|||
}
|
||||
break;
|
||||
case '8': /* 24bit binary RGBARGBARGBA */
|
||||
data = malloc(4 * sizeof(DATA8) * w);
|
||||
data = malloc(4 * sizeof(uint8_t) * w);
|
||||
if (!data)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
@ -474,8 +474,8 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
{
|
||||
int rc;
|
||||
FILE *f;
|
||||
DATA8 *buf, *bptr;
|
||||
DATA32 *ptr;
|
||||
uint8_t *buf, *bptr;
|
||||
uint32_t *ptr;
|
||||
int x, y;
|
||||
|
||||
f = fopen(im->real_file, "wb");
|
||||
|
@ -485,7 +485,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
rc = LOAD_FAIL;
|
||||
|
||||
/* allocate a small buffer to convert image data */
|
||||
buf = malloc(im->w * 4 * sizeof(DATA8));
|
||||
buf = malloc(im->w * 4 * sizeof(uint8_t));
|
||||
if (!buf)
|
||||
goto quit;
|
||||
|
||||
|
@ -501,7 +501,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
bptr = buf;
|
||||
for (x = 0; x < im->w; x++)
|
||||
{
|
||||
DATA32 pixel = *ptr++;
|
||||
uint32_t pixel = *ptr++;
|
||||
|
||||
bptr[0] = PIXEL_R(pixel);
|
||||
bptr[1] = PIXEL_G(pixel);
|
||||
|
@ -524,7 +524,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
bptr = buf;
|
||||
for (x = 0; x < im->w; x++)
|
||||
{
|
||||
DATA32 pixel = *ptr++;
|
||||
uint32_t pixel = *ptr++;
|
||||
|
||||
bptr[0] = PIXEL_R(pixel);
|
||||
bptr[1] = PIXEL_G(pixel);
|
||||
|
|
|
@ -162,11 +162,11 @@ load2(ImlibImage * im, int load_data)
|
|||
if (!__imlib_AllocateData(im))
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
memset(im->data, 0, im->w * im->h * sizeof(DATA32));
|
||||
memset(im->data, 0, im->w * im->h * sizeof(uint32_t));
|
||||
surface =
|
||||
cairo_image_surface_create_for_data((void *)im->data, CAIRO_FORMAT_ARGB32,
|
||||
im->w, im->h,
|
||||
im->w * sizeof(DATA32));;
|
||||
im->w * sizeof(uint32_t));;
|
||||
if (!surface)
|
||||
QUIT_WITH_RC(LOAD_OOM);
|
||||
|
||||
|
|
|
@ -11,12 +11,10 @@
|
|||
*/
|
||||
#include "loader_common.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define DBG_PFX "LDR-tga"
|
||||
|
||||
/* flip an inverted image - see RLE reading below */
|
||||
static void tgaflip(DATA32 * in, int w, int h, int fliph, int flipv);
|
||||
static void tgaflip(uint32_t * in, int w, int h, int fliph, int flipv);
|
||||
|
||||
/* TGA pixel formats */
|
||||
#define TGA_TYPE_MAPPED 1
|
||||
|
@ -78,7 +76,7 @@ load2(ImlibImage * im, int load_data)
|
|||
int rle, bpp, hasa, hasc, fliph, flipv;
|
||||
unsigned long datasize;
|
||||
const unsigned char *bufptr, *bufend, *palette;
|
||||
DATA32 *dataptr;
|
||||
uint32_t *dataptr;
|
||||
int palcnt = 0, palbpp = 0;
|
||||
unsigned char a, r, g, b;
|
||||
unsigned int pix16;
|
||||
|
@ -314,7 +312,7 @@ load2(ImlibImage * im, int load_data)
|
|||
else
|
||||
{
|
||||
/* decode RLE compressed data */
|
||||
DATA32 *final_pixel = dataptr + im->w * im->h;
|
||||
uint32_t *final_pixel = dataptr + im->w * im->h;
|
||||
|
||||
/* loop until we've got all the pixels or run out of input */
|
||||
while ((dataptr < final_pixel))
|
||||
|
@ -471,11 +469,11 @@ load2(ImlibImage * im, int load_data)
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* flip a DATA32 image block in place */
|
||||
/* flip a uint32_t image block in place */
|
||||
static void
|
||||
tgaflip(DATA32 * in, int w, int h, int fliph, int flipv)
|
||||
tgaflip(uint32_t * in, int w, int h, int fliph, int flipv)
|
||||
{
|
||||
DATA32 tmp;
|
||||
uint32_t tmp;
|
||||
int x, y, x2, y2, dx, dy, nx, ny;
|
||||
|
||||
dx = fliph ? -1 : 1;
|
||||
|
@ -506,7 +504,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
{
|
||||
int rc;
|
||||
FILE *f;
|
||||
DATA32 *dataptr;
|
||||
uint32_t *dataptr;
|
||||
unsigned char *buf, *bufptr;
|
||||
int y;
|
||||
tga_header header;
|
||||
|
@ -560,7 +558,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
/* for each pixel in the row */
|
||||
for (x = 0; x < im->w; x++)
|
||||
{
|
||||
DATA32 pixel = *dataptr++;
|
||||
uint32_t pixel = *dataptr++;
|
||||
|
||||
*bufptr++ = PIXEL_B(pixel);
|
||||
*bufptr++ = PIXEL_G(pixel);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "loader_common.h"
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <stdint.h>
|
||||
#include <tiffio.h>
|
||||
|
||||
/* This is a wrapper data structure for TIFFRGBAImage, so that data can be */
|
||||
|
@ -23,7 +22,7 @@ raster(TIFFRGBAImage_Extra * img, uint32_t * rast,
|
|||
uint32_t image_width, image_height;
|
||||
uint32_t *pixel, pixel_value;
|
||||
uint32_t i, j, k;
|
||||
DATA32 *buffer_pixel, *buffer = img->image->data;
|
||||
uint32_t *buffer_pixel, *buffer = img->image->data;
|
||||
int alpha_premult;
|
||||
int a, r, g, b;
|
||||
|
||||
|
@ -366,7 +365,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
int rc;
|
||||
TIFF *tif = NULL;
|
||||
uint8_t *buf = NULL;
|
||||
DATA32 pixel, *data = im->data;
|
||||
uint32_t pixel, *data = im->data;
|
||||
double alpha_factor;
|
||||
int x, y;
|
||||
uint8_t r, g, b, a = 0;
|
||||
|
|
|
@ -87,7 +87,7 @@ load2(ImlibImage * im, int load_data)
|
|||
|
||||
if (WebPDecodeBGRAInto
|
||||
(iter.fragment.bytes, iter.fragment.size, (uint8_t *) im->data,
|
||||
sizeof(DATA32) * im->w * im->h, im->w * 4) == NULL)
|
||||
sizeof(uint32_t) * im->w * im->h, im->w * 4) == NULL)
|
||||
goto quit;
|
||||
|
||||
if (im->lc)
|
||||
|
|
|
@ -44,18 +44,18 @@ mm_gets(char *dst, unsigned int len)
|
|||
return dst;
|
||||
}
|
||||
|
||||
static const DATA32 _bitmap_colors[2] = { 0xffffffff, 0xff000000 };
|
||||
static const uint32_t _bitmap_colors[2] = { 0xffffffff, 0xff000000 };
|
||||
|
||||
static DATA32
|
||||
static uint32_t
|
||||
_bitmap_color(int bit)
|
||||
{
|
||||
return _bitmap_colors[!!bit];
|
||||
}
|
||||
|
||||
static int
|
||||
_bitmap_dither(int x, int y, DATA32 pixel)
|
||||
_bitmap_dither(int x, int y, uint32_t pixel)
|
||||
{
|
||||
static const DATA8 _dither_44[4][4] = {
|
||||
static const uint8_t _dither_44[4][4] = {
|
||||
/**INDENT-OFF**/
|
||||
{ 0, 32, 8, 40},
|
||||
{48, 16, 56, 24},
|
||||
|
@ -84,7 +84,7 @@ load2(ImlibImage * im, int load_data)
|
|||
int rc;
|
||||
void *fdata;
|
||||
char buf[4096], tok1[1024], tok2[1024];
|
||||
DATA32 *ptr, pixel;
|
||||
uint32_t *ptr, pixel;
|
||||
int i, x, y, bit, nl;
|
||||
const char *s;
|
||||
int header, val, nlen;
|
||||
|
@ -223,7 +223,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity)
|
|||
const char *s, *name;
|
||||
char *bname;
|
||||
int i, k, x, y, bits, nval, val;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
|
||||
f = fopen(im->real_file, "wb");
|
||||
if (!f)
|
||||
|
|
|
@ -29,7 +29,7 @@ mm_getc(void)
|
|||
static FILE *rgb_txt = NULL;
|
||||
|
||||
static void
|
||||
xpm_parse_color(char *color, DATA32 * pixel)
|
||||
xpm_parse_color(char *color, uint32_t * pixel)
|
||||
{
|
||||
char buf[4096];
|
||||
int r, g, b;
|
||||
|
@ -120,7 +120,7 @@ typedef struct {
|
|||
char assigned;
|
||||
unsigned char transp;
|
||||
char str[6];
|
||||
DATA32 pixel;
|
||||
uint32_t pixel;
|
||||
} cmap_t;
|
||||
|
||||
static int
|
||||
|
@ -129,7 +129,7 @@ xpm_cmap_sort(const void *a, const void *b)
|
|||
return strcmp(((const cmap_t *)a)->str, ((const cmap_t *)b)->str);
|
||||
}
|
||||
|
||||
static DATA32
|
||||
static uint32_t
|
||||
xpm_cmap_lookup(const cmap_t * cmap, int nc, int cpp, const char *s)
|
||||
{
|
||||
int i, i1, i2, x;
|
||||
|
@ -155,7 +155,7 @@ load2(ImlibImage * im, int load_data)
|
|||
{
|
||||
int rc;
|
||||
void *fdata;
|
||||
DATA32 *ptr;
|
||||
uint32_t *ptr;
|
||||
int pc, c, i, j, k, w, h, ncolors, cpp;
|
||||
int comment, transp, quote, context, len, done, backslash;
|
||||
char *line, s[256], tok[256], col[256];
|
||||
|
|
|
@ -173,7 +173,7 @@ static void
|
|||
_test_grab_1(int w, int h, int x0, int y0)
|
||||
{
|
||||
Imlib_Image im;
|
||||
DATA32 *dptr, pix, col;
|
||||
uint32_t *dptr, pix, col;
|
||||
int x, y, err;
|
||||
int xs, ys, ws, hs;
|
||||
char buf[128];
|
||||
|
|
|
@ -83,7 +83,7 @@ TEST(LOAD2, load_1)
|
|||
data = (unsigned char *)imlib_image_get_data();
|
||||
w = imlib_image_get_width();
|
||||
h = imlib_image_get_height();
|
||||
crc = crc32(0, data, w * h * sizeof(DATA32));
|
||||
crc = crc32(0, data, w * h * sizeof(uint32_t));
|
||||
EXPECT_EQ(crc, tii[i].crc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ test_rotate(int no, int aa)
|
|||
D("Error %d saving '%s'\n", err, fileo);
|
||||
|
||||
data = (unsigned char *)imlib_image_get_data_for_reading_only();
|
||||
crc = crc32(0, data, wo * ho * sizeof(DATA32));
|
||||
crc = crc32(0, data, wo * ho * sizeof(uint32_t));
|
||||
EXPECT_EQ(crc, ptd->tv[i].crc[ic]);
|
||||
|
||||
imlib_context_set_image(imo);
|
||||
|
|
|
@ -53,7 +53,7 @@ test_scale(int no)
|
|||
h = imlib_image_get_height();
|
||||
|
||||
data = (unsigned char *)imlib_image_get_data_for_reading_only();
|
||||
crc = crc32(0, data, w * h * sizeof(DATA32));
|
||||
crc = crc32(0, data, w * h * sizeof(uint32_t));
|
||||
EXPECT_EQ(crc, ptd->crcs[0]);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -70,7 +70,7 @@ test_scale(int no)
|
|||
h = imlib_image_get_height();
|
||||
|
||||
data = (unsigned char *)imlib_image_get_data_for_reading_only();
|
||||
crc = crc32(0, data, w * h * sizeof(DATA32));
|
||||
crc = crc32(0, data, w * h * sizeof(uint32_t));
|
||||
EXPECT_EQ(crc, ptd->crcs[i]);
|
||||
|
||||
snprintf(fileo, sizeof(fileo), "%s/scale-%s-%dx%d.%s",
|
||||
|
|
Loading…
Reference in New Issue