Quantcast
Channel: magick Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1011

Commented Unassigned: PixelCollection.Set() sets all the pixels to (0,0,0) after the first call. [1412]

$
0
0
Hi, i load a .hdr image in a MagickImage and then change the value of a pixel to {0,0,0} (the image has 3 channels. What happens is that after the first pixelCol.Set(x,y, black) everything becomes (0,0,0). I can't understand why. The sample code is reported here:
```
void mymethod(ref MagickImage image, double[][] pixelSet, float[] black)
PixelCollection ps = image.GetPixels();
Pixel p;
foreach (double[] pixel in pixelSet)
{
if (mycondition)
{
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("Before: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
ps.Set((int)pixel[X_COMP], (int)pixel[Y_COMP], black);
p = ps.GetPixel((int)pixel[X_COMP], (int)pixel[Y_COMP]);
Console.WriteLine("After: " +p.ToColor().R + " " + p.ToColor().G + " " + p.ToColor().B);
}
}
```

The code returns
> Before: regularfloat regularfloat regularfloat
After: zero zero zero

For the first iteration, and

> Before: zero zero zero
After: zero zero zero

For all the others iterations. I tried skipping the first iteration and the result is the same but starting from the second iteration.
Comments: Can I close this issue @Alakanu?

Viewing all articles
Browse latest Browse all 1011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>