1#!/usr/bin/perl 2# Copyright 1999-20.0 ImageMagick Studio LLC, a non-profit organization 3# dedicated to making software imaging solutions freely available. 4# 5# You may not use this file except in compliance with the License. You may 6# obtain a copy of the License at 7# 8# http://www.imagemagick.org/script/license.php 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16BEGIN { $| = 1; $test=1; print "1..18\n"; } 17END {print "not ok $test\n" unless $loaded;} 18use Image::Magick; 19$loaded=1; 20 21require 't/subroutines.pl'; 22 23chdir 't' || die 'Cd failed'; 24 25# 26# Add 27# 28testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 29 'input.miff', q//, q/, gravity=>'Center', compose=>'ModulusAdd'/, 30 'reference/composite/Add.miff', 0.002, 1.0); 31# 32# Atop 33# 34++$test; 35testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 36 'input.miff', q//, q/, gravity=>'Center', compose=>'Atop'/, 37 'reference/composite/Atop.miff', 0.00001, 0.009); 38 39# 40# Bumpmap 41# 42++$test; 43testCompositeCompare('gradient:white-black',q/size=>"70x46"/, 44 'input.miff', q//,q/, gravity=>'Center', compose=>'Bumpmap'/, 45 'reference/composite/Bumpmap.miff', 0.03, 0.3); 46 47# 48# Clear 49# 50++$test; 51testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 52 'input.miff', q//, q/, gravity=>'Center', compose=>'Clear'/, 53 'reference/composite/Clear.miff', 0.00001, 0.009); 54 55# 56# Copy 57# 58++$test; 59testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 60 'input.miff', q//, q/, gravity=>'Center', compose=>'Copy'/, 61 'reference/composite/Copy.miff', 0.00001, 0.009); 62 63# 64# CopyBlue 65# 66++$test; 67testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 68 'input.miff', q//, q/, gravity=>'Center', compose=>'CopyBlue'/, 69 'reference/composite/CopyBlue.miff', 0.00001, 0.009); 70 71# 72# CopyGreen 73# 74++$test; 75testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 76 'input.miff', q//, q/, gravity=>'Center', compose=>'CopyGreen'/, 77 'reference/composite/CopyGreen.miff', 0.00001, 0.009); 78 79# 80# CopyRed 81# 82++$test; 83testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 84 'input.miff', q//, q/, gravity=>'Center', compose=>'CopyRed'/, 85 'reference/composite/CopyRed.miff', 0.00001, 0.009); 86 87# 88# CopyAlpha 89# 90++$test; 91testCompositeCompare('gradient:white-black',q/size=>"70x46"/, 92 'input.miff', q//, q/, gravity=>'Center', compose=>'CopyAlpha'/, 93 'reference/composite/CopyAlpha.miff', 0.00001, 0.009); 94 95# 96# Difference 97# 98++$test; 99testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 100 'input.miff', q//, q/, gravity=>'Center', compose=>'Difference'/, 101 'reference/composite/Difference.miff', 0.00001, 0.009); 102 103# 104# In 105# 106++$test; 107testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 108 'input.miff', q//, q/, gravity=>'Center', compose=>'In'/, 109 'reference/composite/In.miff', 0.00001, 0.009); 110 111# 112# Minus 113# 114++$test; 115testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 116 'input.miff', q//, q/, gravity=>'Center', compose=>'Minus'/, 117 'reference/composite/Minus.miff', 0.00001, 0.009); 118 119# 120# Multiply 121# 122++$test; 123testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 124 'input.miff', q//, q/, gravity=>'Center', compose=>'Multiply'/, 125 'reference/composite/Multiply.miff', 0.00001, 0.009); 126 127# 128# Out 129# 130++$test; 131testCompositeCompare('gradient:white-black',q/size=>"70x46"/, 132 'input.miff', q//, q/, gravity=>'Center', compose=>'Out'/, 133 'reference/composite/Out.miff', 0.00001, 0.009); 134 135# 136# Over 137# 138++$test; 139testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 140 'input.miff', q//, q/, gravity=>'Center', compose=>'Over'/, 141 'reference/composite/Over.miff', 0.00001, 0.009); 142 143# 144# Plus 145# 146++$test; 147testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 148 'input.miff', q//, q/, gravity=>'Center', compose=>'Plus'/, 149 'reference/composite/Plus.miff', 0.03, 0.7); 150 151# 152# Subtract 153# 154++$test; 155testCompositeCompare('gradient:white-black',q/size=>"100x80"/, 156 'input.miff', q//, q/, gravity=>'Center', compose=>'ModulusSubtract'/, 157 'reference/composite/Subtract.miff', 0.0009, 1.0); 158 159# 160# Xor 161# 162++$test; 163testCompositeCompare('gradient:white-black',q/size=>"70x46"/, 164 'input.miff', q//, q/, gravity=>'Center', compose=>'Xor'/, 165 'reference/composite/Xor.miff', 0.00001, 0.009); 166 1671; 168