Commit a3fd8a73 authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens

removed this script. Fixes bug #466382.

2007-10-29  Kevin Cozens  <kcozens@cvs.gnome.org>

	* scripts/fade-outline.scm: removed this script. Fixes bug #466382.

	* scripts/image-structure.sct: removed this script (see bug #307016).

svn path=/trunk/; revision=373
parent 2d7edfee
2007-10-29 Kevin Cozens <kcozens@cvs.gnome.org>
* scripts/fade-outline.scm: removed this script. Fixes bug #466382.
* scripts/image-structure.sct: removed this script (see bug #307016).
2007-10-28 Kevin Cozens <kcozens@cvs.gnome.org>
* tinyscheme.patch: Removed.
......
; fade-outline.scm
; version 1.1.11a
;
; This GIMP script_fu operates on a single Layer
; It blends the outline boarder from one to another transparency level
; by adding a layer_mask that follows the shape of the selection.
; usually from 100% (white is full opaque) to 0% (black is full transparent)
;
; The user can specify the thickness of the fading border
; that is used to blend from transparent to opaque
; and the Fading direction (shrink or grow).
;
; The outline is taken from the current selection
; or from the layers alpha channel if no selection is active.
;
; Optional you may keep the generated layermask or apply
; it to the layer
;
; GIMP - The GNU Image Manipulation Program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
;
; 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
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; Define the main function:
(define (script-fu-fade-outline inImage
inLayer
inBorderSize
inFadeFrom
inFadeTo
inGrowingSelection
inApplyMask
inClearUnselected)
(let* (
(l-idx 0)
(l-has-selection TRUE)
(l-from-gray)
(l-to-gray)
(l-step)
(l-gray)
(l-mask)
(l-orig-selection)
)
(gimp-context-push)
; check Fade from and To Values (and force values from 0% to 100%)
(if (> inFadeFrom 100) (set! inFadeFrom 100) )
(if (< inFadeFrom 0) (set! inFadeFrom 0) )
(if (> inFadeTo 100) (set! inFadeTo 100) )
(if (< inFadeTo 0) (set! inFadeTo 0) )
(set! l-from-gray (* inFadeFrom 255))
(set! l-to-gray (* inFadeTo 255))
(set! l-step (/ (- l-from-gray l-to-gray) (+ inBorderSize 1)))
(set! l-gray l-to-gray)
; do nothing if the layer is a layer mask
(if (= (car (gimp-drawable-is-layer-mask inLayer)) 0)
(begin
(gimp-image-undo-group-start inImage)
; if the layer has no alpha add alpha channel
(if (= (car (gimp-drawable-has-alpha inLayer)) FALSE)
(gimp-layer-add-alpha inLayer)
)
; if the layer is the floating selection convert to normal layer
; because floating selection cant have a layer mask
(if (> (car (gimp-layer-is-floating-sel inLayer)) 0)
(gimp-floating-sel-to-layer inLayer)
)
; if there is no selection we use the layers alpha channel
(if (= (car (gimp-selection-is-empty inImage)) TRUE)
(begin
(set! l-has-selection FALSE)
(gimp-selection-layer-alpha inLayer)
)
)
;
(gimp-selection-sharpen inImage)
; apply the existing mask before creating a new one
(gimp-layer-remove-mask inLayer 0)
(if (= inClearUnselected TRUE)
(set! l-mask (car (gimp-layer-create-mask inLayer ADD-BLACK-MASK)))
(set! l-mask (car (gimp-layer-create-mask inLayer ADD-WHITE-MASK)))
)
(gimp-layer-add-mask inLayer l-mask)
(if (= inGrowingSelection TRUE)
(begin
(set! l-gray l-from-gray)
(set! l-from-gray l-to-gray)
(set! l-to-gray l-gray)
(set! l-step (/ (- l-from-gray l-to-gray) (+ inBorderSize 1)))
(set! l-orig-selection (car (gimp-selection-save inImage)))
(gimp-selection-invert inImage)
)
)
(while (<= l-idx inBorderSize)
(if (= l-idx inBorderSize)
(set! l-gray l-from-gray)
)
(gimp-context-set-background (list (/ l-gray 100) (/ l-gray 100) (/ l-gray 100)))
(gimp-edit-fill l-mask BACKGROUND-FILL)
(set! l-idx (+ l-idx 1))
(set! l-gray (+ l-gray l-step))
(gimp-selection-shrink inImage 1)
; check if selection has shrinked to none
(if (= (car (gimp-selection-is-empty inImage)) TRUE)
(set! l-idx (+ inBorderSize 100)) ; break the while loop
)
)
(if (= inGrowingSelection TRUE)
(begin
(gimp-selection-load l-orig-selection)
(gimp-context-set-background (list (/ l-to-gray 100) (/ l-to-gray 100) (/ l-to-gray 100)))
(gimp-edit-fill l-mask BACKGROUND-FILL)
(gimp-selection-grow inImage inBorderSize)
(gimp-selection-invert inImage)
(if (= inClearUnselected TRUE)
(begin
;(gimp-context-set-background (list (/ l-from-gray 100) (/ l-from-gray 100) (/ l-from-gray 100)))
(gimp-context-set-background (list 0 0 0))
)
(gimp-context-set-background (list 255 255 255))
)
(gimp-edit-fill l-mask BACKGROUND-FILL)
(gimp-image-remove-channel inImage l-orig-selection)
)
)
(if (= inApplyMask TRUE)
(gimp-layer-remove-mask inLayer 0)
)
(if (= l-has-selection FALSE)
(gimp-selection-none inImage)
)
(gimp-image-undo-group-end inImage)
(gimp-displays-flush)
)
)
(gimp-context-pop)
)
)
(script-fu-register
"script-fu-fade-outline"
_"_Fade to Layer Mask..."
_"Create a layermask that fades the edges of the selected region (or alpha)"
"Wolfgang Hofer <hof@hotbot.com>"
"Wolfgang Hofer"
"10 Nov 1999"
"RGB* GRAY*"
SF-IMAGE "The image" 0
SF-DRAWABLE "The layer" 0
SF-ADJUSTMENT _"Border size" '(10 1 300 1 10 0 1)
SF-ADJUSTMENT _"Fade from %" '(100 0 100 1 10 0 0)
SF-ADJUSTMENT _"Fade to %" '(0 0 100 1 10 0 0)
SF-TOGGLE _"Use growing selection" FALSE
SF-TOGGLE _"Apply generated layermask" FALSE
SF-TOGGLE _"Clear unselected maskarea" TRUE
)
(script-fu-menu-register "script-fu-fade-outline"
"<Image>/Filters/Selection")
;;; image-structure.scm -*-scheme-*-
;;; Time-stamp: <1998/03/28 02:46:26 narazaki@InetQ.or.jp>
;;; Author: Shuji Narazaki <narazaki@InetQ.or.jp>
;;; Version 0.7
; ************************************************************************
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
; For use with GIMP 1.1.
; All calls to gimp-text-* have been converted to use the *-fontname form.
; The corresponding parameters have been replaced by an SF-FONT parameter.
; ************************************************************************
;;; Code:
(define (tiny-fu-show-image-structure img drawable new-image? space
shear-length border apply-layer-mask?
with-layer-name? with-pad? padding-color
padding-opacity with-background?
background-color)
(if (eq? new-image? TRUE)
(begin (set! img (car (gimp-image-duplicate img)))
(gimp-display-new img)))
(let* ((layers (gimp-image-get-layers img))
(num-of-layers (car layers))
(old-width (car (gimp-image-width img)))
(old-height (car (gimp-image-height img)))
(new-width (+ (* 2 border) (+ old-width (* 2 shear-length))))
(new-height (+ (* 2 border) (+ old-height (* space (- num-of-layers 1)))))
(new-bg #f)
(layer-names '())
(layer #f)
(index 0))
(gimp-context-push)
(gimp-image-resize img new-width new-height 0 0)
(set! layers (cadr layers))
(gimp-selection-none img)
(while (< index num-of-layers)
(set! layer (aref layers index))
(if (equal? "Background" (car (gimp-drawable-get-name layer)))
(begin
(gimp-layer-add-alpha layer)
(gimp-drawable-set-name layer "Original Background")))
(set! layer-names (cons (car (gimp-drawable-get-name layer)) layer-names))
(if (not (= -1 (car (gimp-layer-get-mask layer))))
(gimp-layer-remove-mask layer
(if (= TRUE apply-layer-mask?)
MASK-APPLY
MASK-DISCARD)))
(if (= TRUE with-pad?)
(begin
(gimp-selection-layer-alpha layer)
(gimp-selection-invert img)
(gimp-layer-set-lock-alpha layer FALSE)
(gimp-context-set-foreground padding-color)
(gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE
padding-opacity 0 0 0 0)
(gimp-selection-none img)))
(gimp-layer-translate layer
(+ border shear-length) (+ border (* space index)))
(gimp-drawable-transform-shear-default layer ORIENTATION-HORIZONTAL
(* (/ (car (gimp-drawable-height layer)) old-height)
(* -2 shear-length))
TRUE FALSE)
(set! index (+ index 1)))
(set! new-bg (- num-of-layers 1))
(if (= TRUE with-background?)
(begin
(set! new-bg (car (gimp-layer-new img new-width new-height RGBA-IMAGE
"New Background" 100 NORMAL-MODE)))
(gimp-image-add-layer img new-bg num-of-layers)
(gimp-context-set-background background-color)
(gimp-edit-fill new-bg BACKGROUND-FILL)))
(gimp-image-set-active-layer img (aref layers 0))
(if (= TRUE with-layer-name?)
(let ((text-layer #f))
(gimp-context-set-foreground '(255 255 255))
(set! index 0)
(set! layer-names (nreverse layer-names))
(while (< index num-of-layers)
(set! text-layer (car (gimp-text-fontname img -1 (/ border 2)
(+ (* space index) old-height)
(car layer-names)
0 TRUE 14 PIXELS "-*-helvetica-*-r-*-*-14-*-*-*-p-*-*-*")))
(gimp-layer-set-mode text-layer NORMAL-MODE)
(set! index (+ index 1))
(set! layer-names (cdr layer-names)))))
(gimp-image-set-active-layer img new-bg)
(gimp-displays-flush)
(gimp-context-pop)))
(tiny-fu-register
"tiny-fu-show-image-structure"
_"Show Image _Structure..."
"Show the layer structure of the image"
"Shuji Narazaki <narazaki@InetQ.or.jp>"
"Shuji Narazaki"
"1997"
"RGB*, GRAY*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable (unused)" 0
SF-TOGGLE _"Create new image" TRUE
SF-ADJUSTMENT _"Space between layers" '(50 0 1000 1 10 0 1)
SF-ADJUSTMENT _"Shear length" '(50 1 1000 1 10 0 1)
SF-ADJUSTMENT _"Outer border" '(10 0 250 1 10 0 1)
SF-TOGGLE _"Apply layer mask (or discard)" TRUE
SF-TOGGLE _"Insert layer names" TRUE
SF-TOGGLE _"Padding for transparent regions" TRUE
SF-COLOR _"Pad color" '(255 255 2525)
SF-ADJUSTMENT _"Pad opacity" '(25 0 100 1 10 1 0)
SF-TOGGLE _"Make new background" TRUE
SF-COLOR _"Background color" '(0 0 0)
)
;;; image-structure.scm ends here
(tiny-fu-menu-register "tiny-fu-show-image-structure"
"<Image>/Image")
Markdown is supported
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