Commit 12212f90 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

prefixed all global variables with "render_" (we had a global variable

2001-01-30  Michael Natterer  <mitch@gimp.org>

	* app/image_render.[ch]: prefixed all global variables with
	"render_" (we had a global variable named "temp_buf", brrrr),
	general cleanup.

	* app/colormap_dialog.c
	* app/layers_dialog.c: changed accordingly.
parent 14bc89f1
2001-01-30 Michael Natterer <mitch@gimp.org>
* app/image_render.[ch]: prefixed all global variables with
"render_" (we had a global variable named "temp_buf", brrrr),
general cleanup.
* app/colormap_dialog.c
* app/layers_dialog.c: changed accordingly.
2001-01-29 Michael Natterer <mitch@gimp.org>
* app/dialog_types.h: removed because it was unused.
......
......@@ -606,7 +606,7 @@ ipal_draw (GimpColormapDialog* ipal)
for (l = j * cellsize; l < xn * cellsize; l++)
for (b = 0; b < 3; b++)
row[l * 3 + b] = ((((i * cellsize + k) & 0x4) ? (l) : (l + 0x4)) & 0x4) ?
blend_light_check[0] : blend_dark_check[0];
render_blend_light_check[0] : render_blend_dark_check[0];
gtk_preview_draw_row (ipal->palette, row, 0,
i * cellsize + k, cellsize * xn);
......@@ -709,7 +709,8 @@ ipal_clear (GimpColormapDialog* ipal)
for (j = 0; j < width; j++)
{
row[j * 3 + 0] = row[j * 3 + 1] = row[j * 3 + 2] =
((j + offset) & 0x4) ? blend_light_check[0] : blend_dark_check[0];
((j + offset) & 0x4) ?
render_blend_light_check[0] : render_blend_dark_check[0];
}
for (j = 0; j < 4 && i+j < height; j++)
......
This diff is collapsed.
......@@ -22,35 +22,42 @@
/* Transparency representation */
#define LIGHT_CHECKS 0
#define GRAY_CHECKS 1
#define DARK_CHECKS 2
#define WHITE_ONLY 3
#define GRAY_ONLY 4
#define BLACK_ONLY 5
typedef enum
{
LIGHT_CHECKS = 0,
GRAY_CHECKS = 1,
DARK_CHECKS = 2,
WHITE_ONLY = 3,
GRAY_ONLY = 4,
BLACK_ONLY = 5
} GimpCheckType;
typedef enum
{
SMALL_CHECKS = 0,
MEDIUM_CHECKS = 1,
LARGE_CHECKS = 2
} GimpCheckSize;
#define SMALL_CHECKS 0
#define MEDIUM_CHECKS 1
#define LARGE_CHECKS 2
/* Functions */
void render_setup (gint check_type,
gint check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void render_setup (GimpCheckType check_type,
GimpCheckSize check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
/*
* Extern variables
*/
extern guchar *check_buf;
extern guchar *empty_buf;
extern guchar *temp_buf;
extern guchar *blend_dark_check;
extern guchar *blend_light_check;
extern guchar *render_check_buf;
extern guchar *render_empty_buf;
extern guchar *render_temp_buf;
extern guchar *render_blend_dark_check;
extern guchar *render_blend_light_check;
#endif /* __IMAGE_RENDER_H__ */
This diff is collapsed.
......@@ -22,35 +22,42 @@
/* Transparency representation */
#define LIGHT_CHECKS 0
#define GRAY_CHECKS 1
#define DARK_CHECKS 2
#define WHITE_ONLY 3
#define GRAY_ONLY 4
#define BLACK_ONLY 5
typedef enum
{
LIGHT_CHECKS = 0,
GRAY_CHECKS = 1,
DARK_CHECKS = 2,
WHITE_ONLY = 3,
GRAY_ONLY = 4,
BLACK_ONLY = 5
} GimpCheckType;
typedef enum
{
SMALL_CHECKS = 0,
MEDIUM_CHECKS = 1,
LARGE_CHECKS = 2
} GimpCheckSize;
#define SMALL_CHECKS 0
#define MEDIUM_CHECKS 1
#define LARGE_CHECKS 2
/* Functions */
void render_setup (gint check_type,
gint check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void render_setup (GimpCheckType check_type,
GimpCheckSize check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
/*
* Extern variables
*/
extern guchar *check_buf;
extern guchar *empty_buf;
extern guchar *temp_buf;
extern guchar *blend_dark_check;
extern guchar *blend_light_check;
extern guchar *render_check_buf;
extern guchar *render_empty_buf;
extern guchar *render_temp_buf;
extern guchar *render_blend_dark_check;
extern guchar *render_blend_light_check;
#endif /* __IMAGE_RENDER_H__ */
......@@ -606,7 +606,7 @@ ipal_draw (GimpColormapDialog* ipal)
for (l = j * cellsize; l < xn * cellsize; l++)
for (b = 0; b < 3; b++)
row[l * 3 + b] = ((((i * cellsize + k) & 0x4) ? (l) : (l + 0x4)) & 0x4) ?
blend_light_check[0] : blend_dark_check[0];
render_blend_light_check[0] : render_blend_dark_check[0];
gtk_preview_draw_row (ipal->palette, row, 0,
i * cellsize + k, cellsize * xn);
......@@ -709,7 +709,8 @@ ipal_clear (GimpColormapDialog* ipal)
for (j = 0; j < width; j++)
{
row[j * 3 + 0] = row[j * 3 + 1] = row[j * 3 + 2] =
((j + offset) & 0x4) ? blend_light_check[0] : blend_dark_check[0];
((j + offset) & 0x4) ?
render_blend_light_check[0] : render_blend_dark_check[0];
}
for (j = 0; j < 4 && i+j < height; j++)
......
......@@ -775,13 +775,13 @@ render_preview (TempBuf *preview_buf,
if (has_alpha)
{
buf = check_buf;
buf = render_check_buf;
alpha = ((color) ? ALPHA_PIX :
((channel != -1) ? (preview_buf->bytes - 1) :
ALPHA_G_PIX));
}
else
buf = empty_buf;
buf = render_empty_buf;
x1 = CLAMP (preview_buf->x, 0, width);
y1 = CLAMP (preview_buf->y, 0, height);
......@@ -815,7 +815,7 @@ render_preview (TempBuf *preview_buf,
/* Handle the leading transparency */
for (j = 0; j < x1; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
/* The stuff in the middle */
s = src;
......@@ -829,28 +829,28 @@ render_preview (TempBuf *preview_buf,
if ((j + offset) & 0x4)
{
temp_buf[j * 3 + 0] =
blend_dark_check [(a | s[RED_PIX])];
temp_buf[j * 3 + 1] =
blend_dark_check [(a | s[GREEN_PIX])];
temp_buf[j * 3 + 2] =
blend_dark_check [(a | s[BLUE_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_dark_check [(a | s[RED_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_dark_check [(a | s[GREEN_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_dark_check [(a | s[BLUE_PIX])];
}
else
{
temp_buf[j * 3 + 0] =
blend_light_check [(a | s[RED_PIX])];
temp_buf[j * 3 + 1] =
blend_light_check [(a | s[GREEN_PIX])];
temp_buf[j * 3 + 2] =
blend_light_check [(a | s[BLUE_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_light_check [(a | s[RED_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_light_check [(a | s[GREEN_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_light_check [(a | s[BLUE_PIX])];
}
}
else
{
temp_buf[j * 3 + 0] = s[RED_PIX];
temp_buf[j * 3 + 1] = s[GREEN_PIX];
temp_buf[j * 3 + 2] = s[BLUE_PIX];
render_temp_buf[j * 3 + 0] = s[RED_PIX];
render_temp_buf[j * 3 + 1] = s[GREEN_PIX];
render_temp_buf[j * 3 + 2] = s[BLUE_PIX];
}
}
else
......@@ -863,43 +863,43 @@ render_preview (TempBuf *preview_buf,
{
if (color_buf)
{
temp_buf[j * 3 + 0] =
blend_dark_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 1] =
blend_dark_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 2] =
blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_dark_check [(a | s[GRAY_PIX])];
}
else
temp_buf[j] =
blend_dark_check [(a | s[GRAY_PIX + channel])];
render_temp_buf[j] =
render_blend_dark_check [(a | s[GRAY_PIX + channel])];
}
else
{
if (color_buf)
{
temp_buf[j * 3 + 0] =
blend_light_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 1] =
blend_light_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 2] =
blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_light_check [(a | s[GRAY_PIX])];
}
else
temp_buf[j] =
blend_light_check [(a | s[GRAY_PIX + channel])];
render_temp_buf[j] =
render_blend_light_check [(a | s[GRAY_PIX + channel])];
}
}
else
{
if (color_buf)
{
temp_buf[j * 3 + 0] = s[GRAY_PIX];
temp_buf[j * 3 + 1] = s[GRAY_PIX];
temp_buf[j * 3 + 2] = s[GRAY_PIX];
render_temp_buf[j * 3 + 0] = s[GRAY_PIX];
render_temp_buf[j * 3 + 1] = s[GRAY_PIX];
render_temp_buf[j * 3 + 2] = s[GRAY_PIX];
}
else
temp_buf[j] = s[GRAY_PIX + channel];
render_temp_buf[j] = s[GRAY_PIX + channel];
}
}
......@@ -909,7 +909,7 @@ render_preview (TempBuf *preview_buf,
/* Handle the trailing transparency */
for (j = x2; j < width; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
src += rowstride;
}
......@@ -917,11 +917,11 @@ render_preview (TempBuf *preview_buf,
{
for (j = 0; j < width; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
}
gtk_preview_draw_row (GTK_PREVIEW (preview_widget),
temp_buf, 0, i, width);
render_temp_buf, 0, i, width);
}
}
......
This diff is collapsed.
......@@ -22,35 +22,42 @@
/* Transparency representation */
#define LIGHT_CHECKS 0
#define GRAY_CHECKS 1
#define DARK_CHECKS 2
#define WHITE_ONLY 3
#define GRAY_ONLY 4
#define BLACK_ONLY 5
typedef enum
{
LIGHT_CHECKS = 0,
GRAY_CHECKS = 1,
DARK_CHECKS = 2,
WHITE_ONLY = 3,
GRAY_ONLY = 4,
BLACK_ONLY = 5
} GimpCheckType;
typedef enum
{
SMALL_CHECKS = 0,
MEDIUM_CHECKS = 1,
LARGE_CHECKS = 2
} GimpCheckSize;
#define SMALL_CHECKS 0
#define MEDIUM_CHECKS 1
#define LARGE_CHECKS 2
/* Functions */
void render_setup (gint check_type,
gint check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void render_setup (GimpCheckType check_type,
GimpCheckSize check_size);
void render_free (void);
void render_image (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
/*
* Extern variables
*/
extern guchar *check_buf;
extern guchar *empty_buf;
extern guchar *temp_buf;
extern guchar *blend_dark_check;
extern guchar *blend_light_check;
extern guchar *render_check_buf;
extern guchar *render_empty_buf;
extern guchar *render_temp_buf;
extern guchar *render_blend_dark_check;
extern guchar *render_blend_light_check;
#endif /* __IMAGE_RENDER_H__ */
......@@ -775,13 +775,13 @@ render_preview (TempBuf *preview_buf,
if (has_alpha)
{
buf = check_buf;
buf = render_check_buf;
alpha = ((color) ? ALPHA_PIX :
((channel != -1) ? (preview_buf->bytes - 1) :
ALPHA_G_PIX));
}
else
buf = empty_buf;
buf = render_empty_buf;
x1 = CLAMP (preview_buf->x, 0, width);
y1 = CLAMP (preview_buf->y, 0, height);
......@@ -815,7 +815,7 @@ render_preview (TempBuf *preview_buf,
/* Handle the leading transparency */
for (j = 0; j < x1; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
/* The stuff in the middle */
s = src;
......@@ -829,28 +829,28 @@ render_preview (TempBuf *preview_buf,
if ((j + offset) & 0x4)
{
temp_buf[j * 3 + 0] =
blend_dark_check [(a | s[RED_PIX])];
temp_buf[j * 3 + 1] =
blend_dark_check [(a | s[GREEN_PIX])];
temp_buf[j * 3 + 2] =
blend_dark_check [(a | s[BLUE_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_dark_check [(a | s[RED_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_dark_check [(a | s[GREEN_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_dark_check [(a | s[BLUE_PIX])];
}
else
{
temp_buf[j * 3 + 0] =
blend_light_check [(a | s[RED_PIX])];
temp_buf[j * 3 + 1] =
blend_light_check [(a | s[GREEN_PIX])];
temp_buf[j * 3 + 2] =
blend_light_check [(a | s[BLUE_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_light_check [(a | s[RED_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_light_check [(a | s[GREEN_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_light_check [(a | s[BLUE_PIX])];
}
}
else
{
temp_buf[j * 3 + 0] = s[RED_PIX];
temp_buf[j * 3 + 1] = s[GREEN_PIX];
temp_buf[j * 3 + 2] = s[BLUE_PIX];
render_temp_buf[j * 3 + 0] = s[RED_PIX];
render_temp_buf[j * 3 + 1] = s[GREEN_PIX];
render_temp_buf[j * 3 + 2] = s[BLUE_PIX];
}
}
else
......@@ -863,43 +863,43 @@ render_preview (TempBuf *preview_buf,
{
if (color_buf)
{
temp_buf[j * 3 + 0] =
blend_dark_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 1] =
blend_dark_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 2] =
blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_dark_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_dark_check [(a | s[GRAY_PIX])];
}
else
temp_buf[j] =
blend_dark_check [(a | s[GRAY_PIX + channel])];
render_temp_buf[j] =
render_blend_dark_check [(a | s[GRAY_PIX + channel])];
}
else
{
if (color_buf)
{
temp_buf[j * 3 + 0] =
blend_light_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 1] =
blend_light_check [(a | s[GRAY_PIX])];
temp_buf[j * 3 + 2] =
blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 0] =
render_blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 1] =
render_blend_light_check [(a | s[GRAY_PIX])];
render_temp_buf[j * 3 + 2] =
render_blend_light_check [(a | s[GRAY_PIX])];
}
else
temp_buf[j] =
blend_light_check [(a | s[GRAY_PIX + channel])];
render_temp_buf[j] =
render_blend_light_check [(a | s[GRAY_PIX + channel])];
}
}
else
{
if (color_buf)
{
temp_buf[j * 3 + 0] = s[GRAY_PIX];
temp_buf[j * 3 + 1] = s[GRAY_PIX];
temp_buf[j * 3 + 2] = s[GRAY_PIX];
render_temp_buf[j * 3 + 0] = s[GRAY_PIX];
render_temp_buf[j * 3 + 1] = s[GRAY_PIX];
render_temp_buf[j * 3 + 2] = s[GRAY_PIX];
}
else
temp_buf[j] = s[GRAY_PIX + channel];
render_temp_buf[j] = s[GRAY_PIX + channel];
}
}
......@@ -909,7 +909,7 @@ render_preview (TempBuf *preview_buf,
/* Handle the trailing transparency */
for (j = x2; j < width; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
src += rowstride;
}
......@@ -917,11 +917,11 @@ render_preview (TempBuf *preview_buf,
{
for (j = 0; j < width; j++)
for (b = 0; b < image_bytes; b++)
temp_buf[j * image_bytes + b] = cb[j * 3 + b];
render_temp_buf[j * image_bytes + b] = cb[j * 3 + b];
}
gtk_preview_draw_row (GTK_PREVIEW (preview_widget),
temp_buf, 0, i, width);
render_temp_buf, 0, i, width);
}
}
......
......@@ -606,7 +606,7 @@ ipal_draw (GimpColormapDialog* ipal)
for (l = j * cellsize; l < xn * cellsize; l++)
for (b = 0; b < 3; b++)
row[l * 3 + b] = ((((i * cellsize + k) & 0x4) ? (l) : (l + 0x4)) & 0x4) ?
blend_light_check[0] : blend_dark_check[0];
render_blend_light_check[0] : render_blend_dark_check[0];
gtk_preview_draw_row (ipal->palette, row, 0,
i * cellsize + k, cellsize * xn);
......@@ -709,7 +709,8 @@ ipal_clear (GimpColormapDialog* ipal)
for (j = 0; j < width; j++)
{
row[j * 3 + 0] = row[j * 3 + 1] = row[j * 3 + 2] =
((j + offset) & 0x4) ? blend_light_check[0] : blend_dark_check[0];
((j + offset) & 0x4) ?
render_blend_light_check[0] : render_blend_dark_check[0];
}
for (j = 0; j < 4 && i+j < height; j++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment