• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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#    https://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//,
53  q/, gravity=>'Center', 'clip-to-self'=>True, compose=>'Clear'/,
54  'reference/composite/Clear.miff', 0.00001, 0.009);
55
56#
57# Copy
58#
59++$test;
60testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
61  'input.miff', q//, q/, gravity=>'Center', compose=>'Copy'/,
62  'reference/composite/Copy.miff', 0.00001, 0.009);
63
64#
65# CopyBlue
66#
67++$test;
68testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
69  'input.miff', q//, q/, gravity=>'Center', compose=>'CopyBlue'/,
70  'reference/composite/CopyBlue.miff', 0.00001, 0.009);
71
72#
73# CopyGreen
74#
75++$test;
76testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
77  'input.miff', q//, q/, gravity=>'Center', compose=>'CopyGreen'/,
78  'reference/composite/CopyGreen.miff', 0.00001, 0.009);
79
80#
81# CopyRed
82#
83++$test;
84testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
85  'input.miff', q//, q/, gravity=>'Center', compose=>'CopyRed'/,
86  'reference/composite/CopyRed.miff', 0.00001, 0.009);
87
88#
89# CopyAlpha
90#
91++$test;
92testCompositeCompare('gradient:white-black',q/size=>"70x46"/,
93  'input.miff', q//, q/, gravity=>'Center', compose=>'CopyAlpha'/,
94  'reference/composite/CopyAlpha.miff', 0.00001, 0.009);
95
96#
97# Difference
98#
99++$test;
100testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
101  'input.miff', q//, q/, gravity=>'Center', compose=>'Difference'/,
102  'reference/composite/Difference.miff', 0.00001, 0.009);
103
104#
105# In
106#
107++$test;
108testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
109  'input.miff', q//, q/, gravity=>'Center', compose=>'In'/,
110  'reference/composite/In.miff', 0.00001, 0.009);
111
112#
113# Minus
114#
115++$test;
116testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
117  'input.miff', q//, q/, gravity=>'Center', compose=>'Minus'/,
118  'reference/composite/Minus.miff', 0.00001, 0.009);
119
120#
121# Multiply
122#
123++$test;
124testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
125  'input.miff', q//, q/, gravity=>'Center', compose=>'Multiply'/,
126  'reference/composite/Multiply.miff', 0.00001, 0.009);
127
128#
129# Out
130#
131++$test;
132testCompositeCompare('gradient:white-black',q/size=>"70x46"/,
133  'input.miff', q//, q/, gravity=>'Center', compose=>'Out'/,
134  'reference/composite/Out.miff', 0.00001, 0.009);
135
136#
137# Over
138#
139++$test;
140testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
141  'input.miff', q//, q/, gravity=>'Center', compose=>'Over'/,
142  'reference/composite/Over.miff', 0.00001, 0.009);
143
144#
145# Plus
146#
147++$test;
148testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
149  'input.miff', q//, q/, gravity=>'Center', compose=>'Plus'/,
150  'reference/composite/Plus.miff', 0.03, 0.7);
151
152#
153# Subtract
154#
155++$test;
156testCompositeCompare('gradient:white-black',q/size=>"100x80"/,
157  'input.miff', q//, q/, gravity=>'Center', compose=>'ModulusSubtract'/,
158  'reference/composite/Subtract.miff', 0.0009, 1.0);
159
160#
161# Xor
162#
163++$test;
164testCompositeCompare('gradient:white-black',q/size=>"70x46"/,
165  'input.miff', q//, q/, gravity=>'Center', compose=>'Xor'/,
166  'reference/composite/Xor.miff', 0.00001, 0.009);
167
1681;
169