Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solid fill class #105

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open

Conversation

VorontsovIE
Copy link

New class SolidFill in order to fill image with monochromatic background. It allows one to write image constructors consistenly:

Image.new(size_x, size_y, HatchFill.new('white', 'red'))
Image.new(size_x, size_y, SolidFill.new('bisque'))

syntax for both gradient/hatched and for solid backgrounds instead of two completely different syntaxes

Image.new(size_x,size_y, HatchFill.new('white','red'))
Image.new(size_x,size_y){ self.background_color = 'bisque' }

bf4 and others added 29 commits July 31, 2014 20:43
Compile with rake-compiler.
Make rake-compiler easily installable by `bundle install`.
Ignore all build artifacts (.gitignore from Bundler template).
Fixes test failures of the type:

Magick::ImageMagickError: unable to open image
`../doc/ex/images/Button_0.gif':  @ error/blob.c/OpenBlob/2587
It was expected to be there as of 962d56c in Feb 2013
Yet was never commit as far as I can tell.

I haven't found what that image might have been, so I grabbed
an image with ICC version 2 and ICC version 4 profiles from
http://www.color.org/version4html.xalter and confirmed
the code works as expected

Magick::Image.read("./doc/ex/images/image_with_profile.jpg").first.color_profile
returns a string of characters. (Otherwise it would return nil)
Improve the installation instructions somewhat and organize the text
a bit better.
I took the "correct" value right from the RSpec output on Travis CI:

    test_limit_resources(Magick_UT)
    [/home/travis/build/gemhome/rmagick/test/Magick.rb:268]:
    <782635008> expected but was <3221225472>.

In fact, this value is machine and OS-dependent.
ImageMagick 6.8.9 (r15243) has the following definition:

magick/resource.c:111:

    MagickULLConstant(1536)*1024*1024, /* memory limit */

magick/magick-type.h:36:

    #  define MagickULLConstant(c)  (MagickSizeType) (c ## ULL)

magick/magick-type.h:151:

    typedef unsigned long long MagickSizeType;

When building on Windows, other definitions take place.
So, I think the initial value should not be in the test at all.
But let it be there for now, to test that the Ruby library correctly
gets the value from the C extension that correctly gets it from
ImageMagick that is running on Travis machines.
Do not test machine and OS-specific integers
Fixed: build error on Windows Ruby x64 (with ImageMagick 6.8.0-10 or Ima...
u338steven and others added 29 commits August 19, 2014 17:39
Fixed: test_rendering_intent(Image_Attributes_UT) in Image_attributes.rb fails rmagick-temp#79
Fixed: test_gamma(Image_Attributes_UT) in Image_attributes.rb fails rmagick-temp#77
Fixed: test_number_colors(Image_Attributes_UT) in Image_attributes.rb fails rmagick-temp#78
Fixed: test_total_colors(Image_Attributes_UT) in Image_attributes.rb fails rmagick-temp#80
Fixed: build error with ImageMagick 6.8.9 (when deprecated functions are excluded)
…ven-patch-12

Conflicts:
	ext/RMagick/rmimage.c
Fixed: test_each_profile(Image2_UT) in Image2.rb fails rmagick-temp#73
Fixed: test_from_blob(ImageList2_UT) in ImageList2.rb fails (on Windows)
Fixed: crash trying to 'test_monitor' on Windows(x64)
Fixed: crash trying to 'test_write' on Windows (Image3.rb, ImageList2.rb)
Fixed: test_from_hsla(Pixel_UT) in Pixel.rb fails rmagick-temp#87
Quotes for correct path of font file
…und.

It allows one to write image constructors in a consistent syntax
for both gradient/hatched and for solid backgrounds instead of two
completely different syntaxes:

Image.new(size_x, size_y, HatchFill.new('white', 'red'))
Image.new(size_x, size_y, SolidFill.new('bisque'))

vs

Image.new(size_x,size_y, HatchFill.new('white','red'))
Image.new(size_x,size_y){ self.background_color = 'bisque' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants