Commit b3c67233 authored by Marc Lehmann's avatar Marc Lehmann
Browse files

applied update by Shuji Narazaki <narazaki@gimp.org>.

	* plug-ins/script-fu/scripts/line-nova.scm,
	plug-ins/script-fu/scripts/text-circle.scm,
	plug-ins/script-fu/scripts/unsharp-mask.scm: applied update by Shuji
	Narazaki <narazaki@gimp.org>.
parent fa8a3bc9
Wed Nov 25 22:12:50 CET 1998 Marc Lehmann <pcg@goof.com>
* plug-ins/script-fu/scripts/line-nova.scm,
plug-ins/script-fu/scripts/text-circle.scm,
plug-ins/script-fu/scripts/unsharp-mask.scm: applied update by Shuji
Narazaki <narazaki@gimp.org>.
Wed Nov 25 09:52:23 1998 Raph Levien <raph@gimp.org>
* app/ink.c (ink_pen_ellipse, create_ink_options): Added tilt
......
;;; line-nova.scm -*-scheme-*-
;;; Time-stamp: <1998/01/17 21:15:38 narazaki@InetQ.or.jp>
;;; Author Shuji Narazaki <narazaki@inetq.or.jp>
;;; Version 0.6
(if (not (symbol-bound? 'script-fu-line-nova-num-of-lines (the-environment)))
(define script-fu-line-nova-num-of-lines 200))
(if (not (symbol-bound? 'script-fu-line-nova-corn-deg (the-environment)))
(define script-fu-line-nova-corn-deg 1.0))
(if (not (symbol-bound? 'script-fu-line-nova-offset (the-environment)))
(define script-fu-line-nova-offset 100))
(if (not (symbol-bound? 'script-fu-line-nova-variation (the-environment)))
(define script-fu-line-nova-variation 30))
;;; line-nova.scm for gimp-1.1 -*-scheme-*-
;;; Time-stamp: <1998/11/25 13:26:44 narazaki@gimp.org>
;;; Author Shuji Narazaki <narazaki@gimp.org>
;;; Version 0.7
(define (script-fu-line-nova img drw num-of-lines corn-deg offset variation)
(let* ((*points* (cons-array (* 3 2) 'double))
......@@ -27,7 +18,9 @@
(drw-width (car (gimp-drawable-width drw)))
(drw-height (car (gimp-drawable-height drw)))
(drw-offsets (gimp-drawable-offsets drw))
(old-selection (car (gimp-selection-save img)))
(old-selection (if (eq? (car (gimp-selection-is-empty img)) TRUE)
#f
(car (gimp-selection-save img))))
(radius (max drw-height drw-width))
(index 0)
(dir-deg/line (/ 360 num-of-lines)))
......@@ -47,15 +40,15 @@
(aux dir1 1)
(aux dir2 2)))
(let ((dir0 (deg->rad direction))
(of (+ offset (- (modulo (rand) variation) variation/2))))
(off (+ offset (- (modulo (rand) variation) variation/2))))
(set-point! 0
(+ beg-x (* of (cos dir0)))
(+ beg-y (* of (sin dir0))))
(+ beg-x (* off (cos dir0)))
(+ beg-y (* off (sin dir0))))
(set-marginal-point beg-x beg-y direction)
(gimp-free-select img 6 *points* ADD
TRUE ; antialias
FALSE ; feather
0 ; feather radius
0 ; feather radius
)))
(gimp-undo-push-group-start img)
......@@ -67,30 +60,28 @@
(* index dir-deg/line))
(set! index (+ index 1)))
(gimp-bucket-fill drw FG-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
(gimp-selection-load old-selection)
;; (gimp-image-set-active-layer img drw)
;; delete extra channel by Sven Neumann <neumanns@uni-duesseldorf.de>
(gimp-image-remove-channel img old-selection)
(if old-selection
(begin
(gimp-selection-load old-selection)
;; (gimp-image-set-active-layer img drw)
;; delete extra channel by Sven Neumann <neumanns@uni-duesseldorf.de>
(gimp-image-remove-channel img old-selection)))
(gimp-undo-push-group-end img)
(set! script-fu-line-nova-num-of-lines num-of-lines)
(set! script-fu-line-nova-corn-deg corn-deg)
(set! script-fu-line-nova-offset offset)
(set! script-fu-line-nova-variation variation)
(gimp-displays-flush)))
(script-fu-register
"script-fu-line-nova"
"<Image>/Script-Fu/Render/Line Nova"
"Line Nova. Draw lines with Foreground color from the center of image to the edges. 1st undo cancels bucket-fill. 2nd undo gets orignal selection."
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki <narazaki@gimp.org>"
"Shuji Narazaki"
"1997"
"RGB*, INDEXED*, GRAY*"
"1997,1998"
""
SF-IMAGE "Image to use" 0
SF-DRAWABLE "Drawable to draw line" 0
SF-VALUE "Number of lines" (number->string script-fu-line-nova-num-of-lines)
SF-VALUE "Sharpness (deg.)" (number->string script-fu-line-nova-corn-deg)
SF-VALUE "Offset radius" (number->string script-fu-line-nova-offset)
SF-VALUE "- randomness" (number->string script-fu-line-nova-variation)
SF-ADJUSTMENT "Number of lines" '(200 40 1000 1 1 0 1)
SF-ADJUSTMENT "Sharpness (deg.)" '(1.0 0.0 10.0 0.1 1 1 1)
SF-ADJUSTMENT "Offset radius" '(100 0 2000 1 1 0 1)
SF-ADJUSTMENT "- randomness" '(30 0 2000 1 1 0 1)
)
;;; line-nova.scm ends here
;; text-circle.scm -- a script for The GIMP 1.0
;; Author: Shuji Narazaki <narazaki@InetQ.or.jp>
;; Time-stamp: <1998/04/30 22:00:40 narazaki@InetQ.or.jp>
;; Version 2.4
;; text-circle.scm -- a script for The GIMP 1.1
;; Author: Shuji Narazaki <narazaki@gimp.org>
;; Time-stamp: <1998/11/25 13:26:51 narazaki@gimp.org>
;; Version 2.5
;; Thanks:
;; jseymour@jimsun.LinxNet.com (Jim Seymour)
;; Sven Neumann <neumanns@uni-duesseldorf.de>
......@@ -22,39 +22,11 @@
;; large descent value to each letter temporally, most letters in most fonts
;; are aligned correctly. But don't expect completeness :-<
(if (not (symbol-bound? 'script-fu-text-circle-text (the-environment)))
(define script-fu-text-circle-text
"\"The GNU Image Manipulation Program Version 1.0 \""))
(if (not (symbol-bound? 'script-fu-text-circle-radius (the-environment)))
(define script-fu-text-circle-radius 80))
(if (not (symbol-bound? 'script-fu-text-circle-start-angle (the-environment)))
(define script-fu-text-circle-start-angle 0))
(if (not (symbol-bound? 'script-fu-text-circle-fill-angle (the-environment)))
(define script-fu-text-circle-fill-angle 360))
(if (not (symbol-bound? 'script-fu-text-circle-font-size (the-environment)))
(define script-fu-text-circle-font-size 18))
(if (not (symbol-bound? 'script-fu-text-circle-antialias (the-environment)))
(define script-fu-text-circle-antialias TRUE))
(if (not (symbol-bound? 'script-fu-text-circle-extra-pole (the-environment)))
(define script-fu-text-circle-extra-pole TRUE))
(if (not (symbol-bound? 'script-fu-text-circle-font-foundry (the-environment)))
(define script-fu-text-circle-font-foundry "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-family (the-environment)))
(define script-fu-text-circle-font-family "\"helvetica\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-weight (the-environment)))
(define script-fu-text-circle-font-weight "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-slant (the-environment)))
(define script-fu-text-circle-font-slant "\"r\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-width (the-environment)))
(define script-fu-text-circle-font-width "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-font-spacing (the-environment)))
(define script-fu-text-circle-font-spacing "\"*\""))
(if (not (symbol-bound? 'script-fu-text-circle-debug? (the-environment)))
(define script-fu-text-circle-debug? #f))
(define (script-fu-text-circle text radius start-angle fill-angle
font-size antialias
foundry family weight slant width spacing)
font-size antialias font-name)
;;(set! script-fu-text-circle-debug? #t)
(define extra-pole TRUE) ; for debugging purpose
(define modulo fmod) ; in R4RS way
......@@ -76,8 +48,8 @@
(fixed-pole0 "l Agy")
;; the following used as real pad.
(fixed-pole " lAgy")
(font-infos (gimp-text-get-extents fixed-pole font-size PIXELS
"*" family "*" slant "*" "*"))
(font-infos (gimp-text-get-extents-fontname fixed-pole font-size
PIXELS font-name))
(desc (nth 3 font-infos))
(extra 0) ; extra is calculated from real layer
(angle-list #f)
......@@ -93,11 +65,11 @@
(set! radian-step (/ fill-angle-rad char-num))
;; set extra
(if (eq? extra-pole TRUE)
(let ((temp-pole-layer (car (gimp-text img -1 0 0
(let ((temp-pole-layer (car (gimp-text-fontname img -1 0 0
fixed-pole0
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*"))))
font-name))))
(set! extra (car (gimp-drawable-width temp-pole-layer)))
(gimp-image-remove-layer img temp-pole-layer))
(set! extra 0))
......@@ -116,11 +88,11 @@
(set! temp-str (substring text index (+ index 1)))
(if (white-space-string? temp-str)
(set! temp-str "x"))
(set! temp-layer (car (gimp-text img -1 0 0
temp-str
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*")))
(set! temp-layer (car (gimp-text-fontname img -1 0 0
temp-str
1 antialias
font-size PIXELS
font-name)))
(set! temp-list (cons (car (gimp-drawable-width temp-layer)) temp-list))
(gimp-image-remove-layer img temp-layer)
(set! index (+ index 1)))
......@@ -139,13 +111,14 @@
(set! letter (substring text index (+ index 1)))
(if (not (white-space-string? letter))
;; Running gimp-text with " " causes an error!
(let* ((new-layer (car (gimp-text img -1 0 0
(if (eq? extra-pole TRUE)
(string-append letter fixed-pole)
letter)
1 antialias
font-size PIXELS
"*" family "*" slant "*" "*")))
(let* ((new-layer
(car (gimp-text-fontname img -1 0 0
(if (eq? extra-pole TRUE)
(string-append letter fixed-pole)
letter)
1 antialias
font-size PIXELS
font-name)))
(width (car (gimp-drawable-width new-layer)))
(height (car (gimp-drawable-height new-layer)))
(rotate-radius (- (/ height 2) desc))
......@@ -187,41 +160,23 @@
(gimp-image-enable-undo img)
(gimp-image-clean-all img)
(gimp-display-new img)
(set! script-fu-text-circle-text (wrap-string text))
(set! script-fu-text-circle-radius radius)
(set! script-fu-text-circle-start-angle start-angle)
(set! script-fu-text-circle-fill-angle fill-angle)
(set! script-fu-text-circle-font-size font-size)
(set! script-fu-text-circle-antialias antialias)
(set! script-fu-text-circle-extra-pole extra-pole)
(set! script-fu-text-circle-font-foundry (wrap-string foundry))
(set! script-fu-text-circle-font-family (wrap-string family))
(set! script-fu-text-circle-font-weight (wrap-string weight))
(set! script-fu-text-circle-font-slant (wrap-string slant))
(set! script-fu-text-circle-font-width (wrap-string width))
(set! script-fu-text-circle-font-spacing (wrap-string spacing))
(gimp-displays-flush)))
(script-fu-register
"script-fu-text-circle"
"<Toolbox>/Xtns/Script-Fu/Logos/Text Circle"
"Render the specified text along the perimeter of a circle"
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki <narazaki@gimp.org>"
"Shuji Narazaki"
"1997-1998"
""
SF-VALUE "Text" script-fu-text-circle-text
SF-VALUE "Radius" (number->string script-fu-text-circle-radius)
SF-VALUE "Start-angle[-180:180]" (number->string script-fu-text-circle-start-angle)
SF-VALUE "Fill-angle [-360:360]" (number->string script-fu-text-circle-fill-angle)
SF-VALUE "Font Size (pixel)" (number->string script-fu-text-circle-font-size)
SF-TOGGLE "Antialias" script-fu-text-circle-antialias
SF-VALUE "Font Foundry" script-fu-text-circle-font-foundry
SF-VALUE " - Family" script-fu-text-circle-font-family
SF-VALUE " - Weight" script-fu-text-circle-font-weight
SF-VALUE " - Slant" script-fu-text-circle-font-slant
SF-VALUE " - Width" script-fu-text-circle-font-width
SF-VALUE " - Spacing" script-fu-text-circle-font-spacing
SF-STRING "Text" "The GNU Image Manipulation Program Version 1.1 "
SF-ADJUSTMENT "Radius" '(80 1 8000 1 1 0 1)
SF-ADJUSTMENT "Start-angle[-180:180]" '(0 -180 180 1 1 0 1)
SF-ADJUSTMENT "Fill-angle [-360:360]" '(360 -360 360 1 1 0 1)
SF-ADJUSTMENT "Font Size (pixel)" '(18 1 1000 1 1 0 1)
SF-TOGGLE "Antialias" TRUE
SF-FONT "Font name" "-adobe-helvetica-bold-r-normal-*-30-*-*-*-p-*-*-*"
)
;; text-circle.scm ends here
;;; unsharp-mask.scm
;;; Time-stamp: <1997/10/30 23:27:20 narazaki@InetQ.or.jp>
;;; Author: Narazaki Shuji <narazaki@inetq.or.jp>
;;; Version 0.7
;;; Time-stamp: <1998/11/17 13:18:39 narazaki@gimp.org>
;;; Author: Narazaki Shuji <narazaki@gimp.org>
;;; Version 0.8
;;; Code:
(if (not (symbol-bound? 'script-fu-unsharp-mask-mask-size (the-environment)))
(define script-fu-unsharp-mask-mask-size 5))
(define (script-fu-unsharp-mask img drw mask-size)
(define (script-fu-unsharp-mask img drw mask-size mask-opacity)
(let* ((drawable-width (car (gimp-drawable-width drw)))
(drawable-height (car (gimp-drawable-height drw)))
(new-image (car (gimp-image-new drawable-width drawable-height RGB)))
......@@ -54,26 +49,26 @@
;; combine them
(gimp-layer-set-visible original-layer TRUE)
(gimp-layer-set-mode darker-layer SUBTRACT)
(gimp-layer-set-opacity darker-layer 50.0)
(gimp-layer-set-opacity darker-layer mask-opacity)
(gimp-layer-set-visible darker-layer TRUE)
(gimp-layer-set-mode lighter-layer ADDITION)
(gimp-layer-set-opacity lighter-layer 50.0)
(gimp-layer-set-opacity lighter-layer mask-opacity)
(gimp-layer-set-visible lighter-layer TRUE)
(gimp-image-enable-undo new-image)
(set! script-fu-unsharp-mask-mask-size mask-size)
(gimp-displays-flush)))
(script-fu-register
"script-fu-unsharp-mask"
"<Image>/Script-Fu/Alchemy/Unsharp Mask"
"Make a sharp image of IMAGE's DRAWABLE by applying unsharp mask method"
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki <narazaki@gimp.org>"
"Shuji Narazaki"
"1997"
"RGB*, GRAY*"
"1997,1998"
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable to apply" 0
SF-VALUE "Mask size" (number->string script-fu-unsharp-mask-mask-size )
SF-ADJUSTMENT "Mask size" '(5 1 100 1 1 0 1)
SF-ADJUSTMENT "Mask opacity" '(50 0 100 1 1 0 1)
)
;;; unsharp-mask.scm ends here
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment