mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
added RFillImage
This commit is contained in:
10
wrlib/misc.c
10
wrlib/misc.c
@@ -89,7 +89,7 @@ RBevelImage(RImage *image, int bevel_type)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RClearImage(RImage *image, RColor *color)
|
RFillImage(RImage *image, RColor *color)
|
||||||
{
|
{
|
||||||
if (image->format == RRGBAFormat) {
|
if (image->format == RRGBAFormat) {
|
||||||
unsigned char *d = image->data;
|
unsigned char *d = image->data;
|
||||||
@@ -117,7 +117,12 @@ RClearImage(RImage *image, RColor *color)
|
|||||||
memcpy(d, image->data, image->width*3);
|
memcpy(d, image->data, image->width*3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if 0
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
RClearImage(RImage *image, RColor *color)
|
||||||
|
{
|
||||||
if (color->alpha==255) {
|
if (color->alpha==255) {
|
||||||
if (image->format == RRGBAFormat) {
|
if (image->format == RRGBAFormat) {
|
||||||
unsigned char *d = image->data;
|
unsigned char *d = image->data;
|
||||||
@@ -171,7 +176,6 @@ RClearImage(RImage *image, RColor *color)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
|
|||||||
@@ -128,10 +128,10 @@ RLoadPNG(RContext *context, char *file, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* normalize to 8bpp with alpha channel */
|
/* normalize to 8bpp with alpha channel */
|
||||||
if (color_type == PNG_COLOR_TYPE_PALETTE && depth < 8)
|
if (color_type == PNG_COLOR_TYPE_PALETTE && depth <= 8)
|
||||||
png_set_expand(png);
|
png_set_expand(png);
|
||||||
|
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && depth < 8)
|
if (color_type == PNG_COLOR_TYPE_GRAY && depth <= 8)
|
||||||
png_set_expand(png);
|
png_set_expand(png);
|
||||||
|
|
||||||
if (png_get_valid(png, pinfo, PNG_INFO_tRNS))
|
if (png_get_valid(png, pinfo, PNG_INFO_tRNS))
|
||||||
|
|||||||
@@ -406,6 +406,8 @@ void RHSVtoRGB(RHSVColor *hsv, RColor *rgb);
|
|||||||
*/
|
*/
|
||||||
void RClearImage(RImage *image, RColor *color);
|
void RClearImage(RImage *image, RColor *color);
|
||||||
|
|
||||||
|
void RFillImage(RImage *image, RColor *color);
|
||||||
|
|
||||||
void RBevelImage(RImage *image, int bevel_type);
|
void RBevelImage(RImage *image, int bevel_type);
|
||||||
|
|
||||||
RImage *RRenderGradient(unsigned width, unsigned height, RColor *from,
|
RImage *RRenderGradient(unsigned width, unsigned height, RColor *from,
|
||||||
|
|||||||
Reference in New Issue
Block a user