コード例 #1
0
static gboolean apply_fliprotate(fliprotate_settings settings, image_output out) 
{
    gboolean success = TRUE;
    
    if (settings->flip_h) {
        // do horizontal flip 
        success = gimp_image_flip (
            out->image_id,
            GIMP_ORIENTATION_HORIZONTAL
        );
    }
    
    if (settings->flip_v) {
        // do vertical flip 
        success = gimp_image_flip (
            out->image_id,
            GIMP_ORIENTATION_VERTICAL
        );
    }
    
    if (settings->rotate) {
        // do rotation 
        success = gimp_image_rotate (
            out->image_id,
            settings->rotation_type
        );
    }
    
    return success;
}
コード例 #2
0
ファイル: jpeg-exif.c プロジェクト: jdburton/gimp-osx
void
jpeg_exif_rotate (gint32 image_ID,
                  gint   orientation)
{
  switch (orientation)
    {
    case 1:  /* standard orientation, do nothing */
      break;

    case 2:  /* flipped right-left               */
      gimp_image_flip (image_ID, GIMP_ORIENTATION_HORIZONTAL);
      break;

    case 3:  /* rotated 180                      */
      gimp_image_rotate (image_ID, GIMP_ROTATE_180);
      break;

    case 4:  /* flipped top-bottom               */
      gimp_image_flip (image_ID, GIMP_ORIENTATION_VERTICAL);
      break;

    case 5:  /* flipped diagonally around '\'    */
      gimp_image_rotate (image_ID, GIMP_ROTATE_90);
      jpeg_swap_original_settings (image_ID);
      gimp_image_flip (image_ID, GIMP_ORIENTATION_HORIZONTAL);
      break;

    case 6:  /* 90 CW                            */
      gimp_image_rotate (image_ID, GIMP_ROTATE_90);
      jpeg_swap_original_settings (image_ID);
      break;

    case 7:  /* flipped diagonally around '/'    */
      gimp_image_rotate (image_ID, GIMP_ROTATE_90);
      jpeg_swap_original_settings (image_ID);
      gimp_image_flip (image_ID, GIMP_ORIENTATION_VERTICAL);
      break;

    case 8:  /* 90 CCW                           */
      gimp_image_rotate (image_ID, GIMP_ROTATE_270);
      jpeg_swap_original_settings (image_ID);
      break;

    default: /* shouldn't happen                 */
      break;
    }
}
コード例 #3
0
ファイル: image-commands.c プロジェクト: jdburton/gimp-osx
void
image_flip_cmd_callback (GtkAction *action,
                         gint       value,
                         gpointer   data)
{
  GimpDisplay  *display;
  GimpProgress *progress;
  return_if_no_display (display, data);

  progress = gimp_progress_start (GIMP_PROGRESS (display),
                                  _("Flipping"), FALSE);

  gimp_image_flip (display->image, action_data_get_context (data),
                   (GimpOrientationType) value, progress);

  if (progress)
    gimp_progress_end (progress);

  gimp_image_flush (display->image);
}
コード例 #4
0
static GimpValueArray *
image_flip_invoker (GimpProcedure         *procedure,
                    Gimp                  *gimp,
                    GimpContext           *context,
                    GimpProgress          *progress,
                    const GimpValueArray  *args,
                    GError               **error)
{
  gboolean success = TRUE;
  GimpImage *image;
  gint32 flip_type;

  image = gimp_value_get_image (gimp_value_array_index (args, 0), gimp);
  flip_type = g_value_get_enum (gimp_value_array_index (args, 1));

  if (success)
    {
      gimp_image_flip (image, context, flip_type, NULL);
    }

  return gimp_procedure_get_return_values (procedure, success,
                                           error ? *error : NULL);
}