Commit 698d9ea2 authored by Martin Nordholts's avatar Martin Nordholts

plug-ins: bmp-write.c: encoded -> use_run_length_encoding

parent 376ad788
...@@ -53,7 +53,7 @@ typedef enum ...@@ -53,7 +53,7 @@ typedef enum
static struct static struct
{ {
RGBMode rgb_format; RGBMode rgb_format;
gint encoded; gint use_run_length_encoding;
} BMPSaveData; } BMPSaveData;
static gint cur_progress = 0; static gint cur_progress = 0;
...@@ -64,7 +64,7 @@ static void write_image (FILE *f, ...@@ -64,7 +64,7 @@ static void write_image (FILE *f,
guchar *src, guchar *src,
gint width, gint width,
gint height, gint height,
gint encoded, gint use_run_length_encoding,
gint channels, gint channels,
gint bpp, gint bpp,
gint spzeile, gint spzeile,
...@@ -245,8 +245,7 @@ WriteBMP (const gchar *filename, ...@@ -245,8 +245,7 @@ WriteBMP (const gchar *filename,
g_assert_not_reached (); g_assert_not_reached ();
} }
/* Perhaps someone wants RLE encoded Bitmaps */ BMPSaveData.use_run_length_encoding = 0;
BMPSaveData.encoded = 0;
mask_info_size = 0; mask_info_size = 0;
if (!interactive && lastvals) if (!interactive && lastvals)
...@@ -342,7 +341,7 @@ WriteBMP (const gchar *filename, ...@@ -342,7 +341,7 @@ WriteBMP (const gchar *filename,
Bitmap_Head.biPlanes = 1; Bitmap_Head.biPlanes = 1;
Bitmap_Head.biBitCnt = BitsPerPixel; Bitmap_Head.biBitCnt = BitsPerPixel;
if (BMPSaveData.encoded == 0) if (BMPSaveData.use_run_length_encoding == 0)
{ {
if (mask_info_size > 0) if (mask_info_size > 0)
Bitmap_Head.biCompr = 3; /* BI_BITFIELDS */ Bitmap_Head.biCompr = 3; /* BI_BITFIELDS */
...@@ -506,8 +505,9 @@ WriteBMP (const gchar *filename, ...@@ -506,8 +505,9 @@ WriteBMP (const gchar *filename,
write_image (outfile, write_image (outfile,
pixels, cols, rows, pixels, cols, rows,
BMPSaveData.encoded, channels, BitsPerPixel, SpZeile, MapSize, BMPSaveData.use_run_length_encoding,
BMPSaveData.rgb_format); channels, BitsPerPixel, SpZeile,
MapSize, BMPSaveData.rgb_format);
/* ... and exit normally */ /* ... and exit normally */
...@@ -544,7 +544,7 @@ write_image (FILE *f, ...@@ -544,7 +544,7 @@ write_image (FILE *f,
guchar *src, guchar *src,
gint width, gint width,
gint height, gint height,
gint encoded, gint use_run_length_encoding,
gint channels, gint channels,
gint bpp, gint bpp,
gint spzeile, gint spzeile,
...@@ -645,7 +645,7 @@ write_image (FILE *f, ...@@ -645,7 +645,7 @@ write_image (FILE *f,
} }
else else
{ {
switch (encoded) /* now it gets more difficult */ switch (use_run_length_encoding) /* now it gets more difficult */
{ /* uncompressed 1,4 and 8 bit */ { /* uncompressed 1,4 and 8 bit */
case 0: case 0:
{ {
...@@ -844,14 +844,14 @@ save_dialog (gint channels) ...@@ -844,14 +844,14 @@ save_dialog (gint channels)
toggle = gtk_check_button_new_with_mnemonic (_("_Run-Length Encoded")); toggle = gtk_check_button_new_with_mnemonic (_("_Run-Length Encoded"));
gtk_box_pack_start (GTK_BOX (vbox_main), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox_main), toggle, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle),
BMPSaveData.encoded); BMPSaveData.use_run_length_encoding);
gtk_widget_show (toggle); gtk_widget_show (toggle);
if (channels > 1) if (channels > 1)
gtk_widget_set_sensitive (toggle, FALSE); gtk_widget_set_sensitive (toggle, FALSE);
g_signal_connect (toggle, "toggled", g_signal_connect (toggle, "toggled",
G_CALLBACK (gimp_toggle_button_update), G_CALLBACK (gimp_toggle_button_update),
&BMPSaveData.encoded); &BMPSaveData.use_run_length_encoding);
expander = gtk_expander_new_with_mnemonic (_("_Advanced Options")); expander = gtk_expander_new_with_mnemonic (_("_Advanced Options"));
......
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