Mar 13 16:54:12 CST 1998 Larry Ewing <lewing@gimp.org>

* app/image_render.c:  added some g_return_if_fails to the render
	funcs until I can come up with a better fix.
This commit is contained in:
Larry Ewing 1998-03-13 22:56:39 +00:00
parent 110c62ad99
commit 4d4e7ccd7b
4 changed files with 173 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Fri Mar 13 16:54:12 CST 1998 Larry Ewing <lewing@gimp.org>
* app/image_render.c: added some g_return_if_fails to the render
funcs until I can come up with a better fix.
Fri Mar 13 12:53:22 1998 Tim Janik <timj@gimp.org>

View File

@ -331,6 +331,8 @@ render_image_indexed_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = *src++ * 3;
@ -391,6 +393,8 @@ render_image_indexed_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -464,6 +468,8 @@ render_image_indexed_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -539,6 +545,8 @@ render_image_indexed_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -619,6 +627,8 @@ render_image_indexed_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = src[INDEXED_PIX] * 3;
@ -701,6 +711,8 @@ render_image_indexed_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -817,6 +829,8 @@ render_image_indexed_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -935,6 +949,8 @@ render_image_indexed_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1036,6 +1052,8 @@ render_image_gray_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
gray = dither_gray[*src++];
@ -1088,6 +1106,8 @@ render_image_gray_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1156,6 +1176,8 @@ render_image_gray_3 (RenderInfo *info)
{
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
@ -1228,6 +1250,8 @@ render_image_gray_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1297,6 +1321,8 @@ render_image_gray_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_G_PIX]];
@ -1364,6 +1390,8 @@ render_image_gray_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1455,6 +1483,8 @@ render_image_gray_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1548,6 +1578,8 @@ render_image_gray_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1633,6 +1665,8 @@ render_image_rgb_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
ra = dither_red[src[RED_PIX]];
@ -1691,6 +1725,8 @@ render_image_rgb_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1760,6 +1796,8 @@ render_image_rgb_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1831,6 +1869,8 @@ render_image_rgb_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1906,6 +1946,8 @@ render_image_rgb_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_PIX]];
@ -1984,6 +2026,16 @@ render_image_rgb_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
/* this catches the case when ye is too large, and we loop through
* regions where render_image_tile_fault returns NULL. I don't
* think this is a long term solution, but better to warn than to
* die.
*
* --Larry
*/
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2094,6 +2146,8 @@ render_image_rgb_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2206,6 +2260,8 @@ render_image_rgb_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{

View File

@ -331,6 +331,8 @@ render_image_indexed_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = *src++ * 3;
@ -391,6 +393,8 @@ render_image_indexed_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -464,6 +468,8 @@ render_image_indexed_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -539,6 +545,8 @@ render_image_indexed_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -619,6 +627,8 @@ render_image_indexed_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = src[INDEXED_PIX] * 3;
@ -701,6 +711,8 @@ render_image_indexed_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -817,6 +829,8 @@ render_image_indexed_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -935,6 +949,8 @@ render_image_indexed_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1036,6 +1052,8 @@ render_image_gray_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
gray = dither_gray[*src++];
@ -1088,6 +1106,8 @@ render_image_gray_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1156,6 +1176,8 @@ render_image_gray_3 (RenderInfo *info)
{
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
@ -1228,6 +1250,8 @@ render_image_gray_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1297,6 +1321,8 @@ render_image_gray_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_G_PIX]];
@ -1364,6 +1390,8 @@ render_image_gray_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1455,6 +1483,8 @@ render_image_gray_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1548,6 +1578,8 @@ render_image_gray_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1633,6 +1665,8 @@ render_image_rgb_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
ra = dither_red[src[RED_PIX]];
@ -1691,6 +1725,8 @@ render_image_rgb_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1760,6 +1796,8 @@ render_image_rgb_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1831,6 +1869,8 @@ render_image_rgb_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1906,6 +1946,8 @@ render_image_rgb_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_PIX]];
@ -1984,6 +2026,16 @@ render_image_rgb_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
/* this catches the case when ye is too large, and we loop through
* regions where render_image_tile_fault returns NULL. I don't
* think this is a long term solution, but better to warn than to
* die.
*
* --Larry
*/
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2094,6 +2146,8 @@ render_image_rgb_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2206,6 +2260,8 @@ render_image_rgb_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{

View File

@ -331,6 +331,8 @@ render_image_indexed_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = *src++ * 3;
@ -391,6 +393,8 @@ render_image_indexed_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -464,6 +468,8 @@ render_image_indexed_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -539,6 +545,8 @@ render_image_indexed_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -619,6 +627,8 @@ render_image_indexed_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
val = src[INDEXED_PIX] * 3;
@ -701,6 +711,8 @@ render_image_indexed_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -817,6 +829,8 @@ render_image_indexed_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -935,6 +949,8 @@ render_image_indexed_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1036,6 +1052,8 @@ render_image_gray_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
gray = dither_gray[*src++];
@ -1088,6 +1106,8 @@ render_image_gray_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1156,6 +1176,8 @@ render_image_gray_3 (RenderInfo *info)
{
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
@ -1228,6 +1250,8 @@ render_image_gray_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1297,6 +1321,8 @@ render_image_gray_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_G_PIX]];
@ -1364,6 +1390,8 @@ render_image_gray_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1455,6 +1483,8 @@ render_image_gray_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1548,6 +1578,8 @@ render_image_gray_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1633,6 +1665,8 @@ render_image_rgb_1 (RenderInfo *info)
dest = info->dest;
dither_matrix = ordered_dither_matrix[y & 0x7];
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
ra = dither_red[src[RED_PIX]];
@ -1691,6 +1725,8 @@ render_image_rgb_2 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1760,6 +1796,8 @@ render_image_rgb_3 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1831,6 +1869,8 @@ render_image_rgb_4 (RenderInfo *info)
src = info->src;
dest = info->dest;
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -1906,6 +1946,8 @@ render_image_rgb_a_1 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
for (x = info->x; x < xe; x++)
{
a = alpha[src[ALPHA_PIX]];
@ -1984,6 +2026,16 @@ render_image_rgb_a_2 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
/* this catches the case when ye is too large, and we loop through
* regions where render_image_tile_fault returns NULL. I don't
* think this is a long term solution, but better to warn than to
* die.
*
* --Larry
*/
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2094,6 +2146,8 @@ render_image_rgb_a_3 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{
@ -2206,6 +2260,8 @@ render_image_rgb_a_4 (RenderInfo *info)
dark_light = (y >> check_shift) + (info->x >> check_shift);
g_return_if_fail (src != NULL);
if (byte_order == GDK_LSB_FIRST)
for (x = info->x; x < xe; x++)
{