%%------------------------------------------------------------------------------
%% clipimage.sty
%
% LaTeX2e package clipimage.
% Provides some pre-defines clipping shapes for images.
% To be used with pstricks.
%
%
% (C) Copyright 1997 by:
%
% Volker Kuhlmann
% c/o EEE Dept
% University of Canterbury
% Private Bag 4800, Christchurch, New Zealand
% E-Mail: VOLKER@ELEC.CANTERBURY.AC.NZ
%
% Permission granted to use this file free of charge, and to distribute
% it provided no charge is made for distribution.
% This file must not be altered without changing its name.
%
%
% HISTORY:
%
% 1.0 02Oct97	Created.
%
%%------------------------------------------------------------------------------

\def\filename{clipimage}
\def\fileversion{V1.0}
\def\filedate{1997/10/02}


\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{\filename}[\filedate]
\typeout{Package `\filename', \fileversion, <\filedate>}


%% LOAD REQUIRED PACKAGES

\RequirePackage{pstcol}


%% FONTS


%% DECLARE PACKAGE OPTIONS

%\DeclareOption{pagenumbers}{\pagestyle{plain}}



%
%% MACROS
%

% Clip what is produced by arg 1,
% as a rectangle with corners chopped off straight,
% then corners slightly rounded
%
\newcommand\putcliproundnocornerrect[1]{%
\begingroup
\newbox\imgbox
\setbox\imgbox=\hbox{#1}%
\psset{xunit=.1\wd\imgbox,yunit=.1\ht\imgbox}%
\begin{pspicture}(0,0)(10,10)%
	\psclip{%
		%\psframe[cornersize=relative,framearc=0.4,%
		%	linestyle=solid,linewidth=1.0pt](0,0)(10,10)%
		\pspolygon[linewidth=1pt,linearc=.3]
			%(2,0)(8,0)(10,2)(10,8)(8,10)(2,10)(0,8)(0,2)(2,0)
			(1.8,0)(8.2,0)(10,1.8)(10,8.2)
				(8.2,10)(1.8,10)(0,8.2)(0,1.8)(1.8,0)
		}%
	\rput[bl](0,0){\box\imgbox}%
	\endpsclip
\end{pspicture}%
\endgroup
}


% Clip what is produced by arg 1,
% as a heart
%
\newcommand\putclipheart[1]{%
\begingroup
\newbox\imgbox
\setbox\imgbox=\hbox{#1}%
\psset{xunit=.25\wd\imgbox,yunit=.25\ht\imgbox}%
\begin{pspicture}(0,0)(4,4)
	%\psgrid
	\psset{linestyle=none}%
	\psclip{%
		\pscustom[%showpoints=true,%
			%linestyle=dotted,linewidth=1.2pt,linetype=0,
			linewidth=0,
			curvature=1 .6 0]{
		\pscurve[%
			%showpoints=true,%
			liftpen=2]
			(2,3.4)(1.58,3.84)(.75,3.97)(0,3.2)(2,0)
		\pscurve[%
			%showpoints=true,%
			liftpen=2]
			(2,3.4)(2.42,3.84)(3.25,3.97)(4,3.2)(2,0)
			}
		}%
	\rput[bl](0,0){\box\imgbox}%
	\endpsclip
\end{pspicture}%
\endgroup
}


%
%% EOF clipimage.sty
%%------------------------------------------------------------------------------
