Skip to content

Commit

Permalink
Define Image#total_ink_density attribute reader
Browse files Browse the repository at this point in the history
  • Loading branch information
rmagick committed Oct 30, 2008
1 parent 87c4aa5 commit c214a2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ext/RMagick/rmagick.h
@@ -1,4 +1,4 @@
/* $Id: rmagick.h,v 1.254 2008/10/29 22:42:49 rmagick Exp $ */
/* $Id: rmagick.h,v 1.255 2008/10/30 22:05:20 rmagick Exp $ */
/*=============================================================================
| Copyright (C) 2008 by Timothy P. Hunter
| Name: rmagick.h
Expand Down Expand Up @@ -777,6 +777,7 @@ ATTR_READER(Image, scene)
ATTR_ACCESSOR(Image, start_loop)
ATTR_ACCESSOR(Image, ticks_per_second)
ATTR_READER(Image, total_colors)
ATTR_READER(Image, total_ink_density)
ATTR_ACCESSOR(Image, transparent_color)
ATTR_ACCESSOR(Image, units)
ATTR_ACCESSOR(Image, virtual_pixel_method)
Expand Down
14 changes: 13 additions & 1 deletion ext/RMagick/rmimage.c
@@ -1,4 +1,4 @@
/* $Id: rmimage.c,v 1.325 2008/10/27 22:16:09 rmagick Exp $ */
/* $Id: rmimage.c,v 1.326 2008/10/30 22:05:20 rmagick Exp $ */
/*============================================================================\
| Copyright (C) 2008 by Timothy P. Hunter
| Name: rmimage.c
Expand Down Expand Up @@ -10073,6 +10073,18 @@ Image_total_colors(VALUE self)
}


VALUE
Image_total_ink_density(VALUE self)
{
Image *image;
double density;

image = rm_check_destroyed(self);
density = GetImageTotalInkDensity(image);
return rb_float_new(density);
}


/*
Method: Image#transparent(color-name<, opacity>)
Image#transparent(pixel<, opacity>)
Expand Down
5 changes: 3 additions & 2 deletions ext/RMagick/rmmain.c
@@ -1,4 +1,4 @@
/* $Id: rmmain.c,v 1.273 2008/10/29 22:42:49 rmagick Exp $ */
/* $Id: rmmain.c,v 1.274 2008/10/30 22:05:21 rmagick Exp $ */
/*============================================================================\
| Copyright (C) 2008 by Timothy P. Hunter
| Name: rmmain.c
Expand Down Expand Up @@ -464,6 +464,7 @@ Init_RMagick2(void)
DCL_ATTR_ACCESSOR(Image, class_type)
DCL_ATTR_ACCESSOR(Image, ticks_per_second)
DCL_ATTR_READER(Image, total_colors)
DCL_ATTR_READER(Image, total_ink_density)
DCL_ATTR_ACCESSOR(Image, transparent_color)
DCL_ATTR_ACCESSOR(Image, units)
DCL_ATTR_ACCESSOR(Image, virtual_pixel_method)
Expand Down Expand Up @@ -1806,7 +1807,7 @@ version_constants(void)
rb_define_const(Module_Magick, "Version", str);

sprintf(long_version,
"This is %s ($Date: 2008/10/29 22:42:49 $) Copyright (C) 2008 by Timothy P. Hunter\n"
"This is %s ($Date: 2008/10/30 22:05:21 $) Copyright (C) 2008 by Timothy P. Hunter\n"
"Built with %s\n"
"Built for %s\n"
"Web page: http://rmagick.rubyforge.org\n"
Expand Down

0 comments on commit c214a2b

Please sign in to comment.