]> git.pld-linux.org Git - packages/ClanLib.git/commitdiff
- patch for new ImageMagick
authorJacek Konieczny <jajcus@pld-linux.org>
Wed, 19 Apr 2000 10:40:15 +0000 (10:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ClanLib-Magick.patch -> 1.1

ClanLib-Magick.patch [new file with mode: 0644]

diff --git a/ClanLib-Magick.patch b/ClanLib-Magick.patch
new file mode 100644 (file)
index 0000000..d20708f
--- /dev/null
@@ -0,0 +1,50 @@
+
+This patch makes ClanLib-0.4.3 compile with ImageMagick-5.1.1
+I know it probably could be done i one ImageMagick call, but I don't know what
+the code was ment to do.
+
+diff -durN ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp ClanLib-0.4.3/Sources/Magick/provider_magick.cpp
+--- ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp      Mon Mar 13 18:12:50 2000
++++ ClanLib-0.4.3/Sources/Magick/provider_magick.cpp   Wed Apr 19 10:04:12 2000
+@@ -138,12 +138,9 @@
+       height = image->rows;
+       pitch = width * get_bytes_per_pixel();
+       
+-      float *rdata = new float[width*height];
+-      float *gdata = new float[width*height];
+-      float *bdata = new float[width*height];
+-      float *adata = new float[width*height];
++      float *rgbadata = new float[width*height*4];
+       
+-      GetPixels(image, rdata, gdata, bdata, adata);
++      GetPixels(image, 0,0,width,height,"RGBA",FloatPixel,rgbadata);
+       DestroyImage(image);
+       
+       // here comes the tricky part ... hmhmhm... Quicky Mart
+@@ -186,10 +183,10 @@
+       for (int y=0; y<height; y++)
+               for (int x=0; x<width; x++)
+               {
+-                      tmp = (((unsigned int) (rdata[y*width+x] * rtmp)) << rshift) |
+-                            (((unsigned int) (gdata[y*width+x] * gtmp)) << gshift) |
+-                            (((unsigned int) (bdata[y*width+x] * btmp)) << bshift) |
+-                            (((unsigned int) (atmp - adata[y*width+x] * atmp)) << ashift);
++                      tmp = (((unsigned int) (rgbadata[(y*width+x)*4] * rtmp)) << rshift) |
++                            (((unsigned int) (rgbadata[(y*width+x)*4+1] * gtmp)) << gshift) |
++                            (((unsigned int) (rgbadata[(y*width+x)*4+2] * btmp)) << bshift) |
++                            (((unsigned int) (atmp - rgbadata[(y*width+x)*4+3] * atmp)) << ashift);
+                       switch (get_bytes_per_pixel())
+                       {
+@@ -212,10 +209,7 @@
+                       }
+               }
+-      delete[] rdata;
+-      delete[] gdata;
+-      delete[] bdata;
+-      delete[] adata;
++      delete[] rgbadata;
+ }             
+ void CL_MagickProvider::perform_unlock()
This page took 0.030223 seconds and 4 git commands to generate.