GimpPreview

Name

GimpPreview -- 

Synopsis



#define     PREVIEW_FIXED_SIZE
#define     PREVIEW_DEFAULT_SIZE
struct      GimpPreviewEvent;
GtkWidget*  gimp_preview_new                (GimpDrawable *drawable);
GtkWidget*  gimp_preview_new_with_args      (GimpDrawable *drawable,
                                             gint preview_size,
                                             gdouble scale_amount,
                                             gint allow_scale);
void        gimp_preview_update             (GimpPreview *preview);
gboolean    gimp_preview_draw_row           (GimpPreview *preview,
                                             const gint event_id,
                                             GimpImageType type,
                                             const gint row,
                                             const guchar *const data);
gboolean    gimp_preview_draw_unscaled_row  (GimpPreview *preview,
                                             const gint event_id,
                                             GimpImageType type,
                                             const gint row,
                                             const guchar *const data);
void        gimp_preview_force_redraw       (GimpPreview *preview);
gboolean    gimp_preview_progress_set_fraction
                                            (GimpPreview *preview,
                                             const gint event_id,
                                             double fraction);

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkContainer
                     +----GimpPreview

Signal Prototypes


"preview-changed"
            void        user_function      (GimpPreview *gimppreview,
                                            gpointer user_data);
"update-preview"
            void        user_function      (GimpPreview *gimppreview,
                                            gpointer arg1,
                                            gpointer user_data);

Description

Details

PREVIEW_FIXED_SIZE

#define PREVIEW_FIXED_SIZE           0


PREVIEW_DEFAULT_SIZE

#define PREVIEW_DEFAULT_SIZE         -1


struct GimpPreviewEvent

struct GimpPreviewEvent
{
  gint event_id;                /* Id of this event */
  gdouble scale;                /* Scale of preview */

  /* Left/Top of requested unscaled data in image coordinates */
  gint image_x;
  gint image_y;

  /* Width/Height of requested unscaled data in image coordinates */
  gint image_width;
  gint image_height;

  /* Left/Top of preview in preview coordinates */
  gint preview_x;
  gint preview_y;

  /* Width/Height of the preview */
  gint preview_width;
  gint preview_height;

  /* Contains scaled image data as RGBA (4 bytes per pixel).
     The size of the array is 4 * preview_height * preview_width bytes */
  guchar *scaled_data;
};


gimp_preview_new ()

GtkWidget*  gimp_preview_new                (GimpDrawable *drawable);


gimp_preview_new_with_args ()

GtkWidget*  gimp_preview_new_with_args      (GimpDrawable *drawable,
                                             gint preview_size,
                                             gdouble scale_amount,
                                             gint allow_scale);


gimp_preview_update ()

void        gimp_preview_update             (GimpPreview *preview);


gimp_preview_draw_row ()

gboolean    gimp_preview_draw_row           (GimpPreview *preview,
                                             const gint event_id,
                                             GimpImageType type,
                                             const gint row,
                                             const guchar *const data);

Draw one scaled row of data in the preview. This function handles conversion to RGB and checkerboarding of transparent areas.


gimp_preview_draw_unscaled_row ()

gboolean    gimp_preview_draw_unscaled_row  (GimpPreview *preview,
                                             const gint event_id,
                                             GimpImageType type,
                                             const gint row,
                                             const guchar *const data);

Draw one unscaled row of data in the preview. This function handles scaling, conversion to RGB and checkerboarding of transparent areas. A nice feature is that this function will draw several lines of the preview when scale > 1.


gimp_preview_force_redraw ()

void        gimp_preview_force_redraw       (GimpPreview *preview);


gimp_preview_progress_set_fraction ()

gboolean    gimp_preview_progress_set_fraction
                                            (GimpPreview *preview,
                                             const gint event_id,
                                             double fraction);

Set the progress bar of the preview to fraction completed.

Signals

The "preview-changed" signal

void        user_function                  (GimpPreview *gimppreview,
                                            gpointer user_data);


The "update-preview" signal

void        user_function                  (GimpPreview *gimppreview,
                                            gpointer arg1,
                                            gpointer user_data);