各ピクセルからRGBを取得しようとしています。しかし、C++
コードを実行すると、このような赤い色のシェルに乗ります
55512
55255
55255
期待した 0 から 255 までの数値ではないのはなぜですか?
これは私のコードです
Image image("image_test.jpg");
int w = image.columns();
int h = image.rows();
// get a "pixel cache" for the entire image
PixelPacket *pixels = image.getPixels(0, 0, w, h);
// now you can access single pixels like a vector
int row = 0;
int column = 0;
Color color = pixels[w * row + column];
for(row=0; row<h-1; row++){
for(column=0; column<w-1; column++){
Color color = pixels[w * row + column];
cout<<pixels[w * row + column].red;
image.syncPixels();
}
}
//image.syncPixels();
// write the image to file.
//image.write("test_modified.jpg");