]> git.pld-linux.org Git - packages/ClanLib.git/blob - ClanLib-Magick.patch
1739d9af39b33776fb47a61c7703366b73665e78
[packages/ClanLib.git] / ClanLib-Magick.patch
1 diff -Nur ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp ClanLib-0.4.3/Sources/Magick/provider_magick.cpp
2 --- ClanLib-0.4.3.orig/Sources/Magick/provider_magick.cpp       Mon Mar 13 18:12:50 2000
3 +++ ClanLib-0.4.3/Sources/Magick/provider_magick.cpp    Fri Mar 16 22:31:13 2001
4 @@ -126,10 +126,11 @@
5  {
6         Image *image;
7         ImageInfo image_info;
8 +       ExceptionInfo exception_info;
9  
10         GetImageInfo(&image_info);
11         strcpy(image_info.filename, name.c_str());
12 -       image = ReadImage(&image_info);
13 +       image = ReadImage(&image_info, &exception_info);
14  //             if (!image)
15  //                     throw CL_Error("error while trying to open file with the Magick provider");
16         cl_assert(image);
17 @@ -138,12 +139,9 @@
18         height = image->rows;
19         pitch = width * get_bytes_per_pixel();
20         
21 -       float *rdata = new float[width*height];
22 -       float *gdata = new float[width*height];
23 -       float *bdata = new float[width*height];
24 -       float *adata = new float[width*height];
25 +       float *rgbadata = new float[width*height*4];
26         
27 -       GetPixels(image, rdata, gdata, bdata, adata);
28 +       DispatchImage(image, 0,0,width,height,"RGBA",FloatPixel,rgbadata);
29         DestroyImage(image);
30         
31         // here comes the tricky part ... hmhmhm... Quicky Mart
32 @@ -186,10 +184,10 @@
33         for (int y=0; y<height; y++)
34                 for (int x=0; x<width; x++)
35                 {
36 -                       tmp = (((unsigned int) (rdata[y*width+x] * rtmp)) << rshift) |
37 -                             (((unsigned int) (gdata[y*width+x] * gtmp)) << gshift) |
38 -                             (((unsigned int) (bdata[y*width+x] * btmp)) << bshift) |
39 -                             (((unsigned int) (atmp - adata[y*width+x] * atmp)) << ashift);
40 +                       tmp = (((unsigned int) (rgbadata[(y*width+x)*4] * rtmp)) << rshift) |
41 +                             (((unsigned int) (rgbadata[(y*width+x)*4+1] * gtmp)) << gshift) |
42 +                             (((unsigned int) (rgbadata[(y*width+x)*4+2] * btmp)) << bshift) |
43 +                             (((unsigned int) (atmp - rgbadata[(y*width+x)*4+3] * atmp)) << ashift);
44  
45                         switch (get_bytes_per_pixel())
46                         {
47 @@ -212,10 +210,7 @@
48                         }
49                 }
50  
51 -       delete[] rdata;
52 -       delete[] gdata;
53 -       delete[] bdata;
54 -       delete[] adata;
55 +       delete[] rgbadata;
56  }              
57  
58  void CL_MagickProvider::perform_unlock()
This page took 0.20575 seconds and 2 git commands to generate.