1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
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
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
|
diff -u -d plug-ins-0.99.10/CML_explorer.c plug-ins/CML_explorer.c
--- plug-ins-0.99.10/CML_explorer.c Fri Jun 6 16:03:50 1997
+++ plug-ins/CML_explorer.c Sun Jun 8 22:21:15 1997
@@ -1,9 +1,10 @@
-/* CML_explorer.c -- This is a plug-in for the GIMP 1.0
- * Author: Shuji Narazaki <narazaki@InetQ.or.jp>
- * Time-stamp: <1997/05/26 22:20:29 narazaki@InetQ.or.jp>
- * Version: 1.0.2
+/* The GIMP -- an image manipulation program
+ * Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
+ * CML_explorer.c -- This is a plug-in for the GIMP 1.0
+ * Time-stamp: <1997/06/08 21:15:58 narazaki@InetQ.or.jp>
* Copyright (C) 1997 Shuji Narazaki <narazaki@InetQ.or.jp>
+ * Version: 1.0.6
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +22,7 @@
*
* Comment:
* CML is the abbreviation of Coupled-Map Lattice that is a model of
- * complex systems, proposed by a physicist.
+ * complex systems, proposed by a physicist[1,2].
*
* Similar models are summaried as follows:
*
@@ -34,7 +35,14 @@
* Thus time is rather continuous than discrete.
* Yes, this change to model changes the output completely.)
*
- * Web search engines tell you more details:)
+ * References:
+ * 1. Kunihiko Kaneko, Period-doubling of kind-antikink patterns,
+ * quasi-periodicity in antiferro-like structures and spatial
+ * intermittency in coupled map lattices -- Toward a prelude to a
+ * "field theory of chaos", Prog. Theor. Phys. 72 (1984) 480.
+ *
+ * 2. Kunihiko Kaneko ed., Theory and Applications of Coupled Map
+ * Lattices (Wiley, 1993).
*
* About Parameter File:
* I assume that the possible longest line in CMP parameter file is 1023.
@@ -56,11 +64,14 @@
* This version contains patches from:
* Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
* Sean P Cier <scier@andrew.cmu.edu>
+ * David Mosberger-Tang <davidm@azstarnet.com>
+ * Michael Sweet <mike@easysw.com>
*
*/
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
+#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -463,8 +474,7 @@
gimp_install_procedure (PLUG_IN_NAME,
"Make an image of Coupled-Map Lattice",
- "Make an image of Coupled-Map Lattice (CML). CML is a kind of Cellula Automata on continuous (value) domain.
-In RUN_NONINTERACTIVE, the name of a prameter file is passed as the 4th arg. You can control CML_explorer via parameter file.",
+ "Make an image of Coupled-Map Lattice (CML). CML is a kind of Cellula Automata on continuous (value) domain. In RUN_NONINTERACTIVE, the name of a prameter file is passed as the 4th arg. You can control CML_explorer via parameter file.",
/* Or do you want to call me with over 50 args? */
"Shuji Narazaki (narazaki@InetQ.or.jp)",
"Shuji Narazaki",
@@ -1292,7 +1302,8 @@
argv = g_new (gchar *, 1);
argv[0] = g_strdup (PLUG_IN_NAME);
gtk_init (&argc, &argv);
-
+ gtk_rc_parse (gimp_gtkrc ());
+
dlg = gtkW_dialog_new ("Coupled-Map-Lattice Explorer",
(GtkSignalFunc) OK_CALLBACK,
(GtkSignalFunc) gtkW_close_callback);
@@ -2708,6 +2719,7 @@
argv = g_new (gchar *, 1);
argv[0] = g_strdup (PLUG_IN_NAME);
gtk_init (&argc, &argv);
+ gtk_rc_parse (gimp_gtkrc ());
}
dlg = gtkW_message_dialog_new (PLUG_IN_NAME);
GET http://www.isc.tamu.edu/~lewing/gimp/diffs/0.99.10/alpha.diff HTTP/1.0
User-Agent: GET/0.5 libwww-perl/0.40
From: scott@poverty.bloomington.in.us
HTTP/1.0 200 Document follows
Date: Sun, 08 Jun 1997 07:26:16 GMT
Server: NCSA/1.5.1
Last-modified: Sun, 08 Jun 1997 07:21:34 GMT
Content-type: text/plain
Content-length: 12643
--- gimp-0.99.10-dist/app/curves.c Tue Jun 3 20:33:57 1997
+++ app/curves.c Sun Jun 8 00:02:56 1997
@@ -92,8 +92,8 @@
int leftmost;
int rightmost;
int curve_type;
- int points[4][17][2];
- unsigned char curve[4][256];
+ int points[5][17][2];
+ unsigned char curve[5][256];
};
typedef double CRMatrix[4][4];
@@ -115,6 +115,7 @@
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
+static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
@@ -184,8 +185,10 @@
else
d[GRAY_PIX] = cd->curve[HISTOGRAM_VALUE][s[GRAY_PIX]];
- if (has_alpha)
- d[alpha] = s[alpha];
+ if (has_alpha) {
+ d[alpha] = cd->curve[HISTOGRAM_ALPHA][s[alpha]];
+ /* d[alpha] = s[alpha]; */
+ }
s += srcPR->bytes;
d += destPR->bytes;
@@ -298,6 +301,31 @@
g_free (_curves);
}
+/* the action area structure */
+static ActionAreaItem action_items[] =
+{
+ { "Reset", curves_reset_callback, NULL, NULL },
+ { "OK", curves_ok_callback, NULL, NULL },
+ { "Cancel", curves_cancel_callback, NULL, NULL }
+};
+
+static MenuItem channel_items[] =
+{
+ { "Value", 0, 0, curves_value_callback, NULL, NULL, NULL },
+ { "Red", 0, 0, curves_red_callback, NULL, NULL, NULL },
+ { "Green", 0, 0, curves_green_callback, NULL, NULL, NULL },
+ { "Blue", 0, 0, curves_blue_callback, NULL, NULL, NULL },
+ { "Alpha", 0, 0, curves_alpha_callback, NULL, NULL, NULL },
+ { NULL, 0, 0, NULL, NULL, NULL, NULL }
+};
+
+static MenuItem curve_type_items[] =
+{
+ { "Smooth", 0, 0, curves_smooth_callback, NULL, NULL, NULL },
+ { "Free", 0, 0, curves_free_callback, NULL, NULL, NULL },
+ { NULL, 0, 0, NULL, NULL, NULL, NULL }
+};
+
void
curves_initialize (void *gdisp_ptr)
{
@@ -320,12 +348,12 @@
/* Initialize the values */
curves_dialog->channel = HISTOGRAM_VALUE;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
for (j = 0; j < 256; j++)
curves_dialog->curve[i][j] = j;
curves_dialog->grab_point = -1;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
{
for (j = 0; j < 17; j++)
{
@@ -342,11 +370,19 @@
curves_dialog->color = drawable_color (curves_dialog->drawable_id);
curves_dialog->image_map = image_map_create (gdisp_ptr, curves_dialog->drawable_id);
+ /* check for alpha channel */
+ if (drawable_has_alpha (curves_dialog->drawable_id))
+ gtk_widget_set_sensitive( channel_items[4].widget, TRUE);
+ else
+ gtk_widget_set_sensitive( channel_items[4].widget, FALSE);
+
/* hide or show the channel menu based on image type */
if (curves_dialog->color)
- gtk_widget_show (curves_dialog->channel_menu);
- else
- gtk_widget_hide (curves_dialog->channel_menu);
+ for (i = 0; i < 4; i++)
+ gtk_widget_set_sensitive( channel_items[i].widget, TRUE);
+ else
+ for (i = 1; i < 4; i++)
+ gtk_widget_set_sensitive( channel_items[i].widget, FALSE);
curves_update (curves_dialog, GRAPH | DRAW);
}
@@ -371,30 +407,6 @@
/* Select Curves dialog */
/**************************/
-/* the action area structure */
-static ActionAreaItem action_items[] =
-{
- { "Reset", curves_reset_callback, NULL, NULL },
- { "OK", curves_ok_callback, NULL, NULL },
- { "Cancel", curves_cancel_callback, NULL, NULL }
-};
-
-static MenuItem channel_items[] =
-{
- { "Value", 0, 0, curves_value_callback, NULL, NULL, NULL },
- { "Red", 0, 0, curves_red_callback, NULL, NULL, NULL },
- { "Green", 0, 0, curves_green_callback, NULL, NULL, NULL },
- { "Blue", 0, 0, curves_blue_callback, NULL, NULL, NULL },
- { NULL, 0, 0, NULL, NULL, NULL, NULL }
-};
-
-static MenuItem curve_type_items[] =
-{
- { "Smooth", 0, 0, curves_smooth_callback, NULL, NULL, NULL },
- { "Free", 0, 0, curves_free_callback, NULL, NULL, NULL },
- { NULL, 0, 0, NULL, NULL, NULL, NULL }
-};
-
CurvesDialog *
curves_new_dialog ()
{
@@ -414,7 +426,7 @@
cd->curve_type = SMOOTH;
cd->pixmap = NULL;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
channel_items [i].user_data = (gpointer) cd;
for (i = 0; i < 2; i++)
curve_type_items [i].user_data = (gpointer) cd;
@@ -844,6 +856,21 @@
}
static void
+curves_alpha_callback (GtkWidget *w,
+ gpointer client_data)
+{
+ CurvesDialog *cd;
+
+ cd = (CurvesDialog *) client_data;
+
+ if (cd->channel != HISTOGRAM_ALPHA)
+ {
+ cd->channel = HISTOGRAM_ALPHA;
+ curves_update (cd, GRAPH | DRAW);
+ }
+}
+
+static void
curves_smooth_callback (GtkWidget *w,
gpointer client_data)
{
@@ -1230,7 +1257,7 @@
},
{ PDB_INT32,
"channel",
- "the channel to modify: { VALUE (0), RED (1), GREEN (2), BLUE (3), GRAY (0) }"
+ "the channel to modify: { VALUE (0), RED (1), GREEN (2), BLUE (3), ALPHA (4), GRAY (0) }"
},
{ PDB_INT32,
"num_points",
@@ -1329,11 +1356,11 @@
/* arrange to modify the curves */
if (success)
{
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
for (j = 0; j < 256; j++)
cd.curve[i][j] = j;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
for (j = 0; j < 17; j++)
{
cd.points[i][j][0] = -1;
@@ -1479,7 +1506,7 @@
/* arrange to modify the curves */
if (success)
{
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
for (j = 0; j < 256; j++)
cd.curve[i][j] = j;
@@ -1504,3 +1531,5 @@
return procedural_db_return_args (&curves_explicit_proc, success);
}
+
+
--- gimp-0.99.10-dist/app/histogram.h Fri May 9 04:47:26 1997
+++ app/histogram.h Sat Jun 7 20:39:34 1997
@@ -24,6 +24,7 @@
#define HISTOGRAM_RED 1
#define HISTOGRAM_GREEN 2
#define HISTOGRAM_BLUE 3
+#define HISTOGRAM_ALPHA 4
/* Histogram information function */
typedef struct _Histogram Histogram;
@@ -38,7 +39,7 @@
};
typedef double Values[256];
-typedef Values HistogramValues[4];
+typedef Values HistogramValues[5];
typedef void (* HistogramInfoFunc) (PixelRegion *, PixelRegion *, HistogramValues, void *);
typedef void (* HistogramRangeCallback) (int, int, HistogramValues, void *);
@@ -53,3 +54,7 @@
HistogramValues *histogram_values (Histogram *);
#endif /* __HISTOGRAM_H__ */
+
+
+
+
--- gimp-0.99.10-dist/app/levels.c Tue Jun 3 20:33:56 1997
+++ app/levels.c Sun Jun 8 01:26:33 1997
@@ -83,18 +83,18 @@
ImageMap image_map;
int color;
int channel;
- int low_input[4];
- double gamma[4];
- int high_input[4];
- int low_output[4];
- int high_output[4];
+ int low_input[5];
+ double gamma[5];
+ int high_input[5];
+ int low_output[5];
+ int high_output[5];
gint preview;
int active_slider;
int slider_pos[5]; /* positions for the five sliders */
- unsigned char input[4][256];
- unsigned char output[4][256];
+ unsigned char input[5][256];
+ unsigned char output[5][256];
};
@@ -114,6 +114,7 @@
static void levels_red_callback (GtkWidget *, gpointer);
static void levels_green_callback (GtkWidget *, gpointer);
static void levels_blue_callback (GtkWidget *, gpointer);
+static void levels_alpha_callback (GtkWidget *, gpointer);
static void levels_auto_levels_callback (GtkWidget *, gpointer);
static void levels_ok_callback (GtkWidget *, gpointer);
static void levels_cancel_callback (GtkWidget *, gpointer);
@@ -178,7 +179,8 @@
d[GRAY_PIX] = ld->output[HISTOGRAM_VALUE][ld->input[HISTOGRAM_VALUE][s[GRAY_PIX]]];;
if (has_alpha)
- d[alpha] = s[alpha];
+ d[alpha] = ld->output[HISTOGRAM_ALPHA][ld->input[HISTOGRAM_ALPHA][s[alpha]]];
+ /*d[alpha] = s[alpha];*/
s += srcPR->bytes;
d += destPR->bytes;
@@ -200,11 +202,14 @@
unsigned char *mask, *m;
int w, h;
int value, red, green, blue;
+ int has_alpha, alpha;
ld = (LevelsDialog *) user_data;
h = srcPR->h;
src = srcPR->data;
+ has_alpha = (srcPR->bytes == 2 || srcPR->bytes == 4);
+ alpha = has_alpha ? srcPR->bytes - 1 : srcPR->bytes;
if (maskPR)
mask = maskPR->data;
@@ -226,7 +231,7 @@
red = s[RED_PIX];
green = s[GREEN_PIX];
blue = s[BLUE_PIX];
-
+ alpha = s[ALPHA_PIX];
if (maskPR)
{
values[HISTOGRAM_VALUE][value] += (double) *m / 255.0;
@@ -251,6 +256,14 @@
values[HISTOGRAM_VALUE][value] += 1.0;
}
+ if (has_alpha)
+ {
+ if (maskPR)
+ values[HISTOGRAM_ALPHA][s[alpha]] += (double) *m / 255.0;
+ else
+ values[HISTOGRAM_ALPHA][s[alpha]] += 1.0;
+ }
+
s += srcPR->bytes;
if (maskPR)
@@ -379,6 +392,16 @@
g_free (_levels);
}
+static MenuItem color_option_items[] =
+{
+ { "Value", 0, 0, levels_value_callback, NULL, NULL, NULL },
+ { "Red", 0, 0, levels_red_callback, NULL, NULL, NULL },
+ { "Green", 0, 0, levels_green_callback, NULL, NULL, NULL },
+ { "Blue", 0, 0, levels_blue_callback, NULL, NULL, NULL },
+ { "Alpha", 0, 0, levels_alpha_callback, NULL, NULL, NULL },
+ { NULL, 0, 0, NULL, NULL, NULL, NULL }
+};
+
void
levels_initialize (void *gdisp_ptr)
{
@@ -402,7 +425,7 @@
/* Initialize the values */
levels_dialog->channel = HISTOGRAM_VALUE;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
{
levels_dialog->low_input[i] = 0;
levels_dialog->gamma[i] = 1.0;
@@ -415,11 +438,23 @@
levels_dialog->color = drawable_color (levels_dialog->drawable_id);
levels_dialog->image_map = image_map_create (gdisp_ptr, levels_dialog->drawable_id);
+ /* check for alpha channel */
+ if (drawable_has_alpha (levels_dialog->drawable_id))
+ gtk_widget_set_sensitive( color_option_items[4].widget, TRUE);
+ else
+ gtk_widget_set_sensitive( color_option_items[4].widget, FALSE);
+
/* hide or show the channel menu based on image type */
if (levels_dialog->color)
- gtk_widget_show (levels_dialog->channel_menu);
- else
- gtk_widget_hide (levels_dialog->channel_menu);
+ for (i = 0; i < 4; i++)
+ gtk_widget_set_sensitive( color_option_items[i].widget, TRUE);
+ else
+ for (i = 1; i < 4; i++)
+ gtk_widget_set_sensitive( color_option_items[i].widget, FALSE);
+
+
+
+
levels_update (levels_dialog, LOW_INPUT | GAMMA | HIGH_INPUT | LOW_OUTPUT | HIGH_OUTPUT | DRAW);
levels_update (levels_dialog, INPUT_LEVELS | OUTPUT_LEVELS);
@@ -457,15 +492,6 @@
{ "Cancel", levels_cancel_callback, NULL, NULL }
};
-static MenuItem color_option_items[] =
-{
- { "Value", 0, 0, levels_value_callback, NULL, NULL, NULL },
- { "Red", 0, 0, levels_red_callback, NULL, NULL, NULL },
- { "Green", 0, 0, levels_green_callback, NULL, NULL, NULL },
- { "Blue", 0, 0, levels_blue_callback, NULL, NULL, NULL },
- { NULL, 0, 0, NULL, NULL, NULL, NULL }
-};
-
LevelsDialog *
levels_new_dialog ()
{
@@ -483,7 +509,7 @@
ld = g_malloc (sizeof (LevelsDialog));
ld->preview = TRUE;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
color_option_items [i].user_data = (gpointer) ld;
/* The shell and main vbox */
@@ -717,7 +743,7 @@
int i, j;
/* Recalculate the levels arrays */
- for (j = 0; j < 4; j++)
+ for (j = 0; j < 5; j++)
{
for (i = 0; i < 256; i++)
{
@@ -927,6 +953,22 @@
}
static void
+levels_alpha_callback (GtkWidget *w,
+ gpointer client_data)
+{
+ LevelsDialog *ld;
+
+ ld = (LevelsDialog *) client_data;
+
+ if (ld->channel != HISTOGRAM_ALPHA)
+ {
+ ld->channel = HISTOGRAM_ALPHA;
+ histogram_channel (ld->histogram, ld->channel);
+ levels_update (ld, ALL);
+ }
+}
+
+static void
levels_adjust_channel (LevelsDialog *ld,
HistogramValues *values,
int channel)
@@ -1525,7 +1567,7 @@
/* arrange to modify the levels */
if (success)
{
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 5; i++)
{
ld.low_input[i] = 0;
ld.gamma[i] = 1.0;
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 30 22:00:14 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id WAA17628 for scott; Mon, 30 Jun 1997 22:00:13 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa13732;
30 Jun 97 19:38 PDT
Received: (qmail 16438 invoked by uid 27258); 30 Jun 1997 20:58:07 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 16434 invoked by uid 27258); 30 Jun 1997 20:58:06 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 16428 invoked by uid 0); 30 Jun 1997 20:58:04 -0000
Received: from jens.metrix.de (jens@194.123.88.124)
by scam.xcf.berkeley.edu with SMTP; 30 Jun 1997 20:58:04 -0000
Received: (from jens@localhost) by jens.metrix.de (8.7.6/8.7.3) id XAA03620; Mon, 30 Jun 1997 23:05:10 +0200
To: gimp-developer@scam.XCF.Berkeley.EDU
Subject: [gimp-devel] [patch] blur.c
X-Face: Z[@OB)("ZvE?ev~1b+b!0ZUB.$%rh.9qE>dVf>q}Q/V?%d`J3gd!LR\aAZ8<Hwi]xTA(:*c;i3,?K?+rCy*^b$)a,}E?eo},}x2]5LlJysyoUOK"o[>K)'\Ulb7y-7*.If^;rHl['oa)n_M7E6w+LDKMs"G8_`c)uOS1^}.1|8Ill]7X68X-paeUOpBhz<F`B0?~^2Et~GYfw~/0]H]nx4~C_E/_mp#^7Ixc:
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
boundary="Multipart_Mon_Jun_30_23:05:08_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens Lautenbacher <jens@metrix.de>
Date: 30 Jun 1997 23:05:08 +0200
Message-ID: <m3radjyf7f.fsf@jens.metrix.de>
Lines: 105
X-Mailer: Gnus v5.4.60/XEmacs 20.3(beta10) - "Athens"
--Multipart_Mon_Jun_30_23:05:08_1997-1
Content-Type: text/plain; charset=US-ASCII
This patch to blur.c fixes the nasty "halo" effect when blurring e.g. a
white object on a transparent background (a transparent background
with color at black, that is) by correctly considering the alpha
channel. Thanks to Nether for finding the last(?) bug! This IRC thing
seems to be useful sometimes...
The same nasty bug still remains in all other convolution tools
(e.g. the gaussian blurs), the transformation tool and the scaleing of
layers (at least). Volunteers to fix these are welcome....
Regards,
jtl
--Multipart_Mon_Jun_30_23:05:08_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="blur.diff"
Content-Transfer-Encoding: 7bit
--- plug-ins/blur.c.orig Mon Jun 30 22:54:19 1997
+++ plug-ins/blur.c Mon Jun 30 22:43:33 1997
@@ -151,7 +151,9 @@
guchar *tmp;
gint row, col;
gint x1, y1, x2, y2;
-
+ gint has_alpha, ind;
+
+
/* Get the input area. This is the bounding box of the selection in
* the image (or the entire image if there is no selection). Only
* operating on the input area is simply an optimization. It doesn't
@@ -166,7 +168,8 @@
width = drawable->width;
height = drawable->height;
bytes = drawable->bpp;
-
+ has_alpha = gimp_drawable_has_alpha(drawable->id);
+
/* allocate row buffers */
prev_row = (guchar *) malloc ((x2 - x1 + 2) * bytes);
cur_row = (guchar *) malloc ((x2 - x1 + 2) * bytes);
@@ -191,11 +194,41 @@
blur_prepare_row (&srcPR, nr, x1, row + 1, (x2 - x1));
d = dest;
+ ind = 0;
for (col = 0; col < (x2 - x1) * bytes; col++)
- *d++ = ((gint) pr[col - bytes] + (gint) pr[col] + (gint) pr[col + bytes] +
- (gint) cr[col - bytes] + (gint) cr[col] + (gint) cr[col + bytes] +
- (gint) nr[col - bytes] + (gint) nr[col] + (gint) nr[col + bytes]) / 9;
-
+ {
+ ind++;
+
+ if (ind==bytes || !(has_alpha))
+ { /* we always do the alpha channel,
+ or if there's none we have no problem
+ so the algorithm stays the same */
+ *d++ = ((gint) pr[col - bytes] + (gint) pr[col] + (gint) pr[col + bytes] +
+ (gint) cr[col - bytes] + (gint) cr[col] + (gint) cr[col + bytes] +
+ (gint) nr[col - bytes] + (gint) nr[col] + (gint) nr[col + bytes]) / 9;
+ ind=0;
+ }
+ else { /* we have an alpha channel picture, and do the color part here */
+ *d++ = ((gint) (((gdouble) (pr[col - bytes] * pr[col - ind])
+ + (gdouble) (pr[col] * pr[col + bytes - ind])
+ + (gdouble) (pr[col + bytes] * pr[col + 2*bytes - ind])
+ + (gdouble) (cr[col - bytes] * cr[col - ind])
+ + (gdouble) (cr[col] * cr[col + bytes - ind])
+ + (gdouble) (cr[col + bytes] * cr[col + 2*bytes - ind])
+ + (gdouble) (nr[col - bytes] * nr[col - ind])
+ + (gdouble) (nr[col] * nr[col + bytes - ind])
+ + (gdouble) (nr[col + bytes] * nr[col + 2*bytes - ind]))
+ / ((gdouble) pr[col - ind]
+ + (gdouble) pr[col + bytes - ind]
+ + (gdouble) pr[col + 2*bytes - ind]
+ + (gdouble) cr[col - ind]
+ + (gdouble) cr[col + bytes - ind]
+ + (gdouble) cr[col + 2*bytes - ind]
+ + (gdouble) nr[col - ind]
+ + (gdouble) nr[col + bytes - ind]
+ + (gdouble) nr[col + 2*bytes - ind])));
+ }
+ }
/* store the dest */
gimp_pixel_rgn_set_row (&destPR, dest, x1, row, (x2 - x1));
--Multipart_Mon_Jun_30_23:05:08_1997-1
Content-Type: text/plain; charset=US-ASCII
--Multipart_Mon_Jun_30_23:05:08_1997-1--
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Tue Jun 17 05:30:18 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id FAA12382 for scott; Tue, 17 Jun 1997 05:30:16 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa09559;
17 Jun 97 3:05 PDT
Received: (qmail 11134 invoked by uid 27258); 10 Jun 1997 14:41:45 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 11131 invoked by uid 27258); 10 Jun 1997 14:41:43 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 11121 invoked from network); 10 Jun 1997 14:41:37 -0000
Received: from ppp00.inetq.or.jp (HELO sonic.InetQ.or.jp) (root@202.220.34.130)
by scam.xcf.berkeley.edu with SMTP; 10 Jun 1997 14:41:37 -0000
Received: (from narazaki@localhost) by sonic.InetQ.or.jp (8.8.0/8.8.0) id XAA00660; Tue, 10 Jun 1997 23:03:35 +0900
Date: Tue, 10 Jun 1997 23:03:35 +0900
Message-Id: <199706101403.XAA00660@sonic.InetQ.or.jp>
From: Shuji Narazaki <narazaki@InetQ.or.jp>
Gcc: nnfolder+archive:mail
To: gimp-developer@scam.XCF.Berkeley.EDU
Subject: [gimp-devel] [PATCH] set_paint_mode, CML_explorer and circle-logo
Hi,
Result of gimp-brushes-set-paint-mode is undeterministic, because
`success' is not initialized in its invoker. Here's a patch to fix it:
--- app/brushes.c.original Sat Jun 7 05:05:33 1997
+++ app/brushes.c Sun Jun 8 14:15:21 1997
@@ -835,11 +835,8 @@
{
int paint_mode;
- int_value = args[0].value.pdb_int;
- if (int_value >= NORMAL_MODE && int_value <= VALUE_MODE)
- paint_mode = int_value;
- else
- success = FALSE;
+ paint_mode = args[0].value.pdb_int;
+ success = (paint_mode >= NORMAL_MODE && paint_mode <= VALUE_MODE);
if (success)
set_brush_paint_mode (paint_mode);
------END-OF-PATCH
BTW, some scripts in 0.99.10 (by S&P?) use `else' in cond clause.
But it is not implemented in script-fu. Is this a feature? A deviation
from R4RS?
diff -u -d scripts-0.99.10/circle-logo.scm scripts/circle-logo.scm
--- plug-ins/script-fu/scripts-0.99.10/circle-logo.scm Wed Jun 4 06:11:36 1997
+++ plug-ins/script-fu/scripts/circle-logo.scm Mon Jun 9 22:16:24 1997
@@ -1,29 +1,63 @@
-;; text-circle a script for The GIMP
-;; Shuji Narazaki (narazaki@InetQ.or.jp)
-;; Time-stamp: <97/03/01 09:49:10 narazaki@InetQ.or.jp>
+;; circle-logo -- a script for The GIMP 1.0
+;; Author: Shuji Narazaki (narazaki@InetQ.or.jp)
+;; Time-stamp: <1997/06/09 22:16:20 narazaki@InetQ.or.jp>
+;; Version 1.3
-(define (script-fu-circle-logo text radius font font-size slant antialias)
- (let* ((width (* radius 2.5))
- (height (* radius 2.5))
- (img (car (gimp-image-new width height RGB)))
- (drawable (car (gimp-layer-new img width height RGBA_IMAGE
- "text-circle" 100 NORMAL)))
+(define modulo fmod) ; in R4RS way
+
+(define (script-fu-circle-logo text radius start-angle fill-angle
+ font font-size slant antialias)
+ (let* ((drawable-size (* 2.0 (+ radius (* 2 font-size))))
+ (img (car (gimp-image-new drawable-size drawable-size RGB)))
+ (BG-layer (car (gimp-layer-new img drawable-size drawable-size
+ RGBA_IMAGE "background" 100 NORMAL)))
+ (merged-layer #f)
(char-num (string-length text))
- (radians (/ (* 2 *pi*) char-num))
+ (radian-step 0)
(rad-90 (/ *pi* 2))
- (center-x (/ width 2))
- (center-y (/ height 2))
- (fixed-pole "]")
+ (center-x (/ drawable-size 2))
+ (center-y center-x)
+ (fixed-pole " ]Ag") ; some fonts have no "]" "g" has desc.
(font-infos (gimp-text-get-extents fixed-pole font-size PIXELS
"*" font "*" slant "*" "*"))
- (extra (max 0 (- (nth 0 font-infos) 5))) ; why 4? See text_tool.c.
+ (extra (max 0 (- (nth 0 font-infos) 5))) ; why 5? See text_tool.c.
(desc (nth 3 font-infos))
+ (angle-list #f)
(letter "")
(new-layer #f)
(index 0))
(gimp-image-disable-undo img)
- (gimp-image-add-layer img drawable 0)
- (gimp-edit-fill img drawable)
+ (gimp-image-add-layer img BG-layer 0)
+ (gimp-edit-fill img BG-layer)
+ ;; change units
+ (set! start-angle (* (/ (modulo start-angle 360) 360) 2 *pi*))
+ (set! fill-angle (* (/ fill-angle 360) 2 *pi*))
+ (set! radian-step (/ fill-angle char-num))
+ ;; make width-list
+ (let ((temp-list '())
+ (temp-str #f)
+ (scale 0)
+ (temp #f))
+ (set! index 0)
+ (while (< index char-num)
+ (set! temp-str (substring text index (+ index 1)))
+ (if (equal? " " temp-str)
+ (set! temp-str "]"))
+ (set! temp (gimp-text-get-extents temp-str font-size PIXELS
+ "*" font "*" slant "*" "*"))
+ (set! temp-list (cons (nth 0 temp) temp-list))
+ (set! index (+ index 1)))
+ (set! angle-list (nreverse temp-list))
+ (set! temp 0)
+ (set! angle-list
+ (mapcar (lambda (angle)
+ (let ((tmp temp))
+ (set! temp (+ angle temp))
+ (+ tmp (/ angle 2))))
+ angle-list))
+ (set! scale (/ fill-angle temp))
+ (set! angle-list (mapcar (lambda (angle) (* scale angle)) angle-list)))
+ (set! index 0)
(while (< index char-num)
(set! letter (substring text index (+ index 1)))
(if (not (equal? " " letter))
@@ -36,24 +70,35 @@
(width (car (gimp-drawable-width new-layer)))
(height (car (gimp-drawable-height new-layer)))
(rotate-radius (- (/ height 2) desc))
- (rad1 (- (* index radians) rad-90))
- (rad2 (* index radians)))
+ (angle (+ start-angle (- (nth index angle-list) rad-90))))
+ ;; delete fixed-pole
(gimp-layer-resize new-layer (- width extra 1) height 0 0)
- '(gimp-layer-translate new-layer (* index 34) 10)
+ (set! width (car (gimp-drawable-width new-layer)))
(gimp-layer-translate new-layer
(+ center-x
- (* radius (cos rad1))
- (- (* rotate-radius (sin rad2)))
+ (* radius (cos angle))
+ (* rotate-radius
+ (cos (if (< 0 fill-angle)
+ angle
+ (+ angle *pi*))))
(- (/ width 2)))
(+ center-y
- (* radius (sin rad1))
- (- (* rotate-radius (cos rad2)))
+ (* radius (sin angle))
+ (* rotate-radius
+ (sin (if (< 0 fill-angle)
+ angle
+ (+ angle *pi*))))
(- (/ height 2))))
- (gimp-rotate img new-layer 1 rad2)))
+ (gimp-rotate img new-layer 1
+ ((if (< 0 fill-angle) + -) angle rad-90))))
(set! index (+ index 1)))
- (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)
+ (gimp-layer-set-visible BG-layer 0)
+ (set! merged-layer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))
+ (gimp-layer-set-name merged-layer "text circle")
+ (gimp-layer-set-visible BG-layer 1)
(gimp-image-enable-undo img)
- (gimp-display-new img)))
+ (gimp-display-new img)
+ (gimp-displays-flush)))
(script-fu-register "script-fu-circle-logo"
"<Toolbox>/Xtns/Script-Fu/Logos/Text Circle"
@@ -62,13 +107,14 @@
"Shuji Narazaki"
"1997"
""
- SF-VALUE "Text" "\"Ring Ring Ring, Tiger! Tiger! Tiger! \""
+ SF-VALUE "Text" "\"Ring World again! Tiger! Tiger! Tiger! \""
SF-VALUE "Radius" "80"
+ SF-VALUE "Start-angle" "0"
+ SF-VALUE "Fill-angle" "360"
SF-VALUE "Family" "\"helvetica\""
- SF-VALUE "Font Size" "18"
+ SF-VALUE "Font Size (pixel)" "18"
SF-VALUE "Slant" "\"r\""
- SF-VALUE "Antialias(0,1)" "1"
+ SF-TOGGLE "Antialias" TRUE
)
-;(text-circle "This is a sample string. " "Bodoni" 24 80)
-;; end of text-circle.scm
+;; circle-logo.scm ends here
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Sat Jun 7 15:00:25 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id PAA24458 for scott; Sat, 7 Jun 1997 15:00:23 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa00532;
7 Jun 97 12:30 PDT
Received: (qmail 15471 invoked by uid 27258); 7 Jun 1997 19:20:22 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 15468 invoked by uid 27258); 7 Jun 1997 19:20:20 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 15441 invoked from network); 7 Jun 1997 19:19:54 -0000
Received: from jens.metrix.de (jens@194.123.88.124)
by scam.xcf.berkeley.edu with SMTP; 7 Jun 1997 19:19:54 -0000
Received: (from jens@localhost) by jens.metrix.de (8.7.6/8.7.3) id VAA00843; Sat, 7 Jun 1997 21:26:28 +0200
To: gimp-developer@scam.XCF.Berkeley.EDU
Subject: [gimp-devel] displace update.
X-Face: Z[@OB)("ZvE?ev~1b+b!0ZUB.$%rh.9qE>dVf>q}Q/V?%d`J3gd!LR\aAZ8<Hwi]xTA(:*c;i3,?K?+rCy*^b$)a,}E?eo},}x2]5LlJysyoUOK"o[>K)'\Ulb7y-7*.If^;rHl['oa)n_M7E6w+LDKMs"G8_`c)uOS1^}.1|8Ill]7X68X-paeUOpBhz<F`B0?~^2Et~GYfw~/0]H]nx4~C_E/_mp#^7Ixc:
Reply-To: jens@lemming0.lem.uni-karlsruhe.de
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
boundary="Multipart_Sat_Jun__7_21:26:26_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens Lautenbacher <jens@metrix.de>
Date: 07 Jun 1997 21:26:27 +0200
Message-ID: <m3pvty5i58.fsf@jens.metrix.de>
Lines: 294
X-Mailer: Gnus v5.4.55/XEmacs 20.3(beta3)
--Multipart_Sat_Jun__7_21:26:26_1997-1
Content-Type: text/plain; charset=US-ASCII
This is a little update for the displace plugin as distributed in
0.99.10. It fixes some embarresing stupid C code of mine and also adds
some small fixes from Quartic.
jtl
--Multipart_Sat_Jun__7_21:26:26_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="displace-patch"
Content-Transfer-Encoding: 7bit
--- plug-ins/displace.c Wed Jun 4 05:02:17 1997
+++ plug-ins/displace.c Sat Jun 7 20:25:08 1997
@@ -22,14 +22,14 @@
*
* Extensive modifications to the dialog box, parameters, and some
* legibility stuff in displace() by Federico Mena Quintero ---
- * quartic@polloux.fciencias.unam.mx. If there are any bugs in these
+ * federico@nuclecu.unam.mx. If there are any bugs in these
* changes, they are my fault and not Stephen's.
*
* JTL: May 29th 1997
* Added (part of) the patch from Eiichi Takamori -- the part which removes the border artefacts
* (http://ha1.seikyou.ne.jp/home/taka/gimp/displace/displace.html)
* Added ability to use transparency as the identity transformation
- * (Full transparency is treated as if it was grey 128)
+ * (Full transparency is treated as if it was grey 0.5)
* and the possibility to use RGB/RGBA pictures where the intensity of the pixel is taken into account
*
*/
@@ -40,6 +40,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <unistd.h>
+#include <signal.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
@@ -299,8 +301,9 @@
argv = g_new (gchar *, 1);
argv[0] = g_strdup ("displace");
+ printf("displace: pid = %d\n", getpid());
+
gtk_init (&argc, &argv);
- gtk_rc_parse (gimp_gtkrc ());
dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dlg), "Displace");
@@ -488,11 +491,11 @@
gint k;
gdouble xm_val, ym_val;
- gint xm_alpha=0;
- gint ym_alpha=0;
- gint xm_bytes=1;
- gint ym_bytes=1;
-
+ gint xm_alpha = 0;
+ gint ym_alpha = 0;
+ gint xm_bytes = 1;
+ gint ym_bytes = 1;
+
/* Get selection area */
gimp_drawable_mask_bounds (drawable->id, &x1, &y1, &x2, &y2);
@@ -513,7 +516,8 @@
{
map_x = gimp_drawable_get (dvals.displace_map_x);
gimp_pixel_rgn_init (&map_x_rgn, map_x, x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
- if (gimp_drawable_has_alpha(map_x->id)) xm_alpha = 1;
+ if (gimp_drawable_has_alpha(map_x->id))
+ xm_alpha = 1;
xm_bytes = gimp_drawable_bpp(map_x->id);
}
else
@@ -523,7 +527,8 @@
{
map_y = gimp_drawable_get (dvals.displace_map_y);
gimp_pixel_rgn_init (&map_y_rgn, map_y, x1, y1, (x2 - x1), (y2 - y1), FALSE, FALSE);
- if (gimp_drawable_has_alpha(map_y->id)) ym_alpha = 1;
+ if (gimp_drawable_has_alpha(map_y->id))
+ ym_alpha = 1;
ym_bytes = gimp_drawable_bpp(map_y->id);
}
else
@@ -531,7 +536,6 @@
gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, (x2 - x1), (y2 - y1), TRUE, TRUE);
-
/* Register the pixel regions */
if (dvals.do_x && dvals.do_y)
pr = gimp_pixel_rgns_register (3, &dest_rgn, &map_x_rgn, &map_y_rgn);
@@ -542,7 +546,6 @@
else
pr = NULL;
-
for (pr = pr; pr != NULL; pr = gimp_pixel_rgns_process (pr))
{
destrow = dest_rgn.data;
@@ -550,52 +553,58 @@
mxrow = map_x_rgn.data;
if (dvals.do_y)
myrow = map_y_rgn.data;
-
+
for (y = dest_rgn.y; y < (dest_rgn.y + dest_rgn.h); y++)
{
dest = destrow;
mx = mxrow;
my = myrow;
-
+
/*
* We could move the displacement image address calculation out of here,
* but when we can have different sized displacement and destination
* images we'd have to move it back anyway.
*/
-
+
for (x = dest_rgn.x; x < (dest_rgn.x + dest_rgn.w); x++)
{
if (dvals.do_x)
{
- xm_val = displace_map_give_value(mx, xm_alpha, xm_bytes);
- amnt = dvals.amount_x * ((((double) xm_val) - 128.0)
- / 128.0);
- needx = x + amnt;
- mx += xm_bytes * sizeof(guchar);
+ xm_val = displace_map_give_value(mx, xm_alpha, xm_bytes);
+ amnt = dvals.amount_x * (xm_val - 127.5) / 127.5;
+ needx = x + amnt;
+ mx += xm_bytes;
}
else
needx = x;
-
+
if (dvals.do_y)
{
- ym_val = displace_map_give_value(my, ym_alpha, ym_bytes);
- amnt = dvals.amount_y * ((((double) ym_val) - 128.0)
- / 128.0);
- needy = y + amnt;
- my += ym_bytes * sizeof(guchar); }
+ ym_val = displace_map_give_value(my, ym_alpha, ym_bytes);
+ amnt = dvals.amount_y * (ym_val - 127.5) / 127.5;
+ needy = y + amnt;
+ my += ym_bytes;
+ }
else
needy = y;
-
+
/* Calculations complete; now copy the proper pixel */
+
+ if (needx >= 0.0)
+ xi = (int) needx;
+ else
+ xi = -((int) -needx + 1);
- xi = needx;
- yi = needy;
-
+ if (needy >= 0.0)
+ yi = (int) needy;
+ else
+ yi = -((int) -needy + 1);
+
tile = displace_pixel (drawable, tile, width, height, x1, y1, x2, y2, xi, yi, &row, &col, pixel[0]);
tile = displace_pixel (drawable, tile, width, height, x1, y1, x2, y2, xi + 1, yi, &row, &col, pixel[1]);
tile = displace_pixel (drawable, tile, width, height, x1, y1, x2, y2, xi, yi + 1, &row, &col, pixel[2]);
tile = displace_pixel (drawable, tile, width, height, x1, y1, x2, y2, xi + 1, yi + 1, &row, &col, pixel[3]);
-
+
for (k = 0; k < bytes; k++)
{
values[0] = pixel[0][k];
@@ -603,19 +612,19 @@
values[2] = pixel[2][k];
values[3] = pixel[3][k];
val = bilinear(needx, needy, values);
-
+
*dest++ = val;
} /* for */
}
-
+
destrow += dest_rgn.rowstride;
-
+
if (dvals.do_x)
mxrow += map_x_rgn.rowstride;
if (dvals.do_y)
myrow += map_y_rgn.rowstride;
}
-
+
progress += dest_rgn.w * dest_rgn.h;
gimp_progress_update ((double) progress / (double) max_progress);
} /* for */
@@ -633,29 +642,28 @@
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->id, TRUE);
gimp_drawable_update (drawable->id, x1, y1, (x2 - x1), (y2 - y1));
-
} /* displace */
static gdouble
displace_map_give_value(guchar *pt, gint alpha, gint bytes)
{
- gdouble ret, val_alpha;
+ gdouble ret, val_alpha;
+
+ if (bytes >= 3)
+ ret = 0.30 * pt[0] + 0.59 * pt[1] + 0.11 * pt[2];
+ else
ret = (gdouble) *pt;
-
- if (bytes >= 3)
- ret = 0.3 * (gdouble) *pt
- + 0.59 * (gdouble) *(pt + sizeof(guchar))
- + 0.11 * (gdouble) *(pt + 2*sizeof(guchar));
- if (alpha)
- {
- val_alpha = *(pt + (bytes - 1)*sizeof(guchar));
- ret = ( (ret - 127.5) * val_alpha / 255 ) + 127.5;
- };
-
- return (ret);
+
+ if (alpha)
+ {
+ val_alpha = pt[bytes - 1];
+ ret = ((ret - 127.5) * val_alpha / 255.0) + 127.5;
+ };
+
+ return (ret);
}
-/*****/
+
static GTile *
displace_pixel (GDrawable * drawable,
@@ -726,6 +734,7 @@
return tile;
}
+
static guchar
bilinear (gdouble x, gdouble y, guchar *v)
{
@@ -739,10 +748,10 @@
if (y < 0)
y += 1.0;
- m0 = (1.0 - x) * v[0] + x * v[1];
- m1 = (1.0 - x) * v[2] + x * v[3];
+ m0 = (gdouble) v[0] + x * ((gdouble) v[1] - v[0]);
+ m1 = (gdouble) v[2] + x * ((gdouble) v[3] - v[2]);
- return (guchar) ((1.0 - y) * m0 + y * m1);
+ return (guchar) (m0 + y * (m1 - m0));
} /* bilinear */
@@ -761,9 +770,7 @@
return TRUE;
if (gimp_drawable_width (drawable_id) == drawable->width &&
- gimp_drawable_height (drawable_id) == drawable->height
- /* && gimp_drawable_gray (drawable_id) */
- )
+ gimp_drawable_height (drawable_id) == drawable->height)
return TRUE;
else
return FALSE;
--Multipart_Sat_Jun__7_21:26:26_1997-1
Content-Type: text/plain; charset=US-ASCII
--Multipart_Sat_Jun__7_21:26:26_1997-1--
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 23 03:01:11 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id DAA09608 for scott; Mon, 23 Jun 1997 03:01:10 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa07477;
23 Jun 97 0:41 PDT
Received: (qmail 13682 invoked by uid 27258); 23 Jun 1997 07:05:45 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 13678 invoked by uid 27258); 23 Jun 1997 07:05:44 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 13672 invoked by uid 0); 23 Jun 1997 07:05:43 -0000
Received: from ns1.netads.com (HELO wildride.netads.com) (206.81.38.2)
by scam.xcf.berkeley.edu with SMTP; 23 Jun 1997 07:05:43 -0000
Received: (from meo@localhost) by wildride.netads.com (8.6.11/8.6.11) id CAA17895 for gimp-developer@scam.XCF.Berkeley.EDU; Mon, 23 Jun 1997 02:15:08 -0500
Message-Id: <199706230715.CAA17895@wildride.netads.com>
Subject: [gimp-devel] [patch] file open dialog trailing slash bug fix
To: gimp-developer@scam.XCF.Berkeley.EDU (GIMP Developer)
Date: Mon, 23 Jun 1997 02:15:07 -0500 (CDT)
From: meo@netads.com (Miles O'Neal)
Sender: meo@netads.com (Miles O'Neal)
Reply-To: meo@netads.com (Miles O'Neal)
Organization: RRU
X-WWW-URL: http://www.netads.com/~meo/
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
In 0.99.10 (and I believe earlier versions, though
I haven't checked), if you enter a directory path
in the file open dialog text widget, and the path
has a trailing slash, the result is a filename of
"/", and no images,
The problem is a result of the fact that directories
always have a slash appended. The enclosed patch
may not be the best solution, but it solves the
problem.
-Miles
------------------------snip snip ----------------------
--- app/fileops.c Mon Jun 23 01:44:40 1997
+++ app/fileops.c Mon Jun 23 01:52:29 1997
@@ -817,7 +817,10 @@
if (err == 0 && (buf.st_mode & S_IFDIR))
{
GString *s = g_string_new (filename);
- g_string_append_c (s, '/');
+ if (s->str[s->len - 1] != '/')
+ {
+ g_string_append_c (s, '/');
+ }
gtk_file_selection_set_filename (fs, s->str);
g_string_free (s, TRUE);
return;
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Sat Jun 7 17:00:35 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id RAA27371 for scott; Sat, 7 Jun 1997 17:00:35 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa03071;
7 Jun 97 14:57 PDT
Received: (qmail 25581 invoked by uid 27258); 7 Jun 1997 21:48:25 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 25578 invoked by uid 27258); 7 Jun 1997 21:48:23 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 25572 invoked from network); 7 Jun 1997 21:48:23 -0000
Received: from emout20.mx.aol.com (HELO emout20.mail.aol.com) (198.81.11.46)
by scam.xcf.berkeley.edu with SMTP; 7 Jun 1997 21:48:23 -0000
Received: (from root@localhost)
by emout20.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id RAA06999 for gimp-developer@scam.xcf.berkeley.edu;
Sat, 7 Jun 1997 17:56:19 -0400 (EDT)
Date: Sat, 7 Jun 1997 17:56:19 -0400 (EDT)
From: Pkirchg@aol.com
Message-ID: <970607175619_321138612@emout20.mail.aol.com>
To: gimp-developer@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] Bug in automatic filetype detection
High!
The new automatic filetype detection in GIMP 0.99.10 does not work
when a file is loaded through the file selection box from a different
directory. Here is a patch to app/fileops.c that fixes this.
Sincerely
Peter
--- app/fileops.c.orig Sat Jun 7 23:27:11 1997
+++ app/fileops.c Sat Jun 7 23:34:46 1997
@@ -698,7 +698,7 @@
file_proc = load_file_proc;
if (!file_proc)
- file_proc = file_proc_find (load_procs, raw_filename);
+ file_proc = file_proc_find (load_procs, filename);
if (!file_proc)
{
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Sun Jun 8 21:30:34 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id VAA26318 for scott; Sun, 8 Jun 1997 21:30:34 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa11008;
8 Jun 97 19:09 PDT
Received: (qmail 24567 invoked by uid 27258); 8 Jun 1997 20:11:55 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 24559 invoked by uid 27258); 8 Jun 1997 20:11:52 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 24550 invoked from network); 8 Jun 1997 20:11:50 -0000
Received: from emout08.mx.aol.com (HELO emout08.mail.aol.com) (198.81.11.23)
by scam.xcf.berkeley.edu with SMTP; 8 Jun 1997 20:11:50 -0000
Received: (from root@localhost)
by emout08.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id NAA05287;
Sun, 8 Jun 1997 13:53:45 -0400 (EDT)
Date: Sun, 8 Jun 1997 13:53:45 -0400 (EDT)
From: Pkirchg@aol.com
Message-ID: <970608135344_-562142130@emout08.mail.aol.com>
To: gimp-developer@scam.xcf.berkeley.edu
cc: gimp-announce@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] FITS plugin
Hello,
here is a patch that fixes a bug for the FITS-plug-in,
when writing GRAY-images (fits dumps core).
The complete sources are available at
ftp://members.aol.com/pkirchg/pub/gimp/fits.tgz
Bye
Peter K.
--- plug-ins/fits.c.orig Fri Jun 6 09:04:53 1997
+++ plug-ins/fits.c Sun Jun 8 18:42:45 1997
@@ -23,8 +23,9 @@
/* Event history:
* V 1.00, PK, 05-May-97: Creation
* V 1.01, PK, 19-May-97: Problem with compilation on Irix fixed
+ * V 1.02, PK, 08-Jun-97: Bug with saving gray images fixed
*/
-static char ident[] = "@(#) GIMP FITS file-plugin v1.01 19-May-97";
+static char ident[] = "@(#) GIMP FITS file-plugin v1.02 08-Jun-97";
#include <stdio.h>
#include <stdlib.h>
@@ -668,7 +669,9 @@
int print_ctype3 = 0; /* The CTYPE3-card may not be FITS-conforming */
static char *ctype3_card[] = {
NULL, NULL, NULL, /* bpp = 0: no additional card */
- NULL, NULL, NULL, /* GRAY-image: no additional card */
+ "COMMENT Image type within GIMP: GRAY_IMAGE",
+ NULL,
+ NULL,
"COMMENT Image type within GIMP: GRAYA_IMAGE (gray with alpha channel)",
"COMMENT Sequence for NAXIS3 : GRAY, ALPHA",
"CTYPE3 = 'GRAYA ' / GRAY IMAGE WITH ALPHA CHANNEL",
@@ -710,8 +713,9 @@
"COMMENT For sources see ftp://members.aol.com/pkirchg/pub/gimp");
fits_add_card (hdulist, "");
fits_add_card (hdulist, ctype3_card[bpp*3]);
- fits_add_card (hdulist, ctype3_card[bpp*3+1]);
- if (print_ctype3 && (ctype3_card[bpp] != NULL))
+ if (ctype3_card[bpp*3+1] != NULL)
+ fits_add_card (hdulist, ctype3_card[bpp*3+1]);
+ if (print_ctype3 && (ctype3_card[bpp*3+2] != NULL))
fits_add_card (hdulist, ctype3_card[bpp*3+2]);
fits_add_card (hdulist, "");
Return-Path: dal56.dhc.net!wopr.sac!seth@gilroy.rmp.com
Return-Path: dal56.dhc.net!wopr.sac!seth@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id UAA21297 for scott; Wed, 2 Jul 1997 20:00:31 -0500
Received: from dal56.dhc.net by gilroy.rmp.com id aa24747; 2 Jul 97 17:36 PDT
Received: (from root@localhost) by wopr.sac (8.7.6/8.7.3) id TAA29211 for scott@poverty.bloomington.in.us; Wed, 2 Jul 1997 19:34:08 -0400
From: Seth Burgess <seth@wopr.sac>
Message-Id: <199707022334.TAA29211@wopr.sac>
Subject: Plug-in patch
To: scott@poverty.bloomington.in.us
Date: Wed, 2 Jul 1997 19:34:07 -0400 (EDT)
Reply-To: sjburges@ou.edu
X-Mailer: ELM [version 2.4ME+ PL28 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
This patches gbr.c to actually use all 7 paramters passed to it by a plug-in
when saving. Its basically for my Make Brush script-fu. (see jen's page)
seth
sjburges@ou.edu
--- gimp-0.99.10.orig/plug-ins/gbr.c Fri Jun 6 03:03:49 1997
+++ plug-ins/gbr.c Mon Jun 30 21:04:13 1997
@@ -28,8 +28,8 @@
unsigned int spacing;
} t_info;
-t_info info = {
- "GIMP Brush",
+t_info info = { /* Initialize to this, change if non-interactive later */
+ "GIMP Brush",
10
};
@@ -159,9 +159,15 @@
if (!save_dialog())
return;
break;
- case RUN_NONINTERACTIVE:
+ case RUN_NONINTERACTIVE: /* FIXME - need a real RUN_NONINTERACTIVE */
if (nparams != 7)
status = STATUS_CALLING_ERROR;
+ if (status == STATUS_SUCCESS)
+ {
+ info.spacing = (param[5].data.d_int32);
+ strncpy (info.description, param[6].data.d_string, 256);
+ }
+ break;
case RUN_WITH_LAST_VALS:
gimp_get_data ("file_gbr_save", &info);
break;
@@ -275,6 +281,7 @@
fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd == -1) {
+ printf("Unable to open %s\n", filename);
return 0;
}
*** plug-ins/gif.c.0.99.10 Sun Jun 8 18:27:24 1997
--- plug-ins/gif.c Sun Jul 6 20:33:56 1997
***************
*** 1,14 ****
/* GIF loading and saving file filter for the Gimp version 0.99+
! * -Peter Mattis & Spencer Kimball
! *
! * version 1.99.3 - 97/05/18
! *
! * Additional transparent/animated GIF stuff is by Adam D. Moss,
! * adam@foxbox.org - still in progress, 97/05/18
*
*
* This filter uses code taken from the "giftopnm" and "ppmtogif" programs
! * which are part of the "netpbm" package.
*/
--- 1,11 ----
/* GIF loading and saving file filter for the Gimp version 0.99+
! * -Peter Mattis & Spencer Kimball
*
+ * Version 1.99.10 - 97/07/06 - Adam D. Moss, adam@foxbox.org
+ * Advanced features still in progress.
*
* This filter uses code taken from the "giftopnm" and "ppmtogif" programs
! * which are part of the "netpbm" package.
*/
***************
*** 16,32 ****
* "The Graphics Interchange Format(c) is the Copyright property of
* CompuServe Incorporated. GIF(sm) is a Service Mark property of
* CompuServe Incorporated."
- *
*/
/*
* REVISION HISTORY
*
* 97/05/18
* 1.99.3 - Fixed the problem with GIFs getting loop extensions even
* if they only had one frame (thanks to Zach for noticing -
! * git! :) )
*
* 97/05/17
* 1.99.2 - Can now save animated GIFs. Correctly handles saving of
--- 13,74 ----
* "The Graphics Interchange Format(c) is the Copyright property of
* CompuServe Incorporated. GIF(sm) is a Service Mark property of
* CompuServe Incorporated."
*/
/*
* REVISION HISTORY
*
+ * 97/07/06
+ * 1.99.10 - New 'save' dialog, now most of the default behaviour of
+ * animated GIF saving is user-settable (looping, default
+ * time between frames, etc.)
+ * PDB entry for saving is no longer compatible. Fortunately
+ * I don't think that anyone is using file_gif_save in
+ * scripts. [Adam]
+ *
+ * 97/07/05
+ * 1.99.9 - More animated GIF work: now loads and saves frame disposal
+ * information. This is neat and will also allow some delta
+ * stuff in the future.
+ * The disposal-method is kept in the layer name, like the timing
+ * info.
+ * (replace) - this frame replaces whatever else has been shown
+ * so far.
+ * (combine) - this frame builds apon the previous frame.
+ * If a disposal method is not specified, it is assumed to mean
+ * "don't care." [Adam]
+ *
+ * 97/07/04
+ * 1.99.8 - Can save per-frame timing information too, now. The time
+ * for which a frame is visible is specified within the layer name
+ * as i,e. (250ms). If a frame doesn't have this timing value
+ * it defaults to lasting 100ms. [Adam]
+ *
+ * 97/07/02
+ * 1.99.7 - For animated GIFs, fixed the saving of timing information for
+ * frames which couldn't be made transparent.
+ * Added the loading of timing information into the layer
+ * names. Adjusted GIMP's GIF magic number very slightly. [Adam]
+ *
+ * 97/06/30
+ * 1.99.6 - Now saves GRAY and GRAYA images, albeit not always
+ * optimally (yet). [Adam]
+ *
+ * 97/06/25
+ * 1.99.5 - Good, the transparancy-on-big-architectures bug is
+ * fixed. Cleaned up some stuff.
+ * (Adam D. Moss, adam@foxbox.org)
+ *
+ * 97/06/23
+ * 1.99.4 - Trying to fix some endianness/word-size problems with
+ * transparent gif-saving on some architectures... does
+ * this help? (Adam D. Moss, adam@foxbox.org)
+ *
* 97/05/18
* 1.99.3 - Fixed the problem with GIFs getting loop extensions even
* if they only had one frame (thanks to Zach for noticing -
! * git! :) ) (Adam D. Moss, adam@foxbox.org)
*
* 97/05/17
* 1.99.2 - Can now save animated GIFs. Correctly handles saving of
***************
*** 37,43 ****
* 97/05/16
* 1.99.1 - Implemented image offsets in animated GIF loading. Requires
* a fix to gimp_layer_translate in libgimp/gimplayer.c if used
! * with GIMP versions <= 0.99.9. Started work on saving animated
* GIFs. Started TODO list. (Adam D. Moss, adam@foxbox.org)
*
* 97/05/15
--- 79,85 ----
* 97/05/16
* 1.99.1 - Implemented image offsets in animated GIF loading. Requires
* a fix to gimp_layer_translate in libgimp/gimplayer.c if used
! * with GIMP versions <= 0.99.10. Started work on saving animated
* GIFs. Started TODO list. (Adam D. Moss, adam@foxbox.org)
*
* 97/05/15
***************
*** 53,77 ****
/*
! * TODO
*
* - animated GIF optimization routines (seperate plugin)
*
* - 'requantize' option for INDEXEDA images which really have 256 colours
* in them
*
* - Be a bit smarter about finding unused/superfluous colour indices for
* lossless colour crunching of INDEXEDA images. (Specifically, look
* for multiple indices which correspond to the same physical colour.)
*
* - Tidy up parameters for the GIFEncode routines
*
- * - Finish sane handling of transparency in animated GIF saving - dispose?
- *
- * - ** Make timing stuff in animated GIF saving user-settable
- *
- * - Make animated GIF looping more flexible
- *
* - *** Add 'extents' code for correct logical screen sizing in animated
* GIF saving (without this we can save images which don't quite conform
* to GIF rules :-( ) COPE WITH NEGATIVE OFFSETS
--- 95,115 ----
/*
! * TODO (more *'s means more important!)
*
* - animated GIF optimization routines (seperate plugin)
*
* - 'requantize' option for INDEXEDA images which really have 256 colours
* in them
*
+ * - * Write an animation playback plugin.
+ *
* - Be a bit smarter about finding unused/superfluous colour indices for
* lossless colour crunching of INDEXEDA images. (Specifically, look
* for multiple indices which correspond to the same physical colour.)
*
* - Tidy up parameters for the GIFEncode routines
*
* - *** Add 'extents' code for correct logical screen sizing in animated
* GIF saving (without this we can save images which don't quite conform
* to GIF rules :-( ) COPE WITH NEGATIVE OFFSETS
***************
*** 79,96 ****
* - When loading animated GIFs, properly deal with evil changes of
* colourmap from frame to frame. (Will have to convert to RGB :~( )
*
! * - When loading animated GIFs, properly deal with the dispose methods.
! *
! * - *** Save GRAYSCALE* images.
*
* - All the warning messages etc. which the plugin prints to STDOUT should
* pop up in windows.
*
- * - Verify that transparent GIF saving works on 64-bit/big-endian machines
- * (had one report that it doesn't work on a sun Ultra).
- *
- * - *** Remind S&P to fix gimp_layer_translate if they haven't already. :^)
- *
*/
--- 117,127 ----
* - When loading animated GIFs, properly deal with evil changes of
* colourmap from frame to frame. (Will have to convert to RGB :~( )
*
! * - Remove unused colourmap entries for GRAYSCALE images.
*
* - All the warning messages etc. which the plugin prints to STDOUT should
* pop up in windows.
*
*/
***************
*** 110,121 ****
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
typedef struct
{
! int interlace;
} GIFSaveVals;
typedef struct
--- 141,158 ----
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ #include <ctype.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
+
+
typedef struct
{
! int interlace;
! int loop;
! int default_delay;
! int default_dispose;
} GIFSaveVals;
typedef struct
***************
*** 123,128 ****
--- 160,167 ----
gint run;
} GIFSaveInterface;
+
+
/* Declare some local functions.
*/
static void query (void);
***************
*** 136,142 ****
gint32 image_ID,
gint32 drawable_ID);
! static gint save_dialog ();
static void save_close_callback (GtkWidget *widget,
gpointer data);
--- 175,181 ----
gint32 image_ID,
gint32 drawable_ID);
! static gint save_dialog ( gint32 image_ID );
static void save_close_callback (GtkWidget *widget,
gpointer data);
***************
*** 144,149 ****
--- 183,194 ----
gpointer data);
static void save_toggle_update (GtkWidget *widget,
gpointer data);
+ static void save_entry_callback (GtkWidget *widget,
+ gpointer data);
+
+
+
+ static gint radio_pressed[3];
***************
*** 157,163 ****
static GIFSaveVals gsvals =
{
! FALSE /* interlace */
};
static GIFSaveInterface gsint =
--- 202,211 ----
static GIFSaveVals gsvals =
{
! FALSE, /* interlace */
! TRUE, /* loop infinitely */
! 100, /* default_delay between frames (100ms) */
! 0 /* default_dispose = "don't care" */
};
static GIFSaveInterface gsint =
***************
*** 166,171 ****
--- 214,220 ----
};
+
MAIN ();
static void
***************
*** 191,197 ****
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
{ PARAM_STRING, "raw_filename", "The name entered" },
! { PARAM_INT32, "interlace", "Save with interlacing option enabled" }
};
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
--- 240,249 ----
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
{ PARAM_STRING, "raw_filename", "The name entered" },
! { PARAM_INT32, "interlace", "Save as interlaced" },
! { PARAM_INT32, "loop", "(animated gif) loop infinitely" },
! { PARAM_INT32, "default_delay", "(animated gif) Default delay between framese in milliseconds" },
! { PARAM_INT32, "default_dispose", "(animated gif) Default disposal type (0=`don't care`, 1=combine, 2=replace)" }
};
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
***************
*** 219,225 ****
nsave_args, 0,
save_args, NULL);
! gimp_register_magic_load_handler ("file_gif_load", "gif", "", "0,string,GIF");
gimp_register_save_handler ("file_gif_save", "gif", "");
}
--- 271,277 ----
nsave_args, 0,
save_args, NULL);
! gimp_register_magic_load_handler ("file_gif_load", "gif", "", "0,string,GIF8");
gimp_register_save_handler ("file_gif_save", "gif", "");
}
***************
*** 244,250 ****
if (strcmp (name, "file_gif_load") == 0)
{
- g_debug ("fuck");
image_ID = load_image (param[1].data.d_string);
if (image_ID != -1)
--- 296,301 ----
***************
*** 264,284 ****
switch (run_mode)
{
case RUN_INTERACTIVE:
! /* Possibly retrieve data */
! gimp_get_data ("file_gif_save", &gsvals);
!
! /* First acquire information with a dialog */
! if (! save_dialog ())
! return;
break;
case RUN_NONINTERACTIVE:
/* Make sure all the arguments are there! */
! if (nparams != 6)
status = STATUS_CALLING_ERROR;
if (status == STATUS_SUCCESS)
{
gsvals.interlace = (param[5].data.d_int32) ? TRUE : FALSE;
}
break;
--- 315,347 ----
switch (run_mode)
{
case RUN_INTERACTIVE:
! {
! /* Possibly retrieve data */
! gimp_get_data ("file_gif_save", &gsvals);
!
! /* First acquire information with a dialog */
! radio_pressed[0] = radio_pressed[1] = radio_pressed[2] = FALSE;
! radio_pressed[gsvals.default_dispose] = TRUE;
! if (! save_dialog (param[1].data.d_int32))
! return;
! if (radio_pressed[0]) gsvals.default_dispose = 0x00;
! else
! if (radio_pressed[1]) gsvals.default_dispose = 0x01;
! else
! if (radio_pressed[2]) gsvals.default_dispose = 0x02;
! }
break;
case RUN_NONINTERACTIVE:
/* Make sure all the arguments are there! */
! if (nparams != 9)
status = STATUS_CALLING_ERROR;
if (status == STATUS_SUCCESS)
{
gsvals.interlace = (param[5].data.d_int32) ? TRUE : FALSE;
+ gsvals.loop = (param[6].data.d_int32) ? TRUE : FALSE;
+ gsvals.default_delay = param[7].data.d_int32;
+ gsvals.default_dispose = param[8].data.d_int32;
}
break;
***************
*** 292,298 ****
}
*nreturn_vals = 1;
! if (save_image (param[3].data.d_string, param[1].data.d_int32, param[2].data.d_int32))
{
/* Store psvals data */
gimp_set_data ("file_gif_save", &gsvals, sizeof (GIFSaveVals));
--- 355,363 ----
}
*nreturn_vals = 1;
! if (save_image (param[3].data.d_string,
! param[1].data.d_int32,
! param[2].data.d_int32))
{
/* Store psvals data */
gimp_set_data ("file_gif_save", &gsvals, sizeof (GIFSaveVals));
***************
*** 455,461 ****
}
if (c == '!')
! { /* Extension */
if (!ReadOK (fd, &c, 1))
{
printf ("GIF: OF / read error on extention function code\n");
--- 520,527 ----
}
if (c == '!')
! {
! /* Extension */
if (!ReadOK (fd, &c, 1))
{
printf ("GIF: OF / read error on extention function code\n");
***************
*** 854,860 ****
gint cur_progress, max_progress;
gint v;
gint i, j;
! gchar framename[20];
gboolean alpha_frame = FALSE;
/*
--- 920,926 ----
gint cur_progress, max_progress;
gint v;
gint i, j;
! gchar framename[200]; /* FIXME */
gboolean alpha_frame = FALSE;
/*
***************
*** 877,891 ****
image_ID = gimp_image_new (len, height, INDEXED);
gimp_image_set_filename (image_ID, filename);
if (Gif89.transparent == -1)
{
! layer_ID = gimp_layer_new (image_ID, "Background",
len, height,
INDEXED_IMAGE, 100, NORMAL_MODE);
}
else
{
! layer_ID = gimp_layer_new (image_ID, "Background",
len, height,
INDEXEDA_IMAGE, 100, NORMAL_MODE);
alpha_frame=TRUE;
--- 943,976 ----
image_ID = gimp_image_new (len, height, INDEXED);
gimp_image_set_filename (image_ID, filename);
+ if (Gif89.delayTime < 0)
+ strcpy(framename, "Background");
+ else
+ sprintf(framename, "Background (%dms)", 10*Gif89.delayTime);
+
+ switch (Gif89.disposal)
+ {
+ case 0x00: break; /* 'don't care' */
+ case 0x01: strcat(framename," (combine)"); break;
+ case 0x02: strcat(framename," (replace)"); break;
+ case 0x03: strcat(framename," (combine)"); break;
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ case 0x07: printf("GIF: Hmm... please forward this GIF to the "
+ "GIF plugin author!\n (adam@foxbox.org)\n"); break;
+ default: printf("GIF: Something got corrupted.\n"); break;
+ }
+
if (Gif89.transparent == -1)
{
! layer_ID = gimp_layer_new (image_ID, framename,
len, height,
INDEXED_IMAGE, 100, NORMAL_MODE);
}
else
{
! layer_ID = gimp_layer_new (image_ID, framename,
len, height,
INDEXEDA_IMAGE, 100, NORMAL_MODE);
alpha_frame=TRUE;
***************
*** 893,899 ****
}
else
{
! sprintf(framename, "Frame %d", frame_number);
layer_ID = gimp_layer_new (image_ID, framename,
len, height,
INDEXEDA_IMAGE, 100, NORMAL_MODE);
--- 978,1003 ----
}
else
{
! if (Gif89.delayTime < 0)
! sprintf(framename, "Frame %d", frame_number);
! else
! sprintf(framename, "Frame %d (%dms)",
! frame_number, 10*Gif89.delayTime);
!
! switch (Gif89.disposal)
! {
! case 0x00: break; /* 'don't care' */
! case 0x01: strcat(framename," (combine)"); break;
! case 0x02: strcat(framename," (replace)"); break;
! case 0x03: strcat(framename," (combine)"); break;
! case 0x04:
! case 0x05:
! case 0x06:
! case 0x07: printf("GIF: Hmm... please forward this GIF to the "
! "GIF plugin author!\n (adam@foxbox.org)\n"); break;
! default: printf("GIF: Something got corrupted.\n"); break;
! }
!
layer_ID = gimp_layer_new (image_ID, framename,
len, height,
INDEXEDA_IMAGE, 100, NORMAL_MODE);
***************
*** 978,984 ****
}
cur_progress++;
! if ((cur_progress % 10) == 0)
gimp_progress_update ((double) cur_progress / (double) max_progress);
}
if (ypos >= height)
--- 1082,1088 ----
}
cur_progress++;
! if ((cur_progress % 16) == 0)
gimp_progress_update ((double) cur_progress / (double) max_progress);
}
if (ypos >= height)
***************
*** 1005,1019 ****
gimp_drawable_flush (drawable);
gimp_drawable_detach (drawable);
- /* if (alpha_frame)
- gimp_layer_add_alpha (layer_ID);
-
- if (Gif89.transparent != -1)
- {
- mask_ID = gimp_layer_create_mask (layer_ID, 0);
- gimp_image_add_layer_mask (image_ID, layer_ID, mask_ID);
- }*/
-
return image_ID;
}
--- 1109,1114 ----
***************
*** 1077,1083 ****
static void GIFEncodeHeader (FILE *, int, int, int, int, int, int,
int *, int *, int *, ifunptr);
static void GIFEncodeGraphicControlExt (FILE *, int, int, int, int, int, int,
! int *, int *, int *, ifunptr);
static void GIFEncodeImageData (FILE *, int, int, int, int, int, int,
int *, int *, int *, ifunptr, gint, gint);
static void GIFEncodeClose (FILE *, int, int, int, int, int, int,
--- 1172,1179 ----
static void GIFEncodeHeader (FILE *, int, int, int, int, int, int,
int *, int *, int *, ifunptr);
static void GIFEncodeGraphicControlExt (FILE *, int, int, int, int, int, int,
! int, int, int, int *, int *, int *,
! ifunptr);
static void GIFEncodeImageData (FILE *, int, int, int, int, int, int,
int *, int *, int *, ifunptr, gint, gint);
static void GIFEncodeClose (FILE *, int, int, int, int, int, int,
***************
*** 1105,1124 ****
static int find_unused_ia_colour (guchar *pixels,
int numpixels)
{
! guint32 i;
gboolean ix_used[256];
fprintf(stderr,"GIF: Image has >=256 colors - attempting to reduce...\n");
for (i=0;i<256;i++)
! ix_used[i] = FALSE;
for (i=0;i<numpixels;i++)
! if (pixels[i*2+1]) ix_used[pixels[i*2]] = TRUE;
for (i=0;i<256;i++)
! if (ix_used[i] == FALSE)
{
fprintf(stderr,"GIF: Found unused colour index %d.\n",(int)i);
return i;
--- 1201,1220 ----
static int find_unused_ia_colour (guchar *pixels,
int numpixels)
{
! int i;
gboolean ix_used[256];
fprintf(stderr,"GIF: Image has >=256 colors - attempting to reduce...\n");
for (i=0;i<256;i++)
! ix_used[i] = (gboolean)FALSE;
for (i=0;i<numpixels;i++)
! if (pixels[i*2+1]) ix_used[pixels[i*2]] = (gboolean)TRUE;
for (i=0;i<256;i++)
! if (ix_used[i] == (gboolean)FALSE)
{
fprintf(stderr,"GIF: Found unused colour index %d.\n",(int)i);
return i;
***************
*** 1135,1141 ****
int *colors,
int numpixels)
{
! int i;
if ((*colors) < 256)
*transparent = *colors;
--- 1231,1237 ----
int *colors,
int numpixels)
{
! guint32 i;
if ((*colors) < 256)
*transparent = *colors;
***************
*** 1152,1160 ****
{
for (i=0; i<numpixels; i++)
{
! if (pixels[i*2+1] == 0)
{
! pixels[i] = *((guchar *)transparent);
}
else
{
--- 1248,1256 ----
{
for (i=0; i<numpixels; i++)
{
! if (!(pixels[i*2+1] & 128))
{
! pixels[i] = (guchar)(*transparent);
}
else
{
***************
*** 1171,1176 ****
--- 1267,1329 ----
}
+ int
+ parse_ms_tag (char *str)
+ {
+ gint sum = 0;
+ gint offset = 0;
+ gint length;
+
+ length = strlen(str);
+
+ while ((offset<length) && (str[offset]!='('))
+ offset++;
+
+ if (offset>=length)
+ return(-1);
+
+ if (!isdigit(str[++offset]))
+ return(-2);
+
+ do
+ {
+ sum *= 10;
+ sum += str[offset] - '0';
+ offset++;
+ }
+ while ((offset<length) && (isdigit(str[offset])));
+
+ if (length-offset <= 2)
+ return(-3);
+
+ if ((toupper(str[offset]) != 'M') || (toupper(str[offset+1]) != 'S'))
+ return(-4);
+
+ return (sum);
+ }
+
+
+ int
+ parse_disposal_tag (char *str)
+ {
+ gint offset = 0;
+ gint length;
+
+ length = strlen(str);
+
+ while ((offset+9)<=length)
+ {
+ if (strncmp(&str[offset],"(combine)",9)==0)
+ return(0x01);
+ if (strncmp(&str[offset],"(replace)",9)==0)
+ return(0x02);
+ offset++;
+ }
+
+ return (gsvals.default_dispose);
+ }
+
+
gint
save_image (char *filename,
gint32 image_ID,
***************
*** 1195,1200 ****
--- 1348,1356 ----
gint32 *layers;
int nlayers;
+ int Delay89;
+ int Disposal;
+ char *layer_name;
drawable_type = gimp_drawable_type (drawable_ID);
***************
*** 1218,1226 ****
Blue[i] = 255;
}
break;
default:
! fprintf (stderr, "GIF: GIMP let through an inappropriate image - sorry, can't save this as a GIF.\n");
return FALSE;
break;
}
--- 1374,1392 ----
Blue[i] = 255;
}
break;
+ case GRAYA_IMAGE:
+ case GRAY_IMAGE:
+ colors = 256;
+ for ( i = 0; i < 256; i++)
+ {
+ Red[i] = Green[i] = Blue[i] = i;
+ }
+ break;
default:
! /* FIXME: should be a popup (or, of course, ideally GIMP shouldn't
! let RGB images through in the first place :) ) */
! fprintf (stderr, "GIF: Sorry, can't save RGB images as GIFs - convert to INDEXED\nor GRAY first.\n");
return FALSE;
break;
}
***************
*** 1244,1250 ****
! /* get the extents of the image - WRITE ME */
--- 1410,1416 ----
! /* FIXME: get the extents of the image - WRITE ME */
***************
*** 1265,1271 ****
/* If the image has multiple layers it'll be made into an
animated GIF, so write out the infinite-looping extension */
! if (nlayers > 1)
GIFEncodeLoopExt (outfile, cols, rows, gsvals.interlace, 0, transparent,
BitsPerPixel, Red, Green, Blue, GetPixel, 0);
--- 1431,1437 ----
/* If the image has multiple layers it'll be made into an
animated GIF, so write out the infinite-looping extension */
! if ((nlayers > 1) && (gsvals.loop))
GIFEncodeLoopExt (outfile, cols, rows, gsvals.interlace, 0, transparent,
BitsPerPixel, Red, Green, Blue, GetPixel, 0);
***************
*** 1292,1304 ****
pixels = (guchar *) g_malloc (drawable->width *
drawable->height *
! (drawable_type == INDEXEDA_IMAGE ? 2 : 1) );
gimp_pixel_rgn_get_rect (&pixel_rgn, pixels, 0, 0, drawable->width, drawable->height);
/* sort out whether we need to do transparency jiggery-pokery */
! if (drawable_type == INDEXEDA_IMAGE)
{
/* If there appear to be no entries left in the colourmap in
which to put the transparent index, try to find an entry which
--- 1458,1471 ----
pixels = (guchar *) g_malloc (drawable->width *
drawable->height *
! (((drawable_type == INDEXEDA_IMAGE)||
! (drawable_type == GRAYA_IMAGE)) ? 2:1) );
gimp_pixel_rgn_get_rect (&pixel_rgn, pixels, 0, 0, drawable->width, drawable->height);
/* sort out whether we need to do transparency jiggery-pokery */
! if ((drawable_type == INDEXEDA_IMAGE)||(drawable_type == GRAYA_IMAGE))
{
/* If there appear to be no entries left in the colourmap in
which to put the transparent index, try to find an entry which
***************
*** 1320,1327 ****
BitsPerPixel = colorstobpp (colors);
/* BitsPerPixel = 8;*/
! GIFEncodeGraphicControlExt (outfile, cols, rows, gsvals.interlace, 0,
! transparent,
BitsPerPixel, Red, Green, Blue, GetPixel);
GIFEncodeImageData (outfile, cols, rows, gsvals.interlace, 0,
--- 1487,1506 ----
BitsPerPixel = colorstobpp (colors);
/* BitsPerPixel = 8;*/
! layer_name = gimp_layer_get_name(layers[i]);
!
! Disposal = parse_disposal_tag(layer_name);
! Delay89 = parse_ms_tag(layer_name);
!
! g_free(layer_name);
!
! if (Delay89 < 0)
! Delay89 = gsvals.default_delay/10;
! else
! Delay89 /= 10;
!
! GIFEncodeGraphicControlExt (outfile, Disposal, Delay89, nlayers, cols,
! rows, gsvals.interlace, 0, transparent,
BitsPerPixel, Red, Green, Blue, GetPixel);
GIFEncodeImageData (outfile, cols, rows, gsvals.interlace, 0,
***************
*** 1346,1360 ****
}
static gint
! save_dialog ()
{
GtkWidget *dlg;
GtkWidget *button;
GtkWidget *toggle;
GtkWidget *frame;
GtkWidget *vbox;
gchar **argv;
gint argc;
argc = 1;
argv = g_new (gchar *, 1);
--- 1525,1551 ----
}
static gint
! save_dialog ( gint32 image_ID )
{
GtkWidget *dlg;
GtkWidget *button;
GtkWidget *toggle;
+ GtkWidget *label;
+ GtkWidget *entry;
GtkWidget *frame;
GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *innerframe;
+ GtkWidget *innervbox;
+ GSList *group = NULL;
gchar **argv;
gint argc;
+ gchar buffer[10];
+ int nlayers;
+
+
+ gimp_image_get_layers (image_ID, &nlayers);
+
argc = 1;
argv = g_new (gchar *, 1);
***************
*** 1387,1394 ****
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
! /* parameter settings */
! frame = gtk_frame_new ("Save Options");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
--- 1578,1586 ----
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->action_area), button, TRUE, TRUE, 0);
gtk_widget_show (button);
!
! /* regular gif parameter settings */
! frame = gtk_frame_new ("GIF Options");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
***************
*** 1406,1411 ****
--- 1598,1699 ----
gtk_widget_show (vbox);
gtk_widget_show (frame);
+
+
+ /* additional animated gif parameter settings */
+ frame = gtk_frame_new ("Animated GIF Options");
+ gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
+ gtk_container_border_width (GTK_CONTAINER (frame), 10);
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
+ vbox = gtk_vbox_new (FALSE, 5);
+ gtk_container_border_width (GTK_CONTAINER (vbox), 5);
+ gtk_container_add (GTK_CONTAINER (frame), vbox);
+
+ toggle = gtk_check_button_new_with_label ("Loop");
+ gtk_box_pack_start (GTK_BOX (vbox), toggle, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+ (GtkSignalFunc) save_toggle_update,
+ &gsvals.loop);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), gsvals.loop);
+ gtk_widget_show (toggle);
+
+
+ /* default_delay entry field */
+ hbox = gtk_hbox_new (FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, FALSE, 0);
+
+ label = gtk_label_new ("Default delay between frames where unspecified: ");
+ gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
+ gtk_widget_show (label);
+
+ entry = gtk_entry_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
+ gtk_widget_set_usize (entry, 80, 0);
+ sprintf (buffer, "%d", gsvals.default_delay);
+ gtk_entry_set_text (GTK_ENTRY (entry), buffer);
+ gtk_signal_connect (GTK_OBJECT (entry), "changed",
+ (GtkSignalFunc) save_entry_callback,
+ NULL);
+ gtk_widget_show (entry);
+
+ label = gtk_label_new (" milliseconds");
+ gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
+ gtk_widget_show (label);
+
+ gtk_widget_show (hbox);
+
+
+ /* Disposal selector */
+ innerframe = gtk_frame_new ("Default disposal where unspecified");
+ gtk_frame_set_shadow_type (GTK_FRAME (innerframe), GTK_SHADOW_IN);
+ gtk_container_border_width (GTK_CONTAINER (innerframe), 10);
+ gtk_box_pack_start (GTK_BOX (vbox), innerframe, TRUE, TRUE, 0);
+ innervbox = gtk_vbox_new (FALSE, 5);
+ gtk_container_border_width (GTK_CONTAINER (innervbox), 5);
+ gtk_container_add (GTK_CONTAINER (innerframe), innervbox);
+
+ toggle = gtk_radio_button_new_with_label (group,"Don't care");
+ group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
+ gtk_box_pack_start (GTK_BOX (innervbox), toggle, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+ (GtkSignalFunc) save_toggle_update,
+ &radio_pressed[0]);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), radio_pressed[0]);
+ gtk_widget_show (toggle);
+
+ toggle = gtk_radio_button_new_with_label (group,"One frame per layer (replace)");
+ group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
+ gtk_box_pack_start (GTK_BOX (innervbox), toggle, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+ (GtkSignalFunc) save_toggle_update,
+ &radio_pressed[2]);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), radio_pressed[2]);
+ gtk_widget_show (toggle);
+
+ toggle = gtk_radio_button_new_with_label (group,"Make frame from cumulative layers (combine)");
+ group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
+ gtk_box_pack_start (GTK_BOX (innervbox), toggle, TRUE, TRUE, 0);
+ gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+ (GtkSignalFunc) save_toggle_update,
+ &radio_pressed[1]);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), radio_pressed[1]);
+ gtk_widget_show (toggle);
+
+ gtk_widget_show (innervbox);
+ gtk_widget_show (innerframe);
+
+
+
+ gtk_widget_show (vbox);
+
+ /* If the image has only one layer it can't be animated, so
+ desensitize the animation options. */
+ if (nlayers == 1) gtk_widget_set_sensitive (frame, FALSE);
+
+ gtk_widget_show (frame);
+
+
+
gtk_widget_show (dlg);
gtk_main ();
***************
*** 1490,1496 ****
if (curx == Width)
{
cur_progress++;
! if ((cur_progress % 10) == 0)
gimp_progress_update ((double) cur_progress / (double) max_progress);
curx = 0;
--- 1778,1784 ----
if (curx == Width)
{
cur_progress++;
! if ((cur_progress % 16) == 0)
gimp_progress_update ((double) cur_progress / (double) max_progress);
curx = 0;
***************
*** 1668,1673 ****
--- 1956,1964 ----
static void
GIFEncodeGraphicControlExt (FILE *fp,
+ int Disposal,
+ int Delay89,
+ int NumFramesInImage,
int GWidth,
int GHeight,
int GInterlace,
***************
*** 1721,1734 ****
/*
* Write out extension for transparent colour index, if necessary.
*/
! if (Transparent >= 0)
{
fputc ('!', fp);
fputc (0xf9, fp);
fputc (4, fp);
! fputc (0x01 | 0x08, fp); /* DISPOSAL TYPE HARDWIRED FOR NOW */
! fputc (10, fp);
! fputc (0, fp); /* FRAME RATE HARDWIRED TO 10fps FOR NOW */
fputc (Transparent, fp);
fputc (0, fp);
}
--- 2012,2041 ----
/*
* Write out extension for transparent colour index, if necessary.
*/
! if ( (Transparent >= 0) || (NumFramesInImage > 1) )
{
+ /* Extension Introducer - fixed. */
fputc ('!', fp);
+ /* Graphic Control Label - fixed. */
fputc (0xf9, fp);
+ /* Block Size - fixed. */
fputc (4, fp);
!
! /* Packed Fields - XXXdddut (d=disposal, u=userInput, t=transFlag) */
! /* s8421 */
! fputc ( ((Transparent >= 0) ? 0x01 : 0x00) /* TRANSPARENCY */
!
! /* DISPOSAL */
! | ((NumFramesInImage > 1) ? (Disposal << 2) : 0x00 ),
! /* 0x03 or 0x01 build frames cumulatively */
! /* 0x02 clears frame before drawing */
! /* 0x00 'don't care' */
!
! fp);
!
! fputc (Delay89 & 255, fp);
! fputc ((Delay89>>8) & 255, fp);
!
fputc (Transparent, fp);
fputc (0, fp);
}
***************
*** 2115,2143 ****
free_ent = ClearCode + 2;
!
! /*
! * I had to insert this or else the second image through this
! * routine would be garbled. I think that this is because otherwise
! * it would cheerfully carry on compressing this image with the code
! * tables from the previous image (from the GIF specs this looks like
! * quite valid behaviour, but decoders don't agree); in that case this
! * code should ideally be going at the end of the compression routine,
! * but _that_ doesn't work. Ho hum. (--Adam)
! */
! /* cl_block();*/
! /*
! * This is the culprit - but I really don't understand why.
! * What I *do* know is that there are far too many global variables
! * in this code! :^)
! *
! * Update: I found the problem (I hope) - more globals were lurking
! * around with values from the old run (cur_bits, cur_accum). Sigh.
! *
! * So the above line is commented out. If you have further problems
! * with corrupt animated GIFs being saved, please try uncommenting
! * the above line any let me know if it helps. (--Adam)
! */
n_bits = g_init_bits;
maxcode = MAXCODE (n_bits);
--- 2422,2428 ----
free_ent = ClearCode + 2;
! /* Had some problems here... should be okay now. --Adam */
n_bits = g_init_bits;
maxcode = MAXCODE (n_bits);
***************
*** 2447,2452 ****
--- 2732,2750 ----
*toggle_val = TRUE;
else
*toggle_val = FALSE;
+ }
+
+ static void
+ save_entry_callback (GtkWidget *widget,
+ gpointer data)
+ {
+ gsvals.default_delay = atoi (gtk_entry_get_text (GTK_ENTRY (widget)));
+
+ if (gsvals.default_delay < 0)
+ gsvals.default_delay = 0;
+
+ if (gsvals.default_delay > 65000)
+ gsvals.default_delay = 65000;
}
/* The End */
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Tue Jun 10 10:30:23 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (scott@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id KAA07481 for scott; Tue, 10 Jun 1997 10:30:16 -0500
X-Authentication-Warning: poverty.bloomington.in.us: scott set sender to gilroy!scam.xcf.berkeley.edu!gimp-developer-owner using -f
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa21078;
10 Jun 97 7:45 PDT
Received: (qmail 28982 invoked by uid 27258); 9 Jun 1997 14:14:42 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 28979 invoked by uid 27258); 9 Jun 1997 14:14:40 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 28971 invoked from network); 9 Jun 1997 14:14:37 -0000
Received: from sierra.sci-park.uunet.pipex.com (194.130.1.24)
by scam.xcf.berkeley.edu with SMTP; 9 Jun 1997 14:14:37 -0000
Received: (from adam@localhost) by sierra.sci-park.uunet.pipex.com (8.6.11/8.6.9) id OAA02080; Mon, 9 Jun 1997 14:55:30 GMT
Date: Mon, 9 Jun 1997 14:55:30 GMT
Message-Id: <199706091455.OAA02080@sierra.sci-park.uunet.pipex.com>
From: "Adam D. Moss" <adam@uunet.pipex.com>
To: gimp-developer@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] convert.c minor stuff
X-Face: %'EXt;w3g|JblL?5#_=D+{Srq!]L{+`>D_?Sm(g`06*`,'sfcv(y+2|Dp7u27UW&dZ@K0qf
8Y-cDh'b~85i4^r[,%[&d+Rg5k7kj#(7DysZz>J$!$C}=8VI(1Y&t*sLr59ag,a$B5-MUtMrPG\*\=
&1_gx>0owf/#C[WrC5P$~*br|};PF_?7Ge*5fC3o-6k!>h~}Vw)rvxyAt3z+5*h*4LvXm=vcp^*)G%
S}6&.lN]'xDAXxf%<B!z(\Y}'8Wd2{p,[4`j9oFFQYYP
Hiya.
Anyone have good/bad/ugly experiences with 0.99.10 when converting
from GRAYSCALE to INDEXED?
The reason I ask is that my last convert.c patch to 0.99.9, which is
now in 0.99.10, was accidentally left with code to present the
quantization options dialog when converting from GRAYSCALE->INDEXED,
whereas it was only designed for use with RGB->INDEXED.
The gods of serendipity smiled down, however, and the bizarre thing is
that those options do seem to do what you'd expect them to do with
GRAYSCALE images on 0.99.10.
But I don't trust this...
So here's a patch against 0.99.10 which at least removes the
'WWW-optimized palette' option from the GRAYSCALE->INDEXED dialog,
since that has a weird sort of off-by-one artifact on tile
boundaries. This is probably a symptom of the larger problem, which
is that it is very likely not at all sane to do all the same
quantization crap with GRAYSCALE images as with RGB images.
I expect that the next patch will remove the whole GRAYSCALE->INDEXED
dialog and revert to the behaviour I had intended.
This patch also makes the pop-up alpha warning only pop up the first
time.
--Adam
*** app/convert.c.0.99.10 Sun Jun 8 18:32:51 1997
--- app/convert.c Sun Jun 8 19:01:42 1997
***************
*** 220,225 ****
--- 220,226 ----
GtkWidget *frame;
GtkWidget *toggle;
GSList *group = NULL;
+ static gboolean shown_message_already = False;
gimage = (GImage *) gimage_ptr;
dialog = (IndexedDialog *) g_malloc (sizeof (IndexedDialog));
***************
*** 240,247 ****
)
{
dialog->num_cols = 255;
! message_box ("Note: You are attempting to convert an RGB image\nwith alpha/layers. It is recommended that you quantize\nto no more than 255 colors if you wish to make\na transparent or animated GIF from it.",
! NULL, NULL);
}
dialog->makepal_flag = TRUE;
dialog->webpal_flag = FALSE;
--- 241,252 ----
)
{
dialog->num_cols = 255;
! if (!shown_message_already)
! {
! message_box ("Note: You are attempting to convert an image\nwith alpha/layers. It is recommended that you quantize\nto no more than 255 colors if you wish to make\na transparent or animated GIF from it.\n\nYou won't get this message again\nuntil the next time you run GIMP.\nHave a nice day!",
! NULL, NULL);
! shown_message_already = True;
! }
}
dialog->makepal_flag = TRUE;
dialog->webpal_flag = FALSE;
***************
*** 262,268 ****
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show(vbox);
! /* 'general palette' */
hbox = gtk_hbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
--- 267,273 ----
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show(vbox);
! /* 'generate palette' */
hbox = gtk_hbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
***************
*** 300,318 ****
gtk_widget_show (text);
gtk_widget_show (hbox);
! /* 'web palette' */
! hbox = gtk_hbox_new (FALSE, 1);
! gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
! toggle =
! gtk_radio_button_new_with_label (group, "Use WWW-optimised palette");
! group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
! gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
! gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
! (GtkSignalFunc) indexed_radio_update,
! &(dialog->webpal_flag));
! gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), dialog->webpal_flag);
! gtk_widget_show (toggle);
! gtk_widget_show (hbox);
/* 'mono palette' */
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
--- 305,327 ----
gtk_widget_show (text);
gtk_widget_show (hbox);
! if (gimage->base_type == RGB)
! {
! /* 'web palette' */
! hbox = gtk_hbox_new (FALSE, 1);
! gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
! toggle =
! gtk_radio_button_new_with_label (group, "Use WWW-optimised palette");
! group = gtk_radio_button_group (GTK_RADIO_BUTTON (toggle));
! gtk_box_pack_start (GTK_BOX (hbox), toggle, TRUE, TRUE, 0);
! gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
! (GtkSignalFunc) indexed_radio_update,
! &(dialog->webpal_flag));
! gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), dialog->webpal_flag);
! gtk_widget_show (toggle);
! gtk_widget_show (hbox);
! }
!
/* 'mono palette' */
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
***************
*** 326,331 ****
--- 335,341 ----
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (toggle), dialog->monopal_flag);
gtk_widget_show (toggle);
gtk_widget_show (hbox);
+
frame = gtk_frame_new ("Dither Options");
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 2);
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Sun Jun 8 20:00:20 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id UAA26104 for scott; Sun, 8 Jun 1997 20:00:20 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa10622;
8 Jun 97 17:47 PDT
Received: (qmail 23630 invoked by uid 27258); 8 Jun 1997 19:34:29 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 23626 invoked by uid 27258); 8 Jun 1997 19:34:28 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 23620 invoked from network); 8 Jun 1997 19:34:26 -0000
Received: from emout11.mx.aol.com (HELO emout11.mail.aol.com) (198.81.11.26)
by scam.xcf.berkeley.edu with SMTP; 8 Jun 1997 19:34:26 -0000
Received: (from root@localhost)
by emout11.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id PAA14407 for gimp-developer@scam.xcf.berkeley.edu;
Sun, 8 Jun 1997 15:42:22 -0400 (EDT)
Date: Sun, 8 Jun 1997 15:42:22 -0400 (EDT)
From: Pkirchg@aol.com
Message-ID: <970608154222_406597090@emout11.mail.aol.com>
To: gimp-developer@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] Use files size for automatic filetype detection
MIME-Version: 1.0
Content-type: multipart/mixed;
boundary="PART.BOUNDARY.0.21961.emout11.mail.aol.com.865798942"
--PART.BOUNDARY.0.21961.emout11.mail.aol.com.865798942
Content-ID: <0_21961_865798942@emout11.mail.aol.com.4151>
Content-type: text/plain
High,
now we have the automatic filetype detection in GIMP 0.99.10.
Developers of file-plug-ins should notice the change of the plug-ins
in the distribution. New plug-ins should use the
gimp_register_magic_load_handler()
instead of the
gimp_register_load_handler()
The new function accepts an additional argument for specifying
magic information about the files that the plug-in can load. Please
see the attached documentation for specifying the magics.
Albert Cahalan wanted to have a magic information that gives the files
size to be used with the HRZ plug-in. The enclosed patches to fileops.c
and hrz.c will do that. The size information will only be used, if no
other plug-in is found for the file. I.E., a TIFF-file with the size
of a HRZ-file is opened as a TIFF-file.
I think this should make no problems.
Bye
Peter K.
Here is the diff for hrz.c:
--- plug-ins/hrz.c.orig Sun Jun 8 10:12:25 1997
+++ plug-ins/hrz.c Sun Jun 8 10:13:22 1997
@@ -154,7 +154,7 @@
nsave_args, 0,
save_args, NULL);
- gimp_register_load_handler ("file_hrz_load", "hrz", "");
+ gimp_register_magic_load_handler ("file_hrz_load", "hrz", "", "0,size,184320");
gimp_register_save_handler ("file_hrz_save", "hrz", "");
}
Here is the diff for fileops.c:
--- app/fileops.c.orig Sat Jun 7 23:27:11 1997
+++ app/fileops.c Sun Jun 8 10:13:41 1997
@@ -1032,14 +1032,15 @@
file_proc_find (GSList *procs,
char *filename)
{
- PlugInProcDef *file_proc;
+ PlugInProcDef *file_proc, *size_matched_proc;
GSList *all_procs = procs;
GSList *extensions;
GSList *prefixes;
char *extension;
char *p1, *p2;
FILE *ifp = NULL;
- int head_size = -2;
+ int head_size = -2, size_match_count = 0;
+ int match_val;
unsigned char head[256];
extension = strrchr (filename, '.');
@@ -1060,15 +1061,25 @@
if ((ifp = fopen (filename, "rb")) != NULL)
head_size = fread ((char *)head, 1, sizeof (head), ifp);
}
- if ((head_size >= 4) && file_check_magic_list (file_proc->magics_list,
- head_size, head, ifp))
+ if (head_size >= 4)
{
- fclose (ifp);
- return (file_proc);
+ match_val = file_check_magic_list (file_proc->magics_list,
+ head_size, head, ifp);
+ if (match_val == 2) /* size match ? */
+ { /* Use it only if no other magic matches */
+ size_match_count++;
+ size_matched_proc = file_proc;
+ }
+ else if (match_val)
+ {
+ fclose (ifp);
+ return (file_proc);
+ }
}
}
}
if (ifp) fclose (ifp);
+ if (size_match_count == 1) return (size_matched_proc);
procs = all_procs;
while (procs)
@@ -1164,7 +1175,7 @@
unsigned char *file_head,
FILE *ifp)
-{
+{ /* Return values are 0: no match, 1: magic match, 2: size match */
long offs;
unsigned long num_testval, num_operatorval;
unsigned long fileval;
@@ -1195,6 +1206,10 @@
numbytes = 4;
num_operator_ptr = type+4;
}
+ else if (strncmp (type, "size", 4) == 0)
+ {
+ numbytes = 5;
+ }
else if (strcmp (type, "string") == 0)
{
numbytes = 0;
@@ -1234,7 +1249,13 @@
sscanf (value+1, "%lo", &num_testval);
fileval = 0;
- if (offs + numbytes <= headsize) /* We have it in memory ? */
+ if (numbytes == 5) /* Check for file size ? */
+ {struct stat buf;
+
+ if (fstat (fileno (ifp), &buf) < 0) return (0);
+ fileval = buf.st_size;
+ }
+ else if (offs + numbytes <= headsize) /* We have it in memory ? */
{
for (k = 0; k < numbytes; k++)
fileval = (fileval << 8) | (long)file_head[offs+k];
@@ -1255,6 +1276,8 @@
found = (fileval > num_testval);
else
found = (fileval == num_testval);
+
+ if (found && (numbytes == 5)) found = 2;
}
else if (numbytes == 0) /* String test */
{
@@ -1285,10 +1308,11 @@
int headsize,
unsigned char *head,
FILE *ifp)
-{
+
+{ /* Return values are 0: no match, 1: magic match, 2: size match */
char *offset, *type, *value;
int and = 0;
- int found = 0;
+ int found = 0, match_val;
while (magics_list)
{
@@ -1299,14 +1323,15 @@
if ((value = (char *)magics_list->data) == NULL) break;
magics_list = magics_list->next;
+ match_val = file_check_single_magic (offset, type, value,
+ headsize, head, ifp);
if (and)
- found = found && file_check_single_magic (offset, type, value,
- headsize, head, ifp);
+ found = found && match_val;
else
- found = file_check_single_magic (offset, type, value,
- headsize, head, ifp);
+ found = match_val;
+
and = (strchr (offset, '&') != NULL);
- if ((!and) && found) return (1);
+ if ((!and) && found) return (match_val);
}
return (0);
}
--PART.BOUNDARY.0.21961.emout11.mail.aol.com.865798942
Content-ID: <0_21961_865798942@emout11.mail.aol.com.4152>
Content-type: text/plain;
name="MAGIC.DOC"
Content-Transfer-Encoding: quoted-printable
The new gimp_register_magic_load_handler accepts specifications for
magic information about the type of files, the plug-in can read.
The information is kept in a comma separated list. Each magic information=
consists of an offset, the type of checking and the value to check:
=0D
<offset>,<type>,<value>[,<offset>,<type>,<value>]
=0D
<offset> =3D <offset_value>[&]
<type> =3D byte[&<and_value>] | short[&<and_value>] | long[&<and_valu=
e>]
| size | string
<value> =3D [ < | > | =3D ]<test_value>
=0D
<offset_value> =3D <decimal integer>
<and_value>,<test_value> =3D <decimal integer> | <octal integer>
| <hexadecimal integer>
=0D
<offset> is the decimal offset into the file where to perform the check
<type> specifies the type of checking: byte =3D 1 byte, short =3D 2 bytes=
,
long =3D 4 bytes, size =3D file size, string =3D variable number o=
f bytes.
Numerical values read from the file are interpreted
with most significant byte first.
<value> is the numerical or string value to check against.
The string value can be specified with C-notation ('\\n', '\\033')=
,
but the backslash must remain in the string
("0,string,II*\0,0,string,MM\0*" would result in "0,string,II*").
Blanks within the string should be used with "\\040")
=0D
If &<and_value> is specified for numerical test, the value read from the
file is first AND-ed with <and_value>, before the test is performed.
if '<', '>' or '=3D' is specified infront of <test_value> (only numerical=
tests for byte, short, long), the test <filevalue> OP <test_value>
is performed with the specified OPeration. '=3D' is the default operation=
=2E
If <offset_value> is specified (without trailing '&'), the magic informat=
ion
applies if the test is TRUE.
If <offset_value>& is specified, the magic information applies if this te=
st
and the test of the next set of magic information is TRUE.
A file plug-in that matches the "magic" information about a files size
is only used, if no other plug-in is found to match.
=0D
Example for TIFF:
=0D
"0,string,II*\\0,0,string,MM\\0*"
=0D
The magic information applies if either the first or second is found
to be true.
=0D
Example for PCX:
=0D
"0&,byte,10,2&,byte,1,3&,byte,>0,3,byte,<9"
=0D
The first byte must be 10 and the third byte must be 1 and the fourth b=
yte
must be larger than 0 and less than 9.
=0D
Example for HRZ:
"0,size,184320":
=0D
Offset is ignored, only the size of the file is checked. If a TIFF-
file has the same size, it will be opened as a TIFF file, because
the TIFF-plugin will also match the file and will not use the size-
information.
--PART.BOUNDARY.0.21961.emout11.mail.aol.com.865798942--
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 30 21:30:24 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id VAA17603 for scott; Mon, 30 Jun 1997 21:30:24 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa13660;
30 Jun 97 19:21 PDT
Received: (qmail 15455 invoked by uid 27258); 30 Jun 1997 20:45:42 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 15452 invoked by uid 27258); 30 Jun 1997 20:45:41 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 15446 invoked by uid 0); 30 Jun 1997 20:45:40 -0000
Received: from emout03.mx.aol.com (HELO emout03.mail.aol.com) (198.81.11.94)
by scam.xcf.berkeley.edu with SMTP; 30 Jun 1997 20:45:40 -0000
Received: (from root@localhost)
by emout03.mail.aol.com (8.7.6/8.7.3/AOL-2.0.0)
id QAA00662 for gimp-developer@scam.xcf.berkeley.edu;
Mon, 30 Jun 1997 16:53:41 -0400 (EDT)
Date: Mon, 30 Jun 1997 16:53:41 -0400 (EDT)
From: Pkirchg@aol.com
Message-ID: <970630165334_-1025362134@emout03.mail.aol.com>
To: gimp-developer@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] gimp_image_menu_new()
Hello,
the gimp_image_menu_new() does not set the active_image
correctly, when a constraint-function is used. The following
patch fixes the problem:
Peter K.
--- libgimp/gimpmenu.c.orig Tue Jul 8 21:59:00 1997
+++ libgimp/gimpmenu.c Tue Jul 8 22:01:02 1997
@@ -47,7 +47,7 @@
g_free (label);
if (images[i] == active_image)
- gtk_menu_set_active (GTK_MENU (menu), i);
+ gtk_menu_set_active (GTK_MENU (menu), k);
k += 1;
}
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Fri Jun 27 19:30:35 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id TAA09465 for scott; Fri, 27 Jun 1997 19:30:33 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa24536;
27 Jun 97 17:08 PDT
Received: (qmail 6347 invoked by uid 27258); 27 Jun 1997 14:41:52 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 6320 invoked by uid 27258); 27 Jun 1997 14:41:48 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 6286 invoked by uid 0); 27 Jun 1997 14:41:44 -0000
Received: from hermes.hrz.uni-bielefeld.de (129.70.4.55)
by scam.xcf.berkeley.edu with SMTP; 27 Jun 1997 14:41:44 -0000
Received: from titan.cfl.de (pppasc29.hrz.uni-bielefeld.de) by hermes.hrz.uni-bielefeld.de with ESMTP
(1.37.109.17/16.2) id AA018933118; Fri, 27 Jun 1997 16:51:58 +0200
Received: (from dnehring@localhost)
by titan.cfl.de (8.8.5/8.8.5) id QAA12452;
Fri, 27 Jun 1997 16:49:58 +0200
From: Dirk Nehring <dnehring@hrz.Uni-Bielefeld.DE>
Message-Id: <199706271449.QAA12452@titan.cfl.de>
Subject: [gimp-devel] Patch for jpeg.c, gimp-0.99.10
To: spencer@xcf.berkeley.edu, petm@xcf.berkeley.edu,
gimp-developer@scam.xcf.berkeley.edu
Date: Fri, 27 Jun 1997 16:49:58 +0200 (MET DST)
Cc: dnehring@hermes.hrz.uni-bielefeld.de
X-Mailer: ELM [version 2.4ME+ PL31 (25)]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Hi Peter, hi Spencer,
I have written a small patch for the plugin 'jpeg' in order to use to
'optimize' feature from libjpeg.so. The table for the entropy encoder
(currently only Huffman encoder) will be optimized and the output file we be
smaller. Can this be included in gimp 1.0?
Regards,
Dirk Nehring
--
Hal 9000 - "Put down those Windows disks Dave.... Dave? DAVE!!"
Dirk Nehring, | Student of Natural Scientific Computer Science
dnehring@uni-bielefeld.de | Computing Center, University of Bielefeld, Germany
| <http://www.uni-bielefeld.de/~dnehring/>
-------------------8<------------------8<----------------8<------------
--- plug-ins/jpeg.c.orig Fri Jun 27 16:12:06 1997
+++ plug-ins/jpeg.c Fri Jun 27 16:33:28 1997
@@ -38,6 +38,7 @@
{
gdouble quality;
gdouble smoothing;
+ gint optimize;
} JpegSaveVals;
typedef struct
@@ -66,6 +67,8 @@
gpointer data);
static void save_scale_update (GtkAdjustment *adjustment,
double *scale_val);
+static void save_optimize_update (GtkWidget *widget,
+ gpointer data);
GPlugInInfo PLUG_IN_INFO =
@@ -79,7 +82,8 @@
static JpegSaveVals jsvals =
{
0.75, /* quality */
- 0.0 /* smoothing */
+ 0.0, /* smoothing */
+ 1 /* optimize */
};
static JpegSaveInterface jsint =
@@ -115,6 +119,7 @@
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" },
{ PARAM_FLOAT, "quality", "Quality of saved image (0 <= quality <= 1)" },
{ PARAM_FLOAT, "smoothing", "Smoothing factor for saved image (0 <= smoothing <= 1)" },
+ { PARAM_INT32, "optimize", "Optimization of entropy encoding parameters" },
};
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
@@ -196,12 +201,13 @@
case RUN_NONINTERACTIVE:
/* Make sure all the arguments are there! */
- if (nparams != 6)
+ if (nparams != 7)
status = STATUS_CALLING_ERROR;
if (status == STATUS_SUCCESS)
{
jsvals.quality = param[5].data.d_float;
jsvals.smoothing = param[6].data.d_float;
+ jsvals.optimize = param[7].data.d_int32;
}
if (status == STATUS_SUCCESS &&
(jsvals.quality < 0.0 || jsvals.quality > 1.0))
@@ -556,6 +562,7 @@
*/
jpeg_set_quality (&cinfo, (int) (jsvals.quality * 100), TRUE /* limit to baseline-JPEG values */);
cinfo.smoothing_factor = (int) (jsvals.smoothing * 100);
+ cinfo.optimize_coding = jsvals.optimize;
/* Step 4: Start compressor */
@@ -637,6 +644,7 @@
GtkWidget *scale;
GtkWidget *frame;
GtkWidget *table;
+ GtkWidget *toggle;
GtkObject *scale_data;
gchar **argv;
gint argc;
@@ -678,7 +686,7 @@
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_container_border_width (GTK_CONTAINER (frame), 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), frame, TRUE, TRUE, 0);
- table = gtk_table_new (2, 2, FALSE);
+ table = gtk_table_new (3, 2, FALSE);
gtk_container_border_width (GTK_CONTAINER (table), 10);
gtk_container_add (GTK_CONTAINER (frame), table);
@@ -714,6 +722,13 @@
gtk_widget_show (label);
gtk_widget_show (scale);
+ toggle = gtk_check_button_new_with_label("Optimize");
+ gtk_table_attach(GTK_TABLE(table), toggle, 0, 2, 2, 3, GTK_FILL, 0, 0, 0);
+ gtk_signal_connect(GTK_OBJECT(toggle), "toggled",
+ (GtkSignalFunc)save_optimize_update, NULL);
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(toggle), jsvals.optimize);
+ gtk_widget_show(toggle);
+
gtk_widget_show (frame);
gtk_widget_show (table);
gtk_widget_show (dlg);
@@ -747,4 +762,11 @@
double *scale_val)
{
*scale_val = adjustment->value;
+}
+
+static void
+save_optimize_update(GtkWidget *widget,
+ gpointer data)
+{
+ jsvals.optimize = GTK_TOGGLE_BUTTON(widget)->active;
}
--- gimp-0.99.10-dist/app/layers_dialog.c Tue Jun 3 18:08:47 1997
+++ app/layers_dialog.c Mon Jun 9 18:56:33 1997
@@ -1041,6 +1041,8 @@
{
layersD->image_width = (int) (layersD->ratio * gimage->width);
layersD->image_height = (int) (layersD->ratio * gimage->height);
+ if (layersD->image_width < 1) layersD->image_width = 1;
+ if (layersD->image_height < 1) layersD->image_height = 1;
}
else
{
@@ -2310,6 +2312,8 @@
/* determine width and height */
layer_widget->width = (int) (layersD->ratio * layer_widget->layer->width);
layer_widget->height = (int) (layersD->ratio * layer_widget->layer->height);
+ if (layer_widget->width < 1) layer_widget->width = 1;
+ if (layer_widget->height < 1) layer_widget->height = 1;
offx = (int) (layersD->ratio * layer_widget->layer->offset_x);
offy = (int) (layersD->ratio * layer_widget->layer->offset_y);
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Wed Jul 2 04:00:16 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id EAA20172 for scott; Wed, 2 Jul 1997 04:00:15 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa12828;
2 Jul 97 1:40 PDT
Received: (qmail 6547 invoked by uid 27258); 2 Jul 1997 05:45:33 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 6544 invoked by uid 27258); 2 Jul 1997 05:45:32 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 6538 invoked by uid 0); 2 Jul 1997 05:45:30 -0000
Received: from dal62.dhc.net (HELO wopr.sac) (root@207.55.174.62)
by scam.xcf.berkeley.edu with SMTP; 2 Jul 1997 05:45:30 -0000
Received: (from root@localhost) by wopr.sac (8.7.6/8.7.3) id AAA26101 for gimp-developer@scam.xcf.berkeley.edu; Wed, 2 Jul 1997 00:52:09 -0400
From: Seth Burgess (unpriviliged) <seth@wopr.sac>
Message-Id: <199707020452.AAA26101@wopr.sac>
Subject: [gimp-devel] [patch] Documentation bug
To: gimp-developer@scam.xcf.berkeley.edu
Date: Wed, 2 Jul 1997 00:52:09 -0400 (EDT)
X-Mailer: ELM [version 2.4ME+ PL28 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
It might not look like much, but this one caused me quite a headache.
-seth
--- gimp-0.99.10.orig/app/layer_cmds.c Thu May 29 20:16:06 1997
+++ app/layer_cmds.c Wed Jul 2 00:40:48 1997
@@ -115,7 +115,7 @@
},
{ PDB_INT32,
"type",
- "the layer type: { RGB (0), RGBA (1), GRAY (2), GRAYA (3), INDEXED (4), INDEXEDA (5) }"
+ "the layer type: { RGB_IMAGE (0), RGBA_IMAGE (1), GRAY_IMAGE (2), GRAYA_IMAGE (3), INDEXED_IMAGE (4), INDEXEDA_IMAGE (5) }"
},
{ PDB_STRING,
"name",
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Tue Jun 10 08:30:19 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id IAA02899 for scott; Tue, 10 Jun 1997 08:30:16 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa19695;
10 Jun 97 6:12 PDT
Received: (qmail 25192 invoked by uid 27258); 9 Jun 1997 12:55:40 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 25189 invoked by uid 27258); 9 Jun 1997 12:55:39 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 25181 invoked from network); 9 Jun 1997 12:55:37 -0000
Received: from sierra.sci-park.uunet.pipex.com (194.130.1.24)
by scam.xcf.berkeley.edu with SMTP; 9 Jun 1997 12:55:37 -0000
Received: (from adam@localhost) by sierra.sci-park.uunet.pipex.com (8.6.11/8.6.9) id MAA01471; Mon, 9 Jun 1997 12:09:29 GMT
Date: Mon, 9 Jun 1997 12:09:29 GMT
Message-Id: <199706091209.MAA01471@sierra.sci-park.uunet.pipex.com>
From: "Adam D. Moss" <adam@uunet.pipex.com>
To: gimp-developer@scam.XCF.Berkeley.EDU
Subject: Re: [gimp-devel] gif loads fail
In-Reply-To: <"bath.mail..870:07.06.97.20.38.08"@pipex.net>
References: <199706072032.PAA27231@poverty.bloomington.in.us>
<"bath.mail..870:07.06.97.20.38.08"@pipex.net>
X-Face: %'EXt;w3g|JblL?5#_=D+{Srq!]L{+`>D_?Sm(g`06*`,'sfcv(y+2|Dp7u27UW&dZ@K0qf
8Y-cDh'b~85i4^r[,%[&d+Rg5k7kj#(7DysZz>J$!$C}=8VI(1Y&t*sLr59ag,a$B5-MUtMrPG\*\=
&1_gx>0owf/#C[WrC5P$~*br|};PF_?7Ge*5fC3o-6k!>h~}Vw)rvxyAt3z+5*h*4LvXm=vcp^*)G%
S}6&.lN]'xDAXxf%<B!z(\Y}'8Wd2{p,[4`j9oFFQYYP
Aha.
Peter Mattis writes:
> A small fix to libgimp is needed to fix the
> warning. See the comments in the gif plug-in source for
> details.
Here's an explicit patch:
*** libgimp/gimplayer.c.0.99.10 Mon Jun 9 07:40:37 1997
--- libgimp/gimplayer.c Sun Jun 8 18:17:37 1997
***************
*** 179,185 ****
GParam *return_vals;
int nreturn_vals;
! return_vals = gimp_run_procedure ("gimp_layer_scale",
&nreturn_vals,
PARAM_LAYER, layer_ID,
PARAM_INT32, offset_x,
--- 179,185 ----
GParam *return_vals;
int nreturn_vals;
! return_vals = gimp_run_procedure ("gimp_layer_translate",
&nreturn_vals,
PARAM_LAYER, layer_ID,
PARAM_INT32, offset_x,
--- gimp-0.99.10-dist/ltconfig Fri Jun 6 17:43:28 1997
+++ ltconfig Sun Jun 8 02:21:33 1997
@@ -260,9 +260,9 @@
*-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Determine commands to create old-style static archives.
old_archive_cmds='$AR cru $oldlib$oldobjs'
--- gimp-0.99.10-dist/gtk+/ltconfig Fri Jun 6 17:43:28 1997
+++ gtk+/ltconfig Sun Jun 8 02:21:33 1997
@@ -260,9 +260,9 @@
*-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Determine commands to create old-style static archives.
old_archive_cmds='$AR cru $oldlib$oldobjs'
--- gimp-0.99.10-dist/gtk+/glib/ltconfig Fri Jun 6 17:43:28 1997
+++ gtk+/glib/ltconfig Sun Jun 8 02:21:33 1997
@@ -260,9 +260,9 @@
*-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Determine commands to create old-style static archives.
old_archive_cmds='$AR cru $oldlib$oldobjs'
From scam.xcf.berkeley.edu!xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 9 22:30:28 1997
Return-Path: scam.xcf.berkeley.edu!xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id WAA01912 for scott; Mon, 9 Jun 1997 22:30:25 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa16458;
9 Jun 97 20:25 PDT
Received: (qmail 12437 invoked by uid 27258); 9 Jun 1997 07:03:03 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 12434 invoked by uid 27258); 9 Jun 1997 07:03:02 -0000
Delivered-To: gimp-developer@XCF.Berkeley.EDU
Received: (qmail 12428 invoked from network); 9 Jun 1997 07:03:00 -0000
Received: from mail0.iij.ad.jp (202.232.2.113)
by scam.xcf.berkeley.edu with SMTP; 9 Jun 1997 07:03:00 -0000
Received: from uucp3.iij.ad.jp (uucp3.iij.ad.jp [202.232.2.203]) by mail0.iij.ad.jp (8.8.5+2.7Wbeta5/3.5Wpl4-MAIL) with SMTP id QAA01816 for <gimp-developer@XCF.Berkeley.EDU>; Mon, 9 Jun 1997 16:11:25 +0900 (JST)
Received: from hcore.UUCP (uucp@localhost) by uucp3.iij.ad.jp (8.6.12+2.4W/3.3W9-UUCP) with UUCP id QAA23682 for XCF.Berkeley.EDU!gimp-developer; Mon, 9 Jun 1997 16:11:24 +0900
Received: (from localhost) by lilia.hypercore.co.jp (smail 3.2) id m0wayWl-0007SfC; Mon, 9 Jun 1997 16:06:07 +0900 (JST)
To: gimp-developer@XCF.Berkeley.EDU
Subject: [gimp-devel] [patch 0.99.10] BadAccess error with colormap-cycling
X-Attribution: Kaz
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=US-ASCII
From: Kazuhiro Sasayama <kaz@hypercore.co.jp>
Date: 09 Jun 1997 16:06:01 +0900
Message-ID: <2mu3j8l0h1.fsf@lilia.hypercore.co.jp>
Lines: 25
X-Mailer: Gnus v5.3/Emacs 19.34
I found gimp 0.99.10 stops with a BadAccess error at startup
if colormap-cycling is enabled. This patch will fix it if
I'm right.
*** app/colormaps.c 1997-06-09 15:46:53+09 1.1
--- app/colormaps.c 1997-06-09 15:47:37+09
***************
*** 102,106 ****
for (i = 0; i < 8; i++)
{
! marching_ants_pixels[i] = reserved_pixels[i + reserved_entries];
if (i < 4)
store_color (&marching_ants_pixels[i], 0, 0, 0);
--- 102,106 ----
for (i = 0; i < 8; i++)
{
! marching_ants_pixels[i] = reserved_pixels[i + reserved_entries - 8];
if (i < 4)
store_color (&marching_ants_pixels[i], 0, 0, 0);
--
Kaz Sasayama <kaz@hypercore.co.jp>
Linux consultant and the designer of Hyperplay, working at
Hypercore Software Design, Ltd. <URL:http://www.spice.or.jp/%7Ehypercor/>.
PGP key fingerprint = 53 71 54 56 FB 3D 76 0B 92 5D 32 40 C5 34 38 00
Return-Path: cc00ms.unity.ncsu.edu!eos.ncsu.edu!aklikins@gilroy.rmp.com
Return-Path: cc00ms.unity.ncsu.edu!eos.ncsu.edu!aklikins@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id QAA03189 for scott; Sat, 14 Jun 1997 16:30:30 -0500
Received: from cc00ms.unity.ncsu.edu by gilroy.rmp.com id aa21400;
14 Jun 97 14:11 PDT
Received: from sloth (slip166-72-89-164.nc.us.ibm.net [166.72.89.164])
by cc00ms.unity.ncsu.edu (8.8.4/US19Dec96) with SMTP
id RAA11613 for <scott@poverty.bloomington.in.us>; Sat, 14 Jun 1997 17:11:21 -0400 (EDT)
Sender: aklikins@unity.ncsu.edu
Message-ID: <33A308D6.37BE76BF@eos.ncsu.edu>
Date: Sat, 14 Jun 1997 17:10:46 -0400
From: Adrian Likins <aklikins@eos.ncsu.edu>
X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.30 i586)
MIME-Version: 1.0
To: scott@poverty.bloomington.in.us
Subject: [patch] menus.c
Content-Type: multipart/mixed; boundary="------------4AE3CC25D6572AE7848F08B"
This is a multi-part message in MIME format.
--------------4AE3CC25D6572AE7848F08B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
This is a small patch to emnus.c to add the abilty to open gimp dialogs
from the file menu on the toolbar. T&his is particular convient when
using script-fu as you dont need to open an image to get to the gradient
editor or the like. Also added a call to open the layer/channels dialog
from the image->layers menu.
I incorporate a small patches of Quartics too that added a menu option
on the filters menu to open the dialog of the last used filter.
Nothing spectacular but useful. I original had made this patch for
.99.9, but I dont think I ever got around to posting it.
--
********************************************************************************
This is my sig. There are many like it, but this one is mine.
Adrian Likins
aklikins@eos.ncsu.edu
http://www4.ncsu.edu/eos/users/a/aklikins/pub/adrian.html
--------------4AE3CC25D6572AE7848F08B
Content-Type: text/plain; charset=us-ascii; name="menus.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="menus.diff"
--- app/menus.c.orig Sat Jun 14 16:21:39 1997
+++ app/menus.c Sat Jun 14 16:58:42 1997
@@ -51,7 +51,17 @@
{ "<Toolbox>/File/About...", NULL, about_dialog_cmd_callback, NULL },
{ "<Toolbox>/File/Preferences...", NULL, file_pref_cmd_callback, NULL },
{ "<Toolbox>/File/<separator>", NULL, NULL, NULL },
- { "<Toolbox>/File/Quit", "<control>Q", file_quit_cmd_callback, NULL },
+ { "<Toolbox>/File/Dialogs/Brushes...", "<control><shift>B", dialogs_brushes_cmd_callback, NULL },
+ { "<Toolbox>/File/Dialogs/Patterns...", "<control><shift>P", dialogs_patterns_cmd_callback, NULL },
+ { "<Toolbox>/File/Dialogs/Palette...", "<control>P", dialogs_palette_cmd_callback, NULL },
+ { "<Toolbox>/File/Dialogs/Gradient Editor...", "<control>G", dialogs_gradient_editor_cmd_callback, NULL },
+ { "<Toolbox>/File/Dialogs/Tool Options...", "<control><shift>T", dialogs_tools_options_cmd_callback, NULL },
+
+ {"<Toolbox>/File/<separator>",NULL,NULL,NULL},
+
+
+
+ { "<Toolbox>/File/Quit", "<control>Q", file_quit_cmd_callback, NULL },
{ "<Image>/File/New", "<control>N", file_new_cmd_callback, (gpointer) 1 },
{ "<Image>/File/Open", "<control>O", file_open_cmd_callback, NULL },
@@ -59,6 +69,11 @@
{ "<Image>/File/Save as", NULL, file_save_as_cmd_callback, NULL },
{ "<Image>/File/Preferences...", NULL, file_pref_cmd_callback, NULL },
{ "<Image>/File/<separator>", NULL, NULL, NULL },
+
+
+
+
+
{ "<Image>/File/Close", "<control>W", file_close_cmd_callback, NULL },
{ "<Image>/File/Quit", "<control>Q", file_quit_cmd_callback, NULL },
@@ -131,6 +146,7 @@
{ "<Image>/Image/<separator>", NULL, NULL, NULL },
{ "<Image>/Image/Histogram", NULL, image_histogram_cmd_callback, NULL },
+ { "<Image>/Layers/Layers & Channels...", "<control>L", dialogs_lc_cmd_callback, NULL },
{ "<Image>/Layers/Raise Layer", "<control>F", layers_raise_cmd_callback, NULL },
{ "<Image>/Layers/Lower Layer", "<control>B", layers_lower_cmd_callback, NULL },
{ "<Image>/Layers/Anchor Layer", "<control>H", layers_anchor_cmd_callback, NULL },
@@ -162,8 +178,10 @@
{ "<Image>/Tools/Convolve", "V", tools_select_cmd_callback, (gpointer) CONVOLVE },
{ "<Image>/Filters/", NULL, NULL, NULL },
- { "<Image>/Filters/Repeat", "<alt>F", filters_repeat_cmd_callback, (gpointer) 0x0 },
- { "<Image>/Filters/<nothing>", "<alt><shift>F", filters_repeat_cmd_callback, (gpointer) 0x1 },
+ { "<Image>/Filters/Repeat last", "<alt>F", filters_repeat_cmd_callback, (gpointer) 0x0 },
+ { "<Image>/Filters/Re-show last", "<alt><shift>F", filters_repeat_cmd_callback, (gpointer)
+ 0x1 },
+ { "<Image>/Filters/<separator>", NULL, NULL, NULL },
{ "<Image>/Dialogs/Brushes...", "<control><shift>B", dialogs_brushes_cmd_callback, NULL },
{ "<Image>/Dialogs/Patterns...", "<control><shift>P", dialogs_patterns_cmd_callback, NULL },
--------------4AE3CC25D6572AE7848F08B--
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Tue Jun 24 05:30:25 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id FAA11895 for scott; Tue, 24 Jun 1997 05:30:25 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa04769;
24 Jun 97 3:11 PDT
Received: (qmail 3779 invoked by uid 27258); 24 Jun 1997 09:02:35 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 3776 invoked by uid 27258); 24 Jun 1997 09:02:34 -0000
Delivered-To: gimp-developer@scam.xcf.berkeley.edu
Received: (qmail 3770 invoked by uid 0); 24 Jun 1997 09:02:33 -0000
Received: from relay-13.mail.demon.net (HELO punt-2.mail.demon.net) (194.217.242.21)
by scam.xcf.berkeley.edu with SMTP; 24 Jun 1997 09:02:33 -0000
Received: from primag.demon.co.uk ([158.152.57.99]) by punt-2.mail.demon.net
id aa0622467; 24 Jun 97 10:09 BST
Received: from hp747.primag.primag.co.uk by beryl.primag.co.uk (4.1/SMI-4.1)
id AA23730; Tue, 24 Jun 97 10:05:32 BST
Received: by hp747.primag
(1.38.193.4/16.2) id AA04226; Tue, 24 Jun 1997 10:05:31 +0100
Message-Id: <XFMail.970624100530.medp@primag.co.uk>
X-Mailer: XFMail 1.1 [p0] on HPUX
Sender: medp@primag.co.uk
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
Resent-Date: Tue, 10 Jun 1997 17:21:41 +0100 (BST)
Resent-Message-Id: <XFMail.970611171852.medp@primag.co.uk>
Resent-From: Mark Powell <medp@primag.co.uk>
Resent-To: gimp-developer@scam.xcf.berkeley.edu
Date: Tue, 24 Jun 1997 10:03:06 +0100 (BST)
Organization: Primagraphics Ltd.
From: Mark Powell <medp@primag.co.uk>
To: gimp-developer@scam.xcf.berkeley.edu
Subject: [gimp-devel] [patch] no tool icons on Sparc
Other post from before the mailing list crash....
gimp-0.99.10, Solaris 2.5, X11R6.1
When I ran gimp-0.99.10 on our Sparc/Solaris 2.5 machines there were no
icons in the tool buttons.
The problem is in creating a mask pixmap for the buttons. The original
code used the value of WhitePixel assuming it to be 1. In fact, this
could be any number, and is actually 0 on our Suns (1 is black).
When creating masks you need to use 0 and 1 explicitly. This one-liner
patch to app/interface.c fixes it.
--- app/interface.c.ORIG Fri Jun 6 08:01:28 1997
+++ app/interface.c Wed Jun 11 17:10:25 1997
@@ -401,7 +401,7 @@
gc = gdk_gc_new (*mask);
gdk_draw_rectangle (*mask, gc, TRUE, 0, 0, -1, -1);
- gdk_color_white (cmap, &tmp_color);
+ tmp_color.pixel = 1;
gdk_gc_set_foreground (gc, &tmp_color);
}
---
Mark Powell, Senior Software Engineer, Primagraphics Limited
New Cambridge House, Litlington, nr.Royston, Herts, SG8 0SS, UK
Tel. +44 1763 852222, Fax. 853324, medp@primag.co.uk, http://www.primag.co.uk
From peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com Tue Jun 10 21:30:15 1997
Return-Path: peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id VAA12139 for scott; Tue, 10 Jun 1997 21:30:15 -0500
Received: from peyote-asesino.nuclecu.unam.mx by gilroy.rmp.com id aa11798;
10 Jun 97 19:15 PDT
Received: (qmail 12017 invoked by uid 1179); 11 Jun 1997 01:22:42 -0000
Date: 11 Jun 1997 01:22:42 -0000
Message-ID: <19970611012242.12016.qmail@peyote-asesino.nuclecu.unam.mx>
From: Federico Mena <federico@peyote-asesino.nuclecu.unam.mx>
To: gimp-developer@scam.xcf.berkeley.edu
CC: Scott Goehring <scott@poverty.bloomington.in.us>
Subject: PATCH: one-too-many option in rect_select
Reply-to: federico@nuclecu.unam.mx
Hello,
This patch removes the "Antialiasing" check button from the
rectangular selection tool options dialog. Rect-select does not even
have antialiasing :-)
Quartic
--- app/rect_select.c.orig Tue Jun 10 18:20:02 1997
+++ app/rect_select.c Tue Jun 10 18:30:44 1997
@@ -30,7 +30,7 @@
extern SelectionOptions *ellipse_options;
static SelectionOptions *rect_options = NULL;
-static void rect_select (GImage *, int, int, int, int, int, int, int, double);
+static void rect_select (GImage *, int, int, int, int, int, int, double);
extern void ellipse_select (GImage *, int, int, int, int, int, int, int, double);
static Argument *rect_select_invoker (Argument *);
@@ -136,12 +136,15 @@
}
/* the antialias toggle button */
- antialias_toggle = gtk_check_button_new_with_label ("Antialiasing");
- gtk_box_pack_start (GTK_BOX (vbox), antialias_toggle, FALSE, FALSE, 0);
- gtk_signal_connect (GTK_OBJECT (antialias_toggle), "toggled",
- (GtkSignalFunc) selection_toggle_update,
- &options->antialias);
- gtk_widget_show (antialias_toggle);
+ if (tool_type != RECT_SELECT)
+ {
+ antialias_toggle = gtk_check_button_new_with_label ("Antialiasing");
+ gtk_box_pack_start (GTK_BOX (vbox), antialias_toggle, FALSE, FALSE, 0);
+ gtk_signal_connect (GTK_OBJECT (antialias_toggle), "toggled",
+ (GtkSignalFunc) selection_toggle_update,
+ &options->antialias);
+ gtk_widget_show (antialias_toggle);
+ }
/* the feather toggle button */
feather_toggle = gtk_check_button_new_with_label ("Feather");
@@ -188,7 +191,6 @@
int w,
int h,
int op,
- int antialias,
int feather,
double feather_radius)
{
@@ -323,7 +325,6 @@
rect_select (gdisp->gimage,
x1, y1, (x2 - x1), (y2 - y1),
rect_sel->op,
- rect_options->antialias,
rect_options->feather,
rect_options->feather_radius);
break;
@@ -657,7 +658,7 @@
/* call the rect_select procedure */
if (success)
rect_select (gimage, (int) x, (int) y, (int) w, (int) h,
- op, TRUE, feather, feather_radius);
+ op, feather, feather_radius);
return procedural_db_return_args (&rect_select_proc, success);
}
Return-Path: dal56.dhc.net!wopr.sac!seth@gilroy.rmp.com
Return-Path: dal56.dhc.net!wopr.sac!seth@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id UAA21293 for scott; Wed, 2 Jul 1997 20:00:27 -0500
Received: from dal56.dhc.net by gilroy.rmp.com id aa24738; 2 Jul 97 17:34 PDT
Received: (from root@localhost) by wopr.sac (8.7.6/8.7.3) id TAA29199 for scott@poverty.bloomington.in.us; Wed, 2 Jul 1997 19:31:59 -0400
From: Seth Burgess <seth@wopr.sac>
Message-Id: <199707022331.TAA29199@wopr.sac>
Subject: New Secondary Patches
To: scott@poverty.bloomington.in.us
Date: Wed, 2 Jul 1997 19:31:59 -0400 (EDT)
Reply-To: sjburges@ou.edu
X-Mailer: ELM [version 2.4ME+ PL28 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
This patch registers a refresh-brushes in the PDB. This is to accomodate my script-fu. (see Jen's page)
seth
sjburges@ou.edu
--- gimp-0.99.10.orig/app/brushes.c Fri Jun 6 16:05:33 1997
+++ app/brushes.c Wed Jul 2 07:43:04 1997
@@ -486,6 +486,24 @@
return return_args;
}
+static Argument *
+brushes_refresh_brush_invoker (Argument *args)
+{
+
+ /* FIXME: I've hardcoded success to be 1, because brushes_init() is a
+ * void function right now. It'd be nice if it returned a value at
+ * some future date, so we could tell if things blew up when reparsing
+ * the list (for whatever reason).
+ * - Seth "Yes, this is a kludge" Burgess
+ * <sjburges@ou.edu>
+ */
+
+ success = TRUE ;
+ brushes_init();
+ return procedural_db_return_args (&brushes_refresh_brush_proc, success);
+}
+
+
/* The procedure definition */
ProcArg brushes_get_brush_out_args[] =
{
@@ -529,6 +547,32 @@
{ { brushes_get_brush_invoker } },
};
+/* =========================================================== */
+/* REFRESH BRUSHES */
+/* =========================================================== */
+
+ProcRecord brushes_refresh_brush_proc =
+{
+ "gimp_brushes_refresh",
+ "Refresh current brushes",
+ "This procedure retrieves all brushes currently in the user's brush path
+and updates the brush dialog accordingly.",
+ "Seth Burgess<sjburges@ou.edu>",
+ "Seth Burgess",
+ "1997",
+ PDB_INTERNAL,
+
+ /* Input arguments */
+ 0,
+ NULL,
+
+ /* Output arguments */
+ 0,
+ NULL,
+
+ /* Exec method */
+ { { brushes_refresh_brush_invoker } },
+};
/***********************/
/* BRUSHES_SET_BRUSH */
--- app/brushes.h Wed May 28 15:48:09 1997
+++ gimp-0.99.10.new/app/brushes.h Sat Jun 28 16:31:24 1997
@@ -68,5 +68,6 @@
extern ProcRecord brushes_get_paint_mode_proc;
extern ProcRecord brushes_set_paint_mode_proc;
extern ProcRecord brushes_list_proc;
+extern ProcRecord brushes_refresh_brush_proc;
#endif /* __BRUSHES_H__ */
--- app/internal_procs.c Mon Jun 2 22:07:37 1997
+++ gimp-0.99.10.new/app/internal_procs.c Sun Jun 29 10:38:27 1997
@@ -258,6 +258,7 @@
/* Interface procs */
procedural_db_register (&brushes_get_brush_proc);
+ procedural_db_register (&brushes_refresh_brush_proc);
procedural_db_register (&brushes_set_brush_proc);
procedural_db_register (&brushes_get_opacity_proc);
procedural_db_register (&brushes_set_opacity_proc);
From peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com Tue Jun 10 17:02:06 1997
Return-Path: peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id RAA11581 for scott; Tue, 10 Jun 1997 17:02:06 -0500
Received: from peyote-asesino.nuclecu.unam.mx by gilroy.rmp.com id aa01277;
10 Jun 97 14:43 PDT
Received: (qmail 10612 invoked by uid 1179); 10 Jun 1997 20:41:58 -0000
Date: 10 Jun 1997 20:41:57 -0000
Message-ID: <19970610204157.10611.qmail@peyote-asesino.nuclecu.unam.mx>
From: Federico Mena <federico@peyote-asesino.nuclecu.unam.mx>
To: gimp-developer@scam.xcf.berkeley.edu
CC: scott@poverty.bloomington.in.us
Subject: PATCH: cancel button on script-fu color selectors
Reply-to: federico@nuclecu.unam.mx
Hello, all
This patch fixes the non-working Cancel button on Script-fu's color
selectors. You may get a small offset on the patch if you have not
applied the preview visuals patch that I sent yesterday.
Quartic
--- plug-ins/script-fu/script-fu-scripts.c.orig Mon Jun 9 19:51:53 1997
+++ plug-ins/script-fu/script-fu-scripts.c Tue Jun 10 16:15:08 1997
@@ -37,6 +37,7 @@
GtkWidget *preview;
GtkWidget *dialog;
gdouble color[3];
+ gdouble old_color[3];
} SFColor;
typedef union
@@ -107,6 +108,8 @@
gpointer data);
static void script_fu_preview_changed (GtkWidget *widget,
gpointer data);
+static void script_fu_preview_cancel (GtkWidget *widget,
+ gpointer data);
/*
* Local variables
@@ -1046,6 +1049,10 @@
color = (SFColor *) data;
if (!color->dialog)
{
+ color->old_color[0] = color->color[0];
+ color->old_color[1] = color->color[1];
+ color->old_color[2] = color->color[2];
+
color->dialog = gtk_color_selection_dialog_new ("Script-Fu Color Picker");
csd = GTK_COLOR_SELECTION_DIALOG (color->dialog);
@@ -1054,10 +1061,10 @@
gtk_signal_connect_object (GTK_OBJECT (csd->ok_button), "clicked",
(GtkSignalFunc) gtk_widget_hide,
GTK_OBJECT (color->dialog));
- gtk_signal_connect_object (GTK_OBJECT (csd->cancel_button), "clicked",
- (GtkSignalFunc) gtk_widget_hide,
- GTK_OBJECT (color->dialog));
- gtk_signal_connect (GTK_OBJECT(csd->colorsel), "color_changed",
+ gtk_signal_connect (GTK_OBJECT (csd->cancel_button), "clicked",
+ (GtkSignalFunc) script_fu_preview_cancel,
+ color);
+ gtk_signal_connect (GTK_OBJECT (csd->colorsel), "color_changed",
(GtkSignalFunc) script_fu_preview_changed,
color);
@@ -1084,5 +1091,22 @@
color = (SFColor *) data;
gtk_color_selection_get_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (color->dialog)->colorsel),
color->color);
+ script_fu_color_preview (color->preview, color->color);
+}
+
+static void
+script_fu_preview_cancel (GtkWidget *widget,
+ gpointer data)
+{
+ SFColor *color;
+
+ color = (SFColor *) data;
+
+ gtk_widget_hide(color->dialog);
+
+ color->color[0] = color->old_color[0];
+ color->color[1] = color->old_color[1];
+ color->color[2] = color->old_color[2];
+
script_fu_color_preview (color->preview, color->color);
}
From sphinx.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com Mon Jun 16 18:08:37 1997
Return-Path: sphinx.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id SAA08400 for scott; Mon, 16 Jun 1997 18:08:37 -0500
Received: from sphinx.nuclecu.unam.mx by gilroy.rmp.com id aa27013;
16 Jun 97 16:02 PDT
Received: (from federico@localhost) by sphinx.nuclecu.unam.mx (8.6.12/8.6.11) id RAA05114; Mon, 16 Jun 1997 17:40:52 -0500
Date: Mon, 16 Jun 1997 17:40:52 -0500
Message-Id: <199706162240.RAA05114@sphinx.nuclecu.unam.mx>
From: Federico Mena <federico@nuclecu.unam.mx>
To: gimp-developer@scam.xcf.berkeley.edu
CC: Scott Goehring <scott@poverty.bloomington.in.us>
Subject: PATCH: color pickers in script-fu
Reply-to: federico@nuclecu.unam.mx
Hello, all
I guess you have already noticed that if you invoke a script-fu script
dialog and use a color picker, then close the dialog and later invoke
it again, the color pickers won't work. This patch fixes this.
Quartic
--- plug-ins/script-fu/script-fu-scripts.c.orig Wed Jun 11 20:29:19 1997
+++ plug-ins/script-fu/script-fu-scripts.c Mon Jun 16 17:33:20 1997
@@ -96,6 +96,7 @@
static void script_fu_interface (SFScript *script);
static void script_fu_color_preview (GtkWidget *preview,
gdouble *color);
+static void script_fu_cleanup_widgets (SFScript *script);
static void script_fu_ok_callback (GtkWidget *widget,
gpointer data);
static void script_fu_close_callback (GtkWidget *widget,
@@ -919,6 +920,26 @@
}
static void
+script_fu_cleanup_widgets (SFScript *script)
+{
+ int i;
+
+ for (i = 0; i < script->num_args; i++)
+ switch (script->arg_types[i])
+ {
+ case SF_COLOR:
+ if (script->arg_values[i].sfa_color.dialog != NULL)
+ {
+ gtk_widget_destroy (script->arg_values[i].sfa_color.dialog);
+ script->arg_values[i].sfa_color.dialog = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+static void
script_fu_ok_callback (GtkWidget *widget,
gpointer data)
{
@@ -1006,6 +1027,9 @@
/* disable the current command field */
script_fu_disable_cc (err_msg);
+ /* Clean up flying widgets before terminating Gtk */
+ script_fu_cleanup_widgets(script);
+
gtk_main_quit ();
g_free (command);
@@ -1015,6 +1039,9 @@
script_fu_close_callback (GtkWidget *widget,
gpointer data)
{
+ if (sf_interface.script != NULL)
+ script_fu_cleanup_widgets(sf_interface.script);
+
gtk_main_quit ();
}
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 30 23:00:53 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id XAA17819 for scott; Mon, 30 Jun 1997 23:00:53 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa14204;
30 Jun 97 20:50 PDT
Received: (qmail 27951 invoked by uid 27258); 30 Jun 1997 23:33:26 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 27948 invoked by uid 27258); 30 Jun 1997 23:33:25 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 27941 invoked by uid 0); 30 Jun 1997 23:33:24 -0000
Received: from kalypso.cybercom.net (209.21.136.5)
by scam.xcf.berkeley.edu with SMTP; 30 Jun 1997 23:33:24 -0000
Received: from cybercom.net (chris@mfd-dial1-11.cybercom.net [209.21.137.11]) by kalypso.cybercom.net (8.8.5/8.8.5) with ESMTP id TAA02129 for <gimp-developer@scam.XCF.Berkeley.EDU>; Mon, 30 Jun 1997 19:31:54 -0400 (EDT)
Message-Id: <199706302331.TAA02129@kalypso.cybercom.net>
Date: Mon, 30 Jun 1997 19:40:50 -0400 (EDT)
From: Chris Laas <chrisl@cybercom.net>
Sender: Chris Laas <chris@cybercom.net>
Reply-To: chrisl@cybercom.net
Subject: [gimp-devel] (patch) A bit more helpful Script-Fu PDB error message.
To: gimp-developer@scam.XCF.Berkeley.EDU
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY="65792-269167349-867714056=:5253"
--65792-269167349-867714056=:5253
Content-Type: TEXT/plain; CHARSET=US-ASCII
To try to solve some of the Script-Fu problems on my system, I patched
it to print out the failed command along with the exquisitely unhelpful
"Procedural database execution failed" message. It doesn't solve the
font problem (BTW, I'm all for an SF-FONT type) and probably won't be
any use to end-users, but might be helpful to developers debugging
their scripts.
Patch is attached. It was made from the root of the gimp tree, but only
modifies plug-ins/script-fu/script-fu.c .
--Chris
--
*No one* lived a completely blameless life. It might just be
possible, by lying very still in a cellar somewhere, to get through a
day without committing a crime. But only just. And even then, you
were probably guilty of loitering.
-- Terry Pratchett, "Feet of Clay"
______________________________________________________________________
Chris Laas: out-of-work programmer / mailto:chrisl@cybercom.net
< Unix, C/C++, Java, Perl, Tcl/Tk > / http://www.cybercom.net/~chrisl/
--65792-269167349-867714056=:5253
Content-Type: TEXT/plain; CHARSET=US-ASCII
Content-Description: gimp.script-fu.errmsg.patch
--- gimp-0.99.10.orig/plug-ins/script-fu/script-fu.c Fri Jun 6 03:20:40 1997
+++ plug-ins/script-fu/script-fu.c Mon Jun 30 16:38:18 1997
@@ -57,6 +57,9 @@
static void init_constants (void);
static void convert_string (char * str);
+static int sputs_fcn (char *st, void *dest);
+static LISP lprin1s (LISP exp, char *dest);
+
static LISP marshall_proc_db_call (LISP a);
static LISP script_fu_register_call (LISP a);
static LISP script_fu_quit_call (LISP a);
@@ -450,6 +453,25 @@
}
}
+static int
+sputs_fcn (char *st, void *dest)
+{
+ strcpy (*((char**)dest), st);
+ *((char**)dest) += strlen(st);
+ return (1);
+}
+
+static LISP
+lprin1s (LISP exp, char *dest)
+{
+ struct gen_printio s;
+ s.putc_fcn = NULL;
+ s.puts_fcn = sputs_fcn;
+ s.cb_argument = &dest;
+ lprin1g (exp, &s);
+ return (NIL);
+}
+
static LISP
marshall_proc_db_call (LISP a)
{
@@ -475,6 +497,10 @@
LISP return_val;
char *string;
int string_len;
+ LISP a_saved;
+
+ /* Save a in case it is needed for an error message. */
+ a_saved = a;
/* Make sure there are arguments */
if (a == NIL)
@@ -718,14 +744,22 @@
/* Check the return status */
if (! values)
- return err ("Procedural database execution did not return a status!", NIL);
+ {
+ strcpy (error_str, "Procedural database execution did not return a status:\n ");
+ lprin1s (a_saved, error_str + strlen(error_str));
+ return err (error_str, NIL);
+ }
switch (values[0].data.d_status)
{
case STATUS_EXECUTION_ERROR:
- return err ("Procedural database execution failed", NIL);
+ strcpy (error_str, "Procedural database execution failed:\n ");
+ lprin1s (a_saved, error_str + strlen(error_str));
+ return err (error_str, NIL);
break;
case STATUS_CALLING_ERROR:
- return err ("Procedural database execution failed on invalid input arguments", NIL);
+ strcpy (error_str, "Procedural database execution failed on invalid input arguments:\n ");
+ lprin1s (a_saved, error_str + strlen(error_str));
+ return err (error_str, NIL);
break;
case STATUS_SUCCESS:
return_val = NIL;
--65792-269167349-867714056=:5253--
Return-Path: peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Return-Path: peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id SAA11651 for scott; Tue, 10 Jun 1997 18:00:27 -0500
Received: from peyote-asesino.nuclecu.unam.mx by gilroy.rmp.com id aa02043;
10 Jun 97 15:08 PDT
Received: (qmail 10802 invoked by uid 1179); 10 Jun 1997 21:14:43 -0000
Date: 10 Jun 1997 21:14:43 -0000
Message-ID: <19970610211443.10801.qmail@peyote-asesino.nuclecu.unam.mx>
From: Federico Mena <federico@peyote-asesino.nuclecu.unam.mx>
To: Scott Goehring <scott@poverty.bloomington.in.us>
Subject: PATCH: script-fu on remote displays
Reply-to: federico@nuclecu.unam.mx
Hello, all
This patch fixes a problem with script-fu not initializing the visual
for preview widgets. This should help people who run the GIMP via
remote display (like me).
Quartic
--- plug-ins/script-fu/script-fu-scripts.c.orig Mon Jun 9 18:15:01 1997
+++ plug-ins/script-fu/script-fu-scripts.c Mon Jun 9 18:15:50 1997
@@ -724,6 +724,7 @@
gint argc;
int start_args;
int i;
+ guchar *color_cube;
argc = 1;
argv = g_new (gchar *, 1);
@@ -731,6 +732,16 @@
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
+
+ gdk_set_use_xshm(gimp_use_xshm());
+
+ gtk_preview_set_gamma(gimp_gamma());
+ gtk_preview_set_install_cmap(gimp_install_cmap());
+ color_cube = gimp_color_cube();
+ gtk_preview_set_color_cube(color_cube[0], color_cube[1], color_cube[2], color_cube[3]);
+
+ gtk_widget_set_default_visual(gtk_preview_get_visual());
+ gtk_widget_set_default_colormap(gtk_preview_get_cmap());
sf_interface.script = script;
--- plug-ins/script-fu/script-fu-console.c.orig Mon Jun 9 18:20:57 1997
+++ plug-ins/script-fu/script-fu-console.c Mon Jun 9 18:20:29 1997
@@ -154,6 +154,7 @@
GtkWidget *table;
gchar **argv;
gint argc;
+ guchar *color_cube;
argc = 1;
argv = g_new (gchar *, 1);
@@ -161,6 +162,16 @@
gtk_init (&argc, &argv);
gtk_rc_parse (gimp_gtkrc ());
+
+ gdk_set_use_xshm(gimp_use_xshm());
+
+ gtk_preview_set_gamma(gimp_gamma());
+ gtk_preview_set_install_cmap(gimp_install_cmap());
+ color_cube = gimp_color_cube();
+ gtk_preview_set_color_cube(color_cube[0], color_cube[1], color_cube[2], color_cube[3]);
+
+ gtk_widget_set_default_visual(gtk_preview_get_visual());
+ gtk_widget_set_default_colormap(gtk_preview_get_cmap());
dlg = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dlg), "Script-Fu Console");
From peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com Wed Jun 11 20:02:38 1997
Return-Path: peyote-asesino.nuclecu.unam.mx!nuclecu.unam.mx!federico@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id UAA14477 for scott; Wed, 11 Jun 1997 20:02:37 -0500
Received: from peyote-asesino.nuclecu.unam.mx by gilroy.rmp.com id aa00528;
11 Jun 97 17:06 PDT
Received: (qmail 18916 invoked by uid 1179); 11 Jun 1997 23:12:16 -0000
Date: 11 Jun 1997 23:12:16 -0000
Message-ID: <19970611231216.18915.qmail@peyote-asesino.nuclecu.unam.mx>
From: Federico Mena <federico@peyote-asesino.nuclecu.unam.mx>
To: gimp-developer@scam.xcf.berkeley.edu
CC: Scott Goehring <scott@poverty.bloomington.in.us>
Subject: PATCH: inconsistent toggle buttons in selection options
Reply-to: federico@nuclecu.unam.mx
Hello, all
This patch fixes the toggle buttons in the selection tools' option
dialogs so that they will be consistent with the actual settings.
That is, they *will* show antialiasing as on when antialiasing is on :-)
Quartic
--- app/rect_select.c.orig Wed Jun 11 18:50:51 1997
+++ app/rect_select.c Wed Jun 11 18:53:38 1997
@@ -73,7 +73,7 @@
/* the new options structure */
options = (SelectionOptions *) g_malloc (sizeof (SelectionOptions));
- options->antialias = 1;
+ options->antialias = TRUE;
options->feather = FALSE;
options->feather_radius = 10.0;
options->sample_merged = FALSE;
@@ -128,7 +128,7 @@
gtk_signal_connect (GTK_OBJECT (sample_merged_toggle), "toggled",
(GtkSignalFunc) selection_toggle_update,
&options->sample_merged);
- gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (sample_merged_toggle), FALSE);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (sample_merged_toggle), options->sample_merged);
gtk_widget_show (sample_merged_toggle);
break;
default:
@@ -143,6 +143,7 @@
gtk_signal_connect (GTK_OBJECT (antialias_toggle), "toggled",
(GtkSignalFunc) selection_toggle_update,
&options->antialias);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (antialias_toggle), options->antialias);
gtk_widget_show (antialias_toggle);
}
@@ -152,7 +153,7 @@
gtk_signal_connect (GTK_OBJECT (feather_toggle), "toggled",
(GtkSignalFunc) selection_toggle_update,
&options->feather);
- gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (feather_toggle), FALSE);
+ gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (feather_toggle), options->feather);
gtk_widget_show (feather_toggle);
/* the feather radius scale */
@@ -163,7 +164,7 @@
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
- feather_scale_data = gtk_adjustment_new (10.0, 0.0, 100.0, 1.0, 1.0, 0.0);
+ feather_scale_data = gtk_adjustment_new (options->feather_radius, 0.0, 100.0, 1.0, 1.0, 0.0);
feather_scale = gtk_hscale_new (GTK_ADJUSTMENT (feather_scale_data));
gtk_box_pack_start (GTK_BOX (hbox), feather_scale, TRUE, TRUE, 0);
gtk_scale_set_value_pos (GTK_SCALE (feather_scale), GTK_POS_TOP);
From scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com Mon Jun 9 17:02:24 1997
Return-Path: scam.xcf.berkeley.edu!gimp-developer-owner@gilroy.rmp.com
Received: from gilroy.UUCP (root@localhost) by poverty.bloomington.in.us (8.7.3/8.7.3/poverty) with UUCP id RAA28042 for scott; Mon, 9 Jun 1997 17:02:24 -0500
Received: from scam.XCF.Berkeley.EDU by gilroy.rmp.com id aa06361;
9 Jun 97 15:00 PDT
Received: (qmail 7372 invoked by uid 27258); 9 Jun 1997 04:10:34 -0000
Delivered-To: gimp-developer-outgoing@xcf.berkeley.edu
Received: (qmail 7368 invoked by uid 27258); 9 Jun 1997 04:10:33 -0000
Delivered-To: gimp-developer@scam.XCF.Berkeley.EDU
Received: (qmail 7361 invoked from network); 9 Jun 1997 04:10:31 -0000
Received: from kyoto-109.seikyou.ne.jp (HELO lira.izumi.or.jp) (takamori@202.211.150.109)
by softdnserror with SMTP; 9 Jun 1997 04:10:31 -0000
Received: from lira.izumi.or.jp (takamori@localhost [127.0.0.1]) by lira.izumi.or.jp (8.7.5+2.6Wbeta6/3.4W3) with ESMTP id NAA31965 for <gimp-developer@scam.XCF.Berkeley.EDU>; Mon, 9 Jun 1997 13:12:16 +0900
Message-Id: <199706090412.NAA31965@lira.izumi.or.jp>
To: gimp-developer@scam.XCF.Berkeley.EDU
Subject: [gimp-devel] Updated nova, gradmap, ..., and patch to scm
From: Eiichi Takamori <taka@ma1.seikyou.ne.jp>
X-Mailer: Mew version 1.06 on Emacs 19.28.1, Mule 2.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Date: Mon, 09 Jun 1997 13:12:16 +0900
Sender: takamori@lira.izumi.or.jp
Hi!
I updated nova, gradmap, edge, pixelize plug-ins. Minor bug fixes &
modified UI a little. And gradmap didn't work, now it works.
You can get them from Plug-in Registry, or:
http://ha1.seikyou.ne.jp/home/taka/gimp/plug-ins/docs/plug-ins.html
To compile: simply cd plug-ins/ and replace *.c and
make; make install will do it.
And, if you get nova, whose parameters have been changed, patch to
starburst.scm and starscape.scm is needed.
% cd plug-ins/script-fu/scripts/
% patch < THIS_MAIL
% make install
will do it.
Have fun!
--taka
\|/ Eiichi Takamori, who is guu-tara, a lazy and poor boy.
-@- http://ha1.seikyou.ne.jp/home/taka/gimp/
/|\ mailto:taka@ma1.seikyou.ne.jp
*** plug-ins/script-fu/scripts/starburst-logo.scm.orig Wed Jun 4 06:22:58 1997
--- plug-ins/script-fu/scripts/starburst-logo.scm Sun Jun 8 22:52:28 1997
***************
*** 44,51 ****
(gimp-palette-set-background '(255 255 255))
(gimp-edit-fill img layer-mask)
(gimp-selection-none img)
! (plug-in-nova 1 img burst-layer (car burst-coords) (cdr burst-coords) (car burst-color)
! (cadr burst-color) (caddr burst-color) burstradius)
(gimp-selection-layer-alpha img text-layer)
(gimp-palette-set-background '(0 0 0))
--- 44,51 ----
(gimp-palette-set-background '(255 255 255))
(gimp-edit-fill img layer-mask)
(gimp-selection-none img)
! (plug-in-nova 1 img burst-layer (car burst-coords) (cdr burst-coords)
! burst-color burstradius 100)
(gimp-selection-layer-alpha img text-layer)
(gimp-palette-set-background '(0 0 0))
*** plug-ins/script-fu/scripts/starscape-logo.scm.orig Sat Jun 7 10:47:13 1997
--- plug-ins/script-fu/scripts/starscape-logo.scm Sun Jun 8 22:51:58 1997
***************
*** 88,95 ****
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend img text-layer FG-BG-RGB NORMAL BILINEAR 100 0 REPEAT-NONE FALSE 0 0 cx cy bx by)
! (plug-in-nova 1 img glow-layer novax novay (car glow-color)
! (cadr glow-color) (caddr glow-color) novaradius)
(gimp-selection-all img)
(gimp-patterns-set-pattern "Stone")
--- 88,94 ----
(gimp-palette-set-foreground '(255 255 255))
(gimp-blend img text-layer FG-BG-RGB NORMAL BILINEAR 100 0 REPEAT-NONE FALSE 0 0 cx cy bx by)
! (plug-in-nova 1 img glow-layer novax novay glow-color novaradius 100)
(gimp-selection-all img)
(gimp-patterns-set-pattern "Stone")
--- gimp-0.99.10-dist/app/commands.c Tue Jun 3 19:31:10 1997
+++ app/commands.c Mon Jun 9 20:16:38 1997
@@ -163,16 +163,18 @@
layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, "Background", OPAQUE, NORMAL);
- /* add the new layer to the gimage */
- gimage_disable_undo (gimage);
- gimage_add_layer (gimage, layer, 0);
- gimage_enable_undo (gimage);
-
- drawable_fill (layer->ID, vals->fill_type);
-
- /* gimage_clean_all (gimage); */
-
- gdisplay = gdisplay_new (gimage, 0x0101);
+ if (layer) {
+ /* add the new layer to the gimage */
+ gimage_disable_undo (gimage);
+ gimage_add_layer (gimage, layer, 0);
+ gimage_enable_undo (gimage);
+
+ drawable_fill (layer->ID, vals->fill_type);
+
+ /* gimage_clean_all (gimage); */
+
+ gdisplay = gdisplay_new (gimage, 0x0101);
+ }
g_free (vals);
}
--- gimp-0.99.10-dist/app/layer.c Thu May 29 19:16:06 1997
+++ app/layer.c Mon Jun 9 20:16:38 1997
@@ -119,6 +119,11 @@
{
Layer * layer;
+ if (width == 0 || height == 0) {
+ warning ("Zero width or height layers not allowed.");
+ return NULL;
+ }
+
layer = (Layer *) g_malloc (sizeof (Layer));
if (!name)
@@ -232,6 +237,11 @@
/* allocate a new layer object */
new_layer = layer_new (layer->gimage_ID, layer->width, layer->height,
new_type, layer_name, layer->opacity, layer->mode);
+ if (!new_layer) {
+ warning("layer_copy: could not allocate new layer");
+ goto cleanup;
+ }
+
new_layer->offset_x = layer->offset_x;
new_layer->offset_y = layer->offset_y;
new_layer->visible = layer->visible;
@@ -261,6 +271,7 @@
new_layer->show_mask = layer->show_mask;
}
+ cleanup:
/* free up the layer_name memory */
g_free (layer_name);
@@ -298,6 +309,11 @@
/* Create the new layer */
new_layer = layer_new (0, tiles->levels[0].width, tiles->levels[0].height,
layer_type, name, opacity, mode);
+
+ if (!new_layer) {
+ warning("layer_from_tiles: could not allocate new layer");
+ return NULL;
+ }
/* Configure the pixel regions */
pixel_region_init (&layerPR, new_layer->tiles, 0, 0, new_layer->width, new_layer->height, TRUE);
--- gimp-0.99.10-dist/app/layers_dialog.c Tue Jun 3 18:08:47 1997
+++ app/layers_dialog.c Mon Jun 9 20:17:01 1997
@@ -2798,15 +2798,22 @@
layer = layer_new (gimage->ID, options->xsize, options->ysize,
gimage_base_type_with_alpha (gimage),
layer_name, OPAQUE, NORMAL_MODE);
- drawable_fill (layer->ID, fill_type);
- gimage_add_layer (gimage, layer, -1);
-
- /* end the group undo */
- undo_push_group_end (gimage);
-
- gdisplays_flush ();
+ if (layer)
+ {
+ drawable_fill (layer->ID, fill_type);
+ gimage_add_layer (gimage, layer, -1);
+
+ /* end the group undo */
+ undo_push_group_end (gimage);
+
+ gdisplays_flush ();
+ }
+ else
+ {
+ warning("new_layer_query_ok_callback: could not allocate new layer");
+ }
}
-
+
gtk_widget_destroy (options->query_box);
g_free (options);
}
--- gimp-0.99.10-dist/app/gimage.c Tue Jun 3 20:29:19 1997
+++ app/gimage.c Mon Jun 9 20:16:38 1997
@@ -1794,6 +1794,11 @@
merge_layer = layer_new (gimage->ID, gimage->width, gimage->height,
type, layer->name, OPAQUE, NORMAL_MODE);
+ if (!merge_layer) {
+ warning("gimage_merge_layers: could not allocate merge layer");
+ return NULL;
+ }
+
/* get the background for compositing */
gimage_get_background (gimage, merge_layer->ID, bg);
@@ -1814,6 +1819,11 @@
merge_layer = layer_new (gimage->ID, (x2 - x1), (y2 - y1),
drawable_type_with_alpha (layer->ID), layer->name,
OPAQUE, NORMAL_MODE);
+
+ if (!merge_layer) {
+ warning("gimage_merge_layers: could not allocate merge layer");
+ return NULL;
+ }
merge_layer->offset_x = x1;
merge_layer->offset_y = y1;
--- gimp-0.99.10-dist/app/text_tool.c Fri Jun 6 03:09:09 1997
+++ app/text_tool.c Mon Jun 9 20:16:38 1997
@@ -1612,12 +1612,11 @@
if (newmask != mask)
tile_manager_destroy (mask);
- if (newmask)
- {
- layer = layer_new (gimage->ID, newmask->levels[0].width,
+ if (newmask &&
+ (layer = layer_new (gimage->ID, newmask->levels[0].width,
newmask->levels[0].height, layer_type,
- "Text Layer", OPAQUE, NORMAL_MODE);
-
+ "Text Layer", OPAQUE, NORMAL_MODE)))
+ {
/* color the layer buffer */
gimage_get_foreground (gimage, drawable_id, color);
color[layer->bytes - 1] = OPAQUE;
@@ -1655,8 +1654,12 @@
tile_manager_destroy (newmask);
}
- else
- layer = NULL;
+ else
+ {
+ if (newmask)
+ warning("text_render: could not allocate image");
+ layer = NULL;
+ }
/* free the pixmap */
gdk_pixmap_destroy (pixmap);
|