app/display/Makefile.am removed. It was a wrapper around nothing since we
2001-11-30 Michael Natterer <mitch@gimp.org> * app/display/Makefile.am * app/display/gximage.[ch]: removed. It was a wrapper around nothing since we use GdkRGB. * app/display/gimpdisplayshell-render.[ch]: added the render buf size defines here, added the #if 0'ed display filter stuff and the actual GdkRGB render stuff here too. * app/display/gimpdisplayshell.[ch]: added shell->render_buf as replacement for the global gximage buffer, renamed shell->scroll_gc to shell->render_gc and use it all over the place when rendering image data. * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-scroll.c: changed accordingly. * app/gui/gui.c: don't call gximage init/exit stuff.
This commit is contained in:

committed by
Michael Natterer

parent
bf860fd1af
commit
57157b4041
20
ChangeLog
20
ChangeLog
@ -1,3 +1,23 @@
|
||||
2001-11-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/display/Makefile.am
|
||||
* app/display/gximage.[ch]: removed. It was a wrapper around
|
||||
nothing since we use GdkRGB.
|
||||
|
||||
* app/display/gimpdisplayshell-render.[ch]: added the render
|
||||
buf size defines here, added the #if 0'ed display filter stuff
|
||||
and the actual GdkRGB render stuff here too.
|
||||
|
||||
* app/display/gimpdisplayshell.[ch]: added shell->render_buf as
|
||||
replacement for the global gximage buffer, renamed shell->scroll_gc
|
||||
to shell->render_gc and use it all over the place when rendering
|
||||
image data.
|
||||
|
||||
* app/display/gimpdisplayshell-callbacks.c
|
||||
* app/display/gimpdisplayshell-scroll.c: changed accordingly.
|
||||
|
||||
* app/gui/gui.c: don't call gximage init/exit stuff.
|
||||
|
||||
2001-11-30 Rebecca Walter <bex@gimp.org>
|
||||
|
||||
* app/gui/gradient-select.c
|
||||
|
@ -31,9 +31,6 @@ libappdisplay_a_SOURCES = @STRIP_BEGIN@ \
|
||||
gimpdisplayshell-scroll.h \
|
||||
gimpdisplayshell-selection.c \
|
||||
gimpdisplayshell-selection.h \
|
||||
\
|
||||
gximage.c \
|
||||
gximage.h \
|
||||
@STRIP_END@
|
||||
|
||||
AM_CPPFLAGS = @STRIP_BEGIN@ \
|
||||
|
@ -173,9 +173,9 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
|
||||
shell->disp_width = canvas->allocation.width;
|
||||
shell->disp_height = canvas->allocation.height;
|
||||
|
||||
/* create GC for scrolling */
|
||||
shell->scroll_gc = gdk_gc_new (shell->canvas->window);
|
||||
gdk_gc_set_exposures (shell->scroll_gc, TRUE);
|
||||
/* create GC for rendering */
|
||||
shell->render_gc = gdk_gc_new (shell->canvas->window);
|
||||
gdk_gc_set_exposures (shell->render_gc, TRUE);
|
||||
|
||||
/* set up the scrollbar observers */
|
||||
g_signal_connect (G_OBJECT (shell->hsbdata), "value_changed",
|
||||
|
@ -60,7 +60,6 @@
|
||||
#include "gimpdisplayshell-handlers.h"
|
||||
#include "gimpdisplayshell-render.h"
|
||||
#include "gimpdisplayshell-selection.h"
|
||||
#include "gximage.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
@ -207,7 +206,10 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
shell->cursor_format_str[0] = '\0';
|
||||
shell->cancelbutton = NULL;
|
||||
|
||||
shell->scroll_gc = NULL;
|
||||
shell->render_buf = g_malloc (GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH *
|
||||
GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT *
|
||||
3);
|
||||
shell->render_gc = NULL;
|
||||
|
||||
shell->icon_size = 32;
|
||||
shell->icon_idle_id = 0;
|
||||
@ -264,10 +266,16 @@ gimp_display_shell_destroy (GtkObject *object)
|
||||
gdisplay_color_detach_all (gdisp);
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
if (shell->scroll_gc)
|
||||
if (shell->render_buf)
|
||||
{
|
||||
gdk_gc_unref (shell->scroll_gc);
|
||||
shell->scroll_gc = NULL;
|
||||
g_free (shell->render_buf);
|
||||
shell->render_buf = NULL;
|
||||
}
|
||||
|
||||
if (shell->render_gc)
|
||||
{
|
||||
gdk_gc_unref (shell->render_gc);
|
||||
shell->render_gc = NULL;
|
||||
}
|
||||
|
||||
if (shell->icon_idle_id)
|
||||
@ -1983,16 +1991,6 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
gint dx, dy;
|
||||
gint i, j;
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
guchar *buf;
|
||||
gint bpp, bpl;
|
||||
GList *list;
|
||||
|
||||
buf = gximage_get_data ();
|
||||
bpp = gximage_get_bpp ();
|
||||
bpl = gximage_get_bpl ();
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
sx = SCALEX (shell->gdisp, shell->gdisp->gimage->width);
|
||||
sy = SCALEY (shell->gdisp, shell->gdisp->gimage->height);
|
||||
|
||||
@ -2058,16 +2056,17 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
y2 = shell->disp_yoffset + sy;
|
||||
}
|
||||
|
||||
/* display the image in GXIMAGE_WIDTH x GXIMAGE_HEIGHT sized chunks */
|
||||
for (i = y1; i < y2; i += GXIMAGE_HEIGHT)
|
||||
/* display the image in RENDER_BUF_WIDTH x RENDER_BUF_HEIGHT sized chunks */
|
||||
for (i = y1; i < y2; i += GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT)
|
||||
{
|
||||
for (j = x1; j < x2; j += GXIMAGE_WIDTH)
|
||||
for (j = x1; j < x2; j += GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH)
|
||||
{
|
||||
dx = MIN (x2 - j, GXIMAGE_WIDTH);
|
||||
dy = MIN (y2 - i, GXIMAGE_HEIGHT);
|
||||
dx = MIN (x2 - j, GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH);
|
||||
dy = MIN (y2 - i, GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT);
|
||||
|
||||
render_image (shell->gdisp,
|
||||
j - shell->disp_xoffset, i - shell->disp_yoffset,
|
||||
gimp_display_shell_render (shell,
|
||||
j - shell->disp_xoffset,
|
||||
i - shell->disp_yoffset,
|
||||
dx, dy);
|
||||
|
||||
#if 0
|
||||
@ -2078,20 +2077,6 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
dx, dy,
|
||||
0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
for (list = shell->cd_list; list; list = g_list_next (list))
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
|
||||
node->cd_convert (node->cd_ID, buf, dx, dy, bpp, bpl);
|
||||
}
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
gximage_put (shell->canvas->window,
|
||||
j, i, dx, dy,
|
||||
shell->offset_x,
|
||||
shell->offset_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,8 @@ struct _GimpDisplayShell
|
||||
gchar cursor_format_str[CURSOR_FORMAT_LENGTH];
|
||||
GtkWidget *cancelbutton; /* cancel button */
|
||||
|
||||
GdkGC *scroll_gc; /* GC for scrolling */
|
||||
guchar *render_buf; /* buffer for rendering the image */
|
||||
GdkGC *render_gc; /* GC for rendering the image */
|
||||
|
||||
gint icon_size; /* size of the icon pixmap */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
|
@ -34,21 +34,17 @@
|
||||
#include "gimpdisplay.h"
|
||||
#include "gimpdisplayshell.h"
|
||||
#include "gimpdisplayshell-render.h"
|
||||
#include "gximage.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
|
||||
|
||||
#define MAX_PREVIEW_SIZE 256 /* EEK */
|
||||
|
||||
|
||||
typedef struct _RenderInfo RenderInfo;
|
||||
|
||||
typedef void (* RenderFunc) (RenderInfo *info);
|
||||
|
||||
struct _RenderInfo
|
||||
{
|
||||
GimpDisplay *gdisp;
|
||||
GimpDisplayShell *shell;
|
||||
TileManager *src_tiles;
|
||||
guint *alpha;
|
||||
guchar *scale;
|
||||
@ -110,7 +106,7 @@ render_setup (GimpCheckType check_type,
|
||||
|
||||
/* allocate a buffer for arranging information from a row of tiles */
|
||||
if (! tile_buf)
|
||||
tile_buf = g_new (guchar, GXIMAGE_WIDTH * MAX_CHANNELS);
|
||||
tile_buf = g_new (guchar, GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH * MAX_CHANNELS);
|
||||
|
||||
if (! render_blend_dark_check)
|
||||
render_blend_dark_check = g_new (guchar, 65536);
|
||||
@ -146,6 +142,8 @@ render_setup (GimpCheckType check_type,
|
||||
g_free (render_empty_buf);
|
||||
g_free (render_temp_buf);
|
||||
|
||||
#define MAX_PREVIEW_SIZE 256 /* EEK */
|
||||
|
||||
/* calculate check buffer for previews */
|
||||
if (TRUE /* preview_size */)
|
||||
{
|
||||
@ -196,7 +194,7 @@ static void render_image_indexed (RenderInfo *info);
|
||||
static void render_image_indexed_a (RenderInfo *info);
|
||||
|
||||
static void render_image_init_info (RenderInfo *info,
|
||||
GimpDisplay *gdisp,
|
||||
GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
@ -227,7 +225,7 @@ static RenderFunc render_funcs[6] =
|
||||
/*****************************************************************/
|
||||
|
||||
void
|
||||
render_image (GimpDisplay *gdisp,
|
||||
gimp_display_shell_render (GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
@ -236,14 +234,18 @@ render_image (GimpDisplay *gdisp,
|
||||
RenderInfo info;
|
||||
gint image_type;
|
||||
|
||||
render_image_init_info (&info, gdisp, x, y, w, h);
|
||||
#ifdef DISPLAY_FILTERS
|
||||
GList *list;
|
||||
#endif
|
||||
|
||||
image_type = gimp_image_projection_type (gdisp->gimage);
|
||||
render_image_init_info (&info, shell, x, y, w, h);
|
||||
|
||||
image_type = gimp_image_projection_type (shell->gdisp->gimage);
|
||||
|
||||
if ((image_type < 0) || (image_type > 5))
|
||||
{
|
||||
g_message ("unknown gimage projection type: %d",
|
||||
gimp_image_projection_type (gdisp->gimage));
|
||||
gimp_image_projection_type (shell->gdisp->gimage));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -260,6 +262,34 @@ render_image (GimpDisplay *gdisp,
|
||||
g_warning ("using untested projection type %d", image_type);
|
||||
|
||||
(* render_funcs[image_type]) (&info);
|
||||
|
||||
#if 0
|
||||
#ifdef DISPLAY_FILTERS
|
||||
/* apply filters to the rendered projection */
|
||||
for (list = shell->cd_list; list; list = g_list_next (list))
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
|
||||
node->cd_convert (node->cd_ID,
|
||||
shell->render_buf,
|
||||
w, h,
|
||||
3,
|
||||
3 * GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH);
|
||||
}
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
#endif
|
||||
|
||||
/* put it to the screen */
|
||||
gdk_draw_rgb_image_dithalign (shell->canvas->window,
|
||||
shell->render_gc,
|
||||
x + shell->disp_xoffset,
|
||||
y + shell->disp_yoffset,
|
||||
w, h,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
shell->render_buf,
|
||||
3 * GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH,
|
||||
shell->offset_x,
|
||||
shell->offset_y);
|
||||
}
|
||||
|
||||
|
||||
@ -281,7 +311,7 @@ render_image_indexed (RenderInfo *info)
|
||||
gfloat error;
|
||||
gfloat step;
|
||||
|
||||
cmap = gimp_image_get_colormap (info->gdisp->gimage);
|
||||
cmap = gimp_image_get_colormap (info->shell->gdisp->gimage);
|
||||
|
||||
y = info->y;
|
||||
ye = info->y + info->h;
|
||||
@ -355,7 +385,7 @@ render_image_indexed_a (RenderInfo *info)
|
||||
gfloat error;
|
||||
gfloat step;
|
||||
|
||||
cmap = gimp_image_get_colormap (info->gdisp->gimage);
|
||||
cmap = gimp_image_get_colormap (info->shell->gdisp->gimage);
|
||||
alpha = info->alpha;
|
||||
|
||||
y = info->y;
|
||||
@ -737,38 +767,38 @@ render_image_rgb_a (RenderInfo *info)
|
||||
|
||||
static void
|
||||
render_image_init_info (RenderInfo *info,
|
||||
GimpDisplay *gdisp,
|
||||
GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h)
|
||||
{
|
||||
info->gdisp = gdisp;
|
||||
info->src_tiles = gimp_image_projection (gdisp->gimage);
|
||||
info->x = x + GIMP_DISPLAY_SHELL (gdisp->shell)->offset_x;
|
||||
info->y = y + GIMP_DISPLAY_SHELL (gdisp->shell)->offset_y;
|
||||
info->shell = shell;
|
||||
info->src_tiles = gimp_image_projection (shell->gdisp->gimage);
|
||||
info->x = x + shell->offset_x;
|
||||
info->y = y + shell->offset_y;
|
||||
info->w = w;
|
||||
info->h = h;
|
||||
info->scalex = SCALEFACTOR_X (gdisp);
|
||||
info->scaley = SCALEFACTOR_Y (gdisp);
|
||||
info->src_x = UNSCALEX (gdisp, info->x);
|
||||
info->src_y = UNSCALEY (gdisp, info->y);
|
||||
info->src_bpp = gimp_image_projection_bytes (gdisp->gimage);
|
||||
info->dest = gximage_get_data ();
|
||||
info->dest_bpp = gximage_get_bpp ();
|
||||
info->dest_bpl = gximage_get_bpl ();
|
||||
info->scalex = SCALEFACTOR_X (shell->gdisp);
|
||||
info->scaley = SCALEFACTOR_Y (shell->gdisp);
|
||||
info->src_x = UNSCALEX (shell->gdisp, info->x);
|
||||
info->src_y = UNSCALEY (shell->gdisp, info->y);
|
||||
info->src_bpp = gimp_image_projection_bytes (shell->gdisp->gimage);
|
||||
info->dest = shell->render_buf;
|
||||
info->dest_bpp = 3;
|
||||
info->dest_bpl = info->dest_bpp * GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH;
|
||||
info->dest_width = info->w * info->dest_bpp;
|
||||
info->byte_order = gximage_get_byte_order ();
|
||||
info->byte_order = GDK_MSB_FIRST;
|
||||
info->scale = render_image_accelerate_scaling (w, info->x, info->scalex);
|
||||
info->alpha = NULL;
|
||||
|
||||
switch (gimp_image_projection_type (gdisp->gimage))
|
||||
switch (gimp_image_projection_type (shell->gdisp->gimage))
|
||||
{
|
||||
case RGBA_GIMAGE:
|
||||
case GRAYA_GIMAGE:
|
||||
case INDEXEDA_GIMAGE:
|
||||
info->alpha =
|
||||
render_image_init_alpha (gimp_image_projection_opacity (gdisp->gimage));
|
||||
render_image_init_alpha (gimp_image_projection_opacity (shell->gdisp->gimage));
|
||||
break;
|
||||
default:
|
||||
/* nothing special needs doing */
|
||||
@ -809,17 +839,17 @@ render_image_accelerate_scaling (gint width,
|
||||
gint i;
|
||||
|
||||
if (! scale)
|
||||
scale = g_new (guchar, GXIMAGE_WIDTH + 1);
|
||||
scale = g_new (guchar, GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH + 1);
|
||||
|
||||
step = 1.0 / scalex;
|
||||
|
||||
error = start * step;
|
||||
error -= ((int)error) - step;
|
||||
error -= ((gint) error) - step;
|
||||
|
||||
for (i = 0; i <= width; i++)
|
||||
{
|
||||
scale[i] = ((int)error);
|
||||
error += step - (int)error;
|
||||
scale[i] = ((gint) error);
|
||||
error += step - (gint) error;
|
||||
}
|
||||
|
||||
return scale;
|
||||
|
@ -16,15 +16,20 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_DISPLAY_RENDER_H__
|
||||
#define __GIMP_DISPLAY_RENDER_H__
|
||||
#ifndef __GIMP_DISPLAY_SHELL_RENDER_H__
|
||||
#define __GIMP_DISPLAY_SHELL_RENDER_H__
|
||||
|
||||
|
||||
#define GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH 256
|
||||
#define GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT 256
|
||||
|
||||
|
||||
/* Functions */
|
||||
void render_setup (GimpCheckType check_type,
|
||||
GimpCheckSize check_size);
|
||||
void render_free (void);
|
||||
void render_image (GimpDisplay *gdisp,
|
||||
|
||||
void gimp_display_shell_render (GimpDisplayShell *shell,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
@ -40,4 +45,4 @@ extern guchar *render_blend_dark_check;
|
||||
extern guchar *render_blend_light_check;
|
||||
|
||||
|
||||
#endif /* __GIMP_DISPLAY_RENDER_H__ */
|
||||
#endif /* __GIMP_DISPLAY_SHELL_RENDER_H__ */
|
||||
|
@ -88,7 +88,7 @@ gimp_display_shell_scroll (GimpDisplayShell *shell,
|
||||
shell->offset_y += y_offset;
|
||||
|
||||
gdk_draw_drawable (shell->canvas->window,
|
||||
shell->scroll_gc,
|
||||
shell->render_gc,
|
||||
shell->canvas->window,
|
||||
src_x, src_y,
|
||||
dest_x, dest_y,
|
||||
|
@ -60,7 +60,6 @@
|
||||
#include "gimpdisplayshell-handlers.h"
|
||||
#include "gimpdisplayshell-render.h"
|
||||
#include "gimpdisplayshell-selection.h"
|
||||
#include "gximage.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
@ -207,7 +206,10 @@ gimp_display_shell_init (GimpDisplayShell *shell)
|
||||
shell->cursor_format_str[0] = '\0';
|
||||
shell->cancelbutton = NULL;
|
||||
|
||||
shell->scroll_gc = NULL;
|
||||
shell->render_buf = g_malloc (GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH *
|
||||
GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT *
|
||||
3);
|
||||
shell->render_gc = NULL;
|
||||
|
||||
shell->icon_size = 32;
|
||||
shell->icon_idle_id = 0;
|
||||
@ -264,10 +266,16 @@ gimp_display_shell_destroy (GtkObject *object)
|
||||
gdisplay_color_detach_all (gdisp);
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
if (shell->scroll_gc)
|
||||
if (shell->render_buf)
|
||||
{
|
||||
gdk_gc_unref (shell->scroll_gc);
|
||||
shell->scroll_gc = NULL;
|
||||
g_free (shell->render_buf);
|
||||
shell->render_buf = NULL;
|
||||
}
|
||||
|
||||
if (shell->render_gc)
|
||||
{
|
||||
gdk_gc_unref (shell->render_gc);
|
||||
shell->render_gc = NULL;
|
||||
}
|
||||
|
||||
if (shell->icon_idle_id)
|
||||
@ -1983,16 +1991,6 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
gint dx, dy;
|
||||
gint i, j;
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
guchar *buf;
|
||||
gint bpp, bpl;
|
||||
GList *list;
|
||||
|
||||
buf = gximage_get_data ();
|
||||
bpp = gximage_get_bpp ();
|
||||
bpl = gximage_get_bpl ();
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
sx = SCALEX (shell->gdisp, shell->gdisp->gimage->width);
|
||||
sy = SCALEY (shell->gdisp, shell->gdisp->gimage->height);
|
||||
|
||||
@ -2058,16 +2056,17 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
y2 = shell->disp_yoffset + sy;
|
||||
}
|
||||
|
||||
/* display the image in GXIMAGE_WIDTH x GXIMAGE_HEIGHT sized chunks */
|
||||
for (i = y1; i < y2; i += GXIMAGE_HEIGHT)
|
||||
/* display the image in RENDER_BUF_WIDTH x RENDER_BUF_HEIGHT sized chunks */
|
||||
for (i = y1; i < y2; i += GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT)
|
||||
{
|
||||
for (j = x1; j < x2; j += GXIMAGE_WIDTH)
|
||||
for (j = x1; j < x2; j += GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH)
|
||||
{
|
||||
dx = MIN (x2 - j, GXIMAGE_WIDTH);
|
||||
dy = MIN (y2 - i, GXIMAGE_HEIGHT);
|
||||
dx = MIN (x2 - j, GIMP_DISPLAY_SHELL_RENDER_BUF_WIDTH);
|
||||
dy = MIN (y2 - i, GIMP_DISPLAY_SHELL_RENDER_BUF_HEIGHT);
|
||||
|
||||
render_image (shell->gdisp,
|
||||
j - shell->disp_xoffset, i - shell->disp_yoffset,
|
||||
gimp_display_shell_render (shell,
|
||||
j - shell->disp_xoffset,
|
||||
i - shell->disp_yoffset,
|
||||
dx, dy);
|
||||
|
||||
#if 0
|
||||
@ -2078,20 +2077,6 @@ gimp_display_shell_display_area (GimpDisplayShell *shell,
|
||||
dx, dy,
|
||||
0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef DISPLAY_FILTERS
|
||||
for (list = shell->cd_list; list; list = g_list_next (list))
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
|
||||
node->cd_convert (node->cd_ID, buf, dx, dy, bpp, bpl);
|
||||
}
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
gximage_put (shell->canvas->window,
|
||||
j, i, dx, dy,
|
||||
shell->offset_x,
|
||||
shell->offset_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,8 @@ struct _GimpDisplayShell
|
||||
gchar cursor_format_str[CURSOR_FORMAT_LENGTH];
|
||||
GtkWidget *cancelbutton; /* cancel button */
|
||||
|
||||
GdkGC *scroll_gc; /* GC for scrolling */
|
||||
guchar *render_buf; /* buffer for rendering the image */
|
||||
GdkGC *render_gc; /* GC for rendering the image */
|
||||
|
||||
gint icon_size; /* size of the icon pixmap */
|
||||
guint icon_idle_id; /* ID of the idle-function */
|
||||
|
@ -1,137 +0,0 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "display-types.h"
|
||||
|
||||
#include "gximage.h"
|
||||
|
||||
|
||||
typedef struct _GXImage GXImage;
|
||||
|
||||
struct _GXImage
|
||||
{
|
||||
long width, height; /* width and height of ximage structure */
|
||||
|
||||
GdkVisual *visual; /* visual appropriate to our depth */
|
||||
GdkGC *gc; /* graphics context */
|
||||
|
||||
guchar *data;
|
||||
};
|
||||
|
||||
|
||||
/* The static gximages for drawing to windows */
|
||||
static GXImage *gximage = NULL;
|
||||
|
||||
#define QUANTUM 32
|
||||
|
||||
/* STATIC functions */
|
||||
|
||||
static GXImage *
|
||||
create_gximage (GdkVisual *visual,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GXImage * gximage;
|
||||
|
||||
gximage = g_new (GXImage, 1);
|
||||
|
||||
gximage->visual = visual;
|
||||
gximage->gc = NULL;
|
||||
|
||||
gximage->data = g_malloc (width * height * 3);
|
||||
|
||||
return gximage;
|
||||
}
|
||||
|
||||
static void
|
||||
delete_gximage (GXImage *gximage)
|
||||
{
|
||||
g_free (gximage->data);
|
||||
if (gximage->gc)
|
||||
gdk_gc_unref (gximage->gc);
|
||||
g_free (gximage);
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
|
||||
/* Function definitions */
|
||||
|
||||
void
|
||||
gximage_init (void)
|
||||
{
|
||||
gximage = create_gximage (gdk_rgb_get_visual (),
|
||||
GXIMAGE_WIDTH, GXIMAGE_HEIGHT);
|
||||
}
|
||||
|
||||
void
|
||||
gximage_free (void)
|
||||
{
|
||||
delete_gximage (gximage);
|
||||
}
|
||||
|
||||
guchar*
|
||||
gximage_get_data (void)
|
||||
{
|
||||
return gximage->data;
|
||||
}
|
||||
|
||||
int
|
||||
gximage_get_bpp (void)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
int
|
||||
gximage_get_bpl (void)
|
||||
{
|
||||
return 3 * GXIMAGE_WIDTH;
|
||||
}
|
||||
|
||||
int
|
||||
gximage_get_byte_order (void)
|
||||
{
|
||||
return GDK_MSB_FIRST;
|
||||
}
|
||||
|
||||
void
|
||||
gximage_put (GdkWindow *win, int x, int y, int w, int h, int xdith, int ydith)
|
||||
{
|
||||
/* create the GC if it doesn't yet exist */
|
||||
if (!gximage->gc)
|
||||
{
|
||||
gximage->gc = gdk_gc_new (win);
|
||||
gdk_gc_set_exposures (gximage->gc, TRUE);
|
||||
}
|
||||
|
||||
gdk_draw_rgb_image_dithalign (win,
|
||||
gximage->gc,
|
||||
x,
|
||||
y,
|
||||
w,
|
||||
h,
|
||||
/* todo: make configurable */
|
||||
GDK_RGB_DITHER_MAX,
|
||||
gximage->data,
|
||||
GXIMAGE_WIDTH * 3,
|
||||
xdith, ydith);
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __GXIMAGE_H__
|
||||
#define __GXIMAGE_H__
|
||||
|
||||
#define GXIMAGE_WIDTH 256
|
||||
#define GXIMAGE_HEIGHT 256
|
||||
|
||||
void gximage_init (void);
|
||||
void gximage_free (void);
|
||||
|
||||
void
|
||||
gximage_put (GdkWindow *win, int x, int y, int w, int h, int xdith, int ydith);
|
||||
guchar* gximage_get_data (void);
|
||||
int gximage_get_bpp (void);
|
||||
int gximage_get_bpl (void);
|
||||
int gximage_get_byte_order (void);
|
||||
|
||||
#endif /* __GXIMAGE_H__ */
|
@ -38,7 +38,6 @@
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
#include "display/gimpdisplayshell.h"
|
||||
#include "display/gimpdisplayshell-render.h"
|
||||
#include "display/gximage.h"
|
||||
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpitemfactory.h"
|
||||
@ -249,7 +248,6 @@ gui_init (Gimp *gimp)
|
||||
color_display_init ();
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
gximage_init ();
|
||||
render_setup (gimprc.transparency_type, gimprc.transparency_size);
|
||||
|
||||
dialogs_init (gimp);
|
||||
@ -314,7 +312,6 @@ gui_exit (Gimp *gimp)
|
||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||
|
||||
menus_exit (gimp);
|
||||
gximage_free ();
|
||||
render_free ();
|
||||
|
||||
dialogs_exit (gimp);
|
||||
|
Reference in New Issue
Block a user