[Swfed-svn] swfed-svn [104] -Lossless用カラーマップ生成時の透明度有無判定を間違えていたので修正

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 2日 (月) 22:52:33 JST


Revision: 104
          http://svn.sourceforge.jp/view?root=swfed&view=rev&rev=104
Author:   yoya
Date:     2009-02-02 22:52:33 +0900 (Mon, 02 Feb 2009)

Log Message:
-----------
-Lossless用カラーマップ生成時の透明度有無判定を間違えていたので修正
- コードの整理 (動作が変わらない範囲で)

Modified Paths:
--------------
    trunk/src/swf_gif.c


-------------- next part --------------
Modified: trunk/src/swf_gif.c
===================================================================
--- trunk/src/swf_gif.c	2009-02-01 14:43:57 UTC (rev 103)
+++ trunk/src/swf_gif.c	2009-02-02 13:52:33 UTC (rev 104)
@@ -109,7 +109,7 @@
     GifFileType *GifFile = NULL;
     ColorMapObject *ColorMap = NULL;
     my_gif_buffer gif_buff;
-    int bpp; // , color_type;
+    int bpp;
     gif_uint_32 gif_width = 0, gif_height = 0;
     gif_bytep gif_image_data_ref = NULL;
     gif_uint_32 x, y;
@@ -117,8 +117,6 @@
     void *image_data = NULL;
     gif_colorp palette = NULL;
     int palette_num = 0;
-//    gif_bytep trans = NULL;
-//    int num_trans = 0;
     int trans_index = -1;
 
     SavedImage Image;
@@ -167,18 +165,17 @@
      * image copy
      */
     int i;
-//    *colormap_count = palette_num;
     *colormap_count = 256; // XXX
-    if (trans_index == 0) {
-        swf_rgb_t *result_colormap = malloc(sizeof(swf_rgb_t) * palette_num);   // Lossless
+    if (trans_index == -1) {  // Lossless
+        swf_rgb_t *result_colormap = malloc(sizeof(swf_rgb_t) * palette_num);
         for (i=0 ; i < palette_num ; i++) {
             result_colormap[i].red   = palette[i].red;
             result_colormap[i].green = palette[i].green;
             result_colormap[i].blue  = palette[i].blue;
         }
         *colormap = result_colormap;
-    } else {
-        swf_rgba_t *result_colormap = malloc(sizeof(swf_rgba_t) * palette_num);   // Lossless2
+    } else {  // Lossless2
+        swf_rgba_t *result_colormap = malloc(sizeof(swf_rgba_t) * palette_num);  
         for (i=0 ; i < palette_num ; i++) {
             result_colormap[i].red   = palette[i].red;
             result_colormap[i].green = palette[i].green;



Swfed-svn メーリングリストの案内
Back to archive index