Method: Magick::Image#channel_depth
- Defined in:
- ext/RMagick/rmimage.cpp
#channel_depth(channel = Magick::AllChannels) ⇒ Integer #channel_depth(*channels) ⇒ Integer
Returns the maximum depth for the specified channel or channels.
2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 |
# File 'ext/RMagick/rmimage.cpp', line 2447
VALUE
Image_channel_depth(int argc, VALUE *argv, VALUE self)
{
Image *image;
ChannelType channels;
size_t channel_depth;
ExceptionInfo *exception;
image = rm_check_destroyed(self);
channels = extract_channels(&argc, argv);
// Ensure all arguments consumed.
if (argc > 0)
{
raise_ChannelType_error(argv[argc-1]);
}
exception = AcquireExceptionInfo();
#if defined(IMAGEMAGICK_7)
BEGIN_CHANNEL_MASK(image, channels);
GVL_STRUCT_TYPE(GetImageDepth) args = { image, exception };
channel_depth = (size_t)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(GetImageDepth), &args);
END_CHANNEL_MASK(image);
#else
GVL_STRUCT_TYPE(GetImageChannelDepth) args = { image, channels, exception };
channel_depth = (size_t)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(GetImageChannelDepth), &args);
#endif
CHECK_EXCEPTION();
DestroyExceptionInfo(exception);
return ULONG2NUM(channel_depth);
}
|