~ubuntu-branches/ubuntu/quantal/imagemagick/quantal-updates

« back to all changes in this revision

Viewing changes to coders/plasma.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-11-06 17:18:57 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091106171857-dlpl0avgxsy4vohw
Tags: 7:6.5.5.3-1ubuntu1
* Merge from debian testing, remaining changes:
  - Don't build-dep on librsvg, it brings in excessive dependencies
  - Don't build-dep on liblqr-1-0-dev, it is in universe

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
#include "magick/constitute.h"
47
47
#include "magick/exception.h"
48
48
#include "magick/exception-private.h"
 
49
#include "magick/fx.h"
49
50
#include "magick/image.h"
50
51
#include "magick/image-private.h"
51
52
#include "magick/list.h"
54
55
#include "magick/monitor.h"
55
56
#include "magick/monitor-private.h"
56
57
#include "magick/random_.h"
 
58
#include "magick/random-private.h"
57
59
#include "magick/signature-private.h"
58
60
#include "magick/quantum-private.h"
59
61
#include "magick/static.h"
94
96
  return(y);
95
97
}
96
98
 
97
 
static inline void PlasmaPixel(Image *image,double x,double y)
 
99
static inline void PlasmaPixel(Image *image,RandomInfo *random_info,double x,
 
100
  double y)
98
101
{
99
102
  ExceptionInfo
100
103
    *exception;
111
114
  if (q == (PixelPacket *) NULL)
112
115
    return;
113
116
  range=GetQuantumRange(16UL);
114
 
  q->red=ScaleAnyToQuantum((unsigned long) (65535.0*GetPseudoRandomValue()+
115
 
    0.5),range);
116
 
  q->green=ScaleAnyToQuantum((unsigned long) (65535.0*GetPseudoRandomValue()+
117
 
    0.5),range);
118
 
  q->blue=ScaleAnyToQuantum((unsigned long) (65535.0*GetPseudoRandomValue()+
119
 
    0.5),range);
 
117
  q->red=ScaleAnyToQuantum((unsigned long) (65535.0*
 
118
    GetPseudoRandomValue(random_info)+0.5),range);
 
119
  q->green=ScaleAnyToQuantum((unsigned long) (65535.0*
 
120
    GetPseudoRandomValue(random_info)+0.5),range);
 
121
  q->blue=ScaleAnyToQuantum((unsigned long) (65535.0*
 
122
    GetPseudoRandomValue(random_info)+0.5),range);
120
123
  (void) SyncAuthenticPixels(image,exception);
121
124
}
122
125
 
182
185
  segment_info.y2=(double) image->rows-1;
183
186
  if (LocaleCompare(image_info->filename,"fractal") == 0)
184
187
    {
 
188
      RandomInfo
 
189
        *random_info;
 
190
 
185
191
      /*
186
192
        Seed pixels before recursion.
187
193
      */
188
 
      PlasmaPixel(image,segment_info.x1,segment_info.y1);
189
 
      PlasmaPixel(image,segment_info.x1,(segment_info.y1+segment_info.y2)/2);
190
 
      PlasmaPixel(image,segment_info.x1,segment_info.y2);
191
 
      PlasmaPixel(image,(segment_info.x1+segment_info.x2)/2,segment_info.y1);
192
 
      PlasmaPixel(image,(segment_info.x1+segment_info.x2)/2,
 
194
      random_info=AcquireRandomInfo();
 
195
      PlasmaPixel(image,random_info,segment_info.x1,segment_info.y1);
 
196
      PlasmaPixel(image,random_info,segment_info.x1,(segment_info.y1+
 
197
        segment_info.y2)/2);
 
198
      PlasmaPixel(image,random_info,segment_info.x1,segment_info.y2);
 
199
      PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2,
 
200
        segment_info.y1);
 
201
      PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2,
193
202
        (segment_info.y1+segment_info.y2)/2);
194
 
      PlasmaPixel(image,(segment_info.x1+segment_info.x2)/2,segment_info.y2);
195
 
      PlasmaPixel(image,segment_info.x2,segment_info.y1);
196
 
      PlasmaPixel(image,segment_info.x2,(segment_info.y1+segment_info.y2)/2);
197
 
      PlasmaPixel(image,segment_info.x2,segment_info.y2);
 
203
      PlasmaPixel(image,random_info,(segment_info.x1+segment_info.x2)/2,
 
204
        segment_info.y2);
 
205
      PlasmaPixel(image,random_info,segment_info.x2,segment_info.y1);
 
206
      PlasmaPixel(image,random_info,segment_info.x2,(segment_info.y1+
 
207
        segment_info.y2)/2);
 
208
      PlasmaPixel(image,random_info,segment_info.x2,segment_info.y2);
 
209
      random_info=DestroyRandomInfo(random_info);
198
210
    }
199
211
  i=(unsigned long) MagickMax(image->columns,image->rows)/2;
200
212
  for (max_depth=0; i != 0; max_depth++)