- for(x=0;x<dst.width*dst.height;x++) {
- dst.map[x].r=scale*mag[x];
- dst.map[x].g=dst.map[x].r;
- dst.map[x].b=dst.map[x].r;
+ offt=0;
+ for(y=0;y<dst.height;y++) {
+ for(x=0;x<dst.width;x++) {
+ offy=((y<dst.height/2)?y+dst.height/2:y-dst.height/2);
+ offy*=dst.width;
+ offy+=((x<dst.width/2)?x+dst.width/2:x-dst.width/2);
+ dst.map[offy].r=scale*mag[offt];
+ dst.map[offy].g=dst.map[offy].r;
+ dst.map[offy].b=dst.map[offy].r;
+ offt+=1;
+ }