marco 1.29.1
Window manager
Loading...
Searching...
No Matches
gradient.c File Reference
View source
#include "config.h"
#include <string.h>
#include "gradient.h"
Include dependency graph for gradient.c:

Macros

#define RGBA_SCALING   16777215.0 /* 0xffffff */
 

Functions

static void free_buffer (guchar *pixels, gpointer data)
 SECTION: gradient @title: Gradients @short_description: Metacity gradient rendering.
 
static GdkPixbuf * blank_pixbuf (int width, int height)
 
static GdkPixbuf * meta_gradient_create_horizontal (int width, int height, const GdkRGBA *from, const GdkRGBA *to)
 
static GdkPixbuf * meta_gradient_create_vertical (int width, int height, const GdkRGBA *from, const GdkRGBA *to)
 
static GdkPixbuf * meta_gradient_create_diagonal (int width, int height, const GdkRGBA *from, const GdkRGBA *to)
 
static GdkPixbuf * meta_gradient_create_multi_horizontal (int width, int height, const GdkRGBA *colors, int count)
 
static GdkPixbuf * meta_gradient_create_multi_vertical (int width, int height, const GdkRGBA *colors, int count)
 
static GdkPixbuf * meta_gradient_create_multi_diagonal (int width, int height, const GdkRGBA *colors, int count)
 
static void simple_multiply_alpha (GdkPixbuf *pixbuf, guchar alpha)
 
static void meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf, const unsigned char *alphas, int n_alphas)
 
GdkPixbuf * meta_gradient_create_simple (int width, int height, const GdkRGBA *from, const GdkRGBA *to, MetaGradientType style)
 meta_gradient_create_simple: @width: Width in pixels @height: Height in pixels @from: Starting color @to: Ending color @style: Gradient style
 
GdkPixbuf * meta_gradient_create_multi (int width, int height, const GdkRGBA *colors, int n_colors, MetaGradientType style)
 meta_gradient_create_multi: @width: Width in pixels @height: Height in pixels @colors: (array length=n_colors): Array of colors @n_colors: Number of colors @style: Gradient style
 
GdkPixbuf * meta_gradient_create_interwoven (int width, int height, const GdkRGBA colors1[2], int thickness1, const GdkRGBA colors2[2], int thickness2)
 meta_gradient_create_interwoven: (skip) @width: Width in pixels @height: Height in pixels @colors1: Array of colors @thickness1: Thickness @colors2: Array of colors @thickness2: Thickness
 
void meta_gradient_add_alpha (GdkPixbuf *pixbuf, const guchar *alphas, int n_alphas, MetaGradientType type)
 

Macro Definition Documentation

◆ RGBA_SCALING

#define RGBA_SCALING   16777215.0 /* 0xffffff */

Function Documentation

◆ blank_pixbuf()

static GdkPixbuf * blank_pixbuf ( int  width,
int  height 
)
static

References free_buffer(), NULL, and TRUE.

Referenced by meta_gradient_create_diagonal(), meta_gradient_create_horizontal(), meta_gradient_create_interwoven(), meta_gradient_create_multi_horizontal(), meta_gradient_create_multi_vertical(), and meta_gradient_create_vertical().

Here is the call graph for this function:

◆ free_buffer()

static void free_buffer ( guchar *  pixels,
gpointer  data 
)
static

SECTION: gradient @title: Gradients @short_description: Metacity gradient rendering.

Referenced by blank_pixbuf().

◆ meta_gradient_add_alpha()

void meta_gradient_add_alpha ( GdkPixbuf *  pixbuf,
const guchar *  alphas,
int  n_alphas,
MetaGradientType  type 
)

References meta_gradient_add_alpha_horizontal(), META_GRADIENT_DIAGONAL, META_GRADIENT_HORIZONTAL, META_GRADIENT_LAST, and META_GRADIENT_VERTICAL.

Referenced by apply_alpha(), draw_op_as_pixbuf(), and render_simple().

Here is the call graph for this function:

◆ meta_gradient_add_alpha_horizontal()

static void meta_gradient_add_alpha_horizontal ( GdkPixbuf *  pixbuf,
const unsigned char *  alphas,
int  n_alphas 
)
static

References simple_multiply_alpha().

Referenced by meta_gradient_add_alpha().

Here is the call graph for this function:

◆ meta_gradient_create_diagonal()

static GdkPixbuf * meta_gradient_create_diagonal ( int  width,
int  height,
const GdkRGBA *  from,
const GdkRGBA *  to 
)
static

References blank_pixbuf(), meta_gradient_create_horizontal(), meta_gradient_create_vertical(), and NULL.

Referenced by meta_gradient_create_simple().

Here is the call graph for this function:

◆ meta_gradient_create_horizontal()

static GdkPixbuf * meta_gradient_create_horizontal ( int  width,
int  height,
const GdkRGBA *  from,
const GdkRGBA *  to 
)
static

References blank_pixbuf(), and NULL.

Referenced by meta_gradient_create_diagonal(), meta_gradient_create_multi_diagonal(), and meta_gradient_create_simple().

Here is the call graph for this function:

◆ meta_gradient_create_interwoven()

GdkPixbuf * meta_gradient_create_interwoven ( int  width,
int  height,
const GdkRGBA  colors1[2],
int  thickness1,
const GdkRGBA  colors2[2],
int  thickness2 
)

meta_gradient_create_interwoven: (skip) @width: Width in pixels @height: Height in pixels @colors1: Array of colors @thickness1: Thickness @colors2: Array of colors @thickness2: Thickness

Interwoven essentially means we have two vertical gradients, cut into horizontal strips of the given thickness, and then the strips are alternated. I'm not sure what it's good for, just copied since WindowMaker had it.

References blank_pixbuf(), NULL, and RGBA_SCALING.

Referenced by render_interwoven_func().

Here is the call graph for this function:

◆ meta_gradient_create_multi()

GdkPixbuf * meta_gradient_create_multi ( int  width,
int  height,
const GdkRGBA *  colors,
int  n_colors,
MetaGradientType  style 
)

meta_gradient_create_multi: @width: Width in pixels @height: Height in pixels @colors: (array length=n_colors): Array of colors @n_colors: Number of colors @style: Gradient style

Returns: (transfer full): A new multi-step linear gradient

References meta_gradient_create_multi_diagonal(), meta_gradient_create_multi_horizontal(), meta_gradient_create_multi_vertical(), meta_gradient_create_simple(), META_GRADIENT_DIAGONAL, META_GRADIENT_HORIZONTAL, META_GRADIENT_LAST, META_GRADIENT_VERTICAL, and NULL.

Referenced by render_multi().

Here is the call graph for this function:

◆ meta_gradient_create_multi_diagonal()

static GdkPixbuf * meta_gradient_create_multi_diagonal ( int  width,
int  height,
const GdkRGBA *  colors,
int  count 
)
static

References FALSE, meta_gradient_create_horizontal(), meta_gradient_create_multi_horizontal(), meta_gradient_create_multi_vertical(), and NULL.

Referenced by meta_gradient_create_multi().

Here is the call graph for this function:

◆ meta_gradient_create_multi_horizontal()

static GdkPixbuf * meta_gradient_create_multi_horizontal ( int  width,
int  height,
const GdkRGBA *  colors,
int  count 
)
static

References blank_pixbuf(), and NULL.

Referenced by meta_gradient_create_multi(), and meta_gradient_create_multi_diagonal().

Here is the call graph for this function:

◆ meta_gradient_create_multi_vertical()

static GdkPixbuf * meta_gradient_create_multi_vertical ( int  width,
int  height,
const GdkRGBA *  colors,
int  count 
)
static

References blank_pixbuf(), and NULL.

Referenced by meta_gradient_create_multi(), and meta_gradient_create_multi_diagonal().

Here is the call graph for this function:

◆ meta_gradient_create_simple()

GdkPixbuf * meta_gradient_create_simple ( int  width,
int  height,
const GdkRGBA *  from,
const GdkRGBA *  to,
MetaGradientType  style 
)

meta_gradient_create_simple: @width: Width in pixels @height: Height in pixels @from: Starting color @to: Ending color @style: Gradient style

Returns: (transfer full): A new linear gradient

References meta_gradient_create_diagonal(), meta_gradient_create_horizontal(), meta_gradient_create_vertical(), META_GRADIENT_DIAGONAL, META_GRADIENT_HORIZONTAL, META_GRADIENT_LAST, META_GRADIENT_VERTICAL, and NULL.

Referenced by meta_gradient_create_multi(), and render_simple().

Here is the call graph for this function:

◆ meta_gradient_create_vertical()

static GdkPixbuf * meta_gradient_create_vertical ( int  width,
int  height,
const GdkRGBA *  from,
const GdkRGBA *  to 
)
static

References blank_pixbuf(), and NULL.

Referenced by meta_gradient_create_diagonal(), and meta_gradient_create_simple().

Here is the call graph for this function:

◆ simple_multiply_alpha()

static void simple_multiply_alpha ( GdkPixbuf *  pixbuf,
guchar  alpha 
)
static