examples/identify.rb in rmagick-3.2.0 vs examples/identify.rb in rmagick-4.0.0

- old
+ new

@@ -18,20 +18,20 @@ case color_space when Magick::RGBColorspace puts "\t\tRed: #{channel_depth(Magick::RedChannel)}-bits\n" puts "\t\tGreen: #{channel_depth(Magick::GreenChannel)}-bits\n" puts "\t\tBlue: #{channel_depth(Magick::BlueChannel)}-bits\n" - puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if matte + puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if alpha when Magick::CMYKColorspace puts "\t\tCyan : #{channel_depth(Magick::CyanChannel)}-bits\n" puts "\t\tMagenta: #{channel_depth(Magick::MagentaChannel)}-bits\n" puts "\t\tYellow: #{channel_depth(Magick::YellowChannel)}-bits\n" puts "\t\tBlack: #{channel_depth(Magick::BlackChannel)}-bits\n" - puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if matte + puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if alpha when Magick::GRAYColorspace puts "\t\tGray: #{channel_depth(Magick::GrayChannel)}-bits\n" - puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if matte + puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if alpha end scale = Magick::QuantumRange / (Magick::QuantumRange >> (Magick::MAGICKCORE_QUANTUM_DEPTH - channel_depth)) puts "\tChannel statistics:\n" case color_space when Magick::RGBColorspace @@ -76,10 +76,10 @@ puts "\t\t\tMin: " + sprintf("%u (%g)\n", channel_extrema(Magick::GrayChannel)[0] / scale, channel_extrema(Magick::GrayChannel)[0] / Magick::QuantumRange) puts "\t\t\tMax: " + sprintf("%u (%g)\n", channel_extrema(Magick::GrayChannel)[1] / scale, channel_extrema(Magick::GrayChannel)[1] / Magick::QuantumRange) puts "\t\t\tMean: " + sprintf("%g (%g)\n", channel_mean(Magick::GrayChannel)[0] / scale, channel_mean(Magick::GrayChannel)[0] / Magick::QuantumRange) puts "\t\t\tStandard deviation: " + sprintf("%g (%g)\n", channel_mean(Magick::GrayChannel)[1] / scale, channel_mean(Magick::GrayChannel)[1] / Magick::QuantumRange) end - if matte + if alpha puts "\t\tOpacity:\n" puts "\t\t\tMin: " + sprintf("%u (%g)\n", channel_extrema(Magick::OpacityChannel)[0] / scale, channel_extrema(Magick::OpacityChannel)[0] / Magick::QuantumRange) puts "\t\t\tMax: " + sprintf("%u (%g)\n", channel_extrema(Magick::OpacityChannel)[1] / scale, channel_extrema(Magick::OpacityChannel)[1] / Magick::QuantumRange) puts "\t\t\tMean:" + sprintf("%u (%g)\n", channel_mean(Magick::OpacityChannel)[0] / scale, channel_mean(Magick::OpacityChannel)[0] / Magick::QuantumRange) puts "\t\t\tStandard deviation:" + sprintf("%u (%g)\n", channel_mean(Magick::OpacityChannel)[1] / scale, channel_mean(Magick::OpacityChannel)[1] / Magick::QuantumRange)