1
/* $Xorg: ecroi.c,v 1.4 2001/02/09 02:04:20 xorgcvs Exp $ */
2
/**** module ecroi.c ****/
3
/******************************************************************************
5
Copyright 1993, 1994, 1998 The Open Group
7
Permission to use, copy, modify, distribute, and sell this software and its
8
documentation for any purpose is hereby granted without fee, provided that
9
the above copyright notice appear in all copies and that both that
10
copyright notice and this permission notice appear in supporting
13
The above copyright notice and this permission notice shall be included in
14
all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
Except as contained in this notice, the name of The Open Group shall not be
24
used in advertising or otherwise to promote the sale, use or other dealings
25
in this Software without prior written authorization from The Open Group.
30
This software is being provided by AGE Logic, Inc. under the
31
following license. By obtaining, using and/or copying this software,
32
you agree that you have read, understood, and will comply with these
35
Permission to use, copy, modify, distribute and sell this
36
software and its documentation for any purpose and without
37
fee or royalty and to grant others any or all rights granted
38
herein is hereby granted, provided that you agree to comply
39
with the following copyright notice and statements, including
40
the disclaimer, and that the same appears on all copies and
41
derivative works of the software and documentation you make.
43
"Copyright 1993, 1994 by AGE Logic, Inc."
45
THIS SOFTWARE IS PROVIDED "AS IS". AGE LOGIC MAKES NO
46
REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. By way of
47
example, but not limitation, AGE LOGIC MAKE NO
48
REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS
49
FOR ANY PARTICULAR PURPOSE OR THAT THE SOFTWARE DOES NOT
50
INFRINGE THIRD-PARTY PROPRIETARY RIGHTS. AGE LOGIC
51
SHALL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE. IN NO
52
EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDIRECT,
53
INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS
54
OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER PARTY OR
55
ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT OR
56
BASED ON A WARRANTY, EVEN IF AGE LOGIC LICENSEES
57
HEREUNDER HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
60
The name of AGE Logic, Inc. may not be used in
61
advertising or publicity pertaining to this software without
62
specific, written prior permission from AGE Logic.
64
Title to this software shall at all times remain with AGE
66
*****************************************************************************
68
ecroi.c -- DIXIE routines for managing the ExportClientROI element
70
Dean Verheiden -- AGE Logic, Inc. August 1993
72
*****************************************************************************/
73
/* $XFree86: xc/programs/Xserver/XIE/dixie/export/ecroi.c,v 3.5 2001/12/14 19:57:58 dawes Exp $ */
101
* routines internal to this module
103
static Bool PrepECROI(floDefPtr flo, peDefPtr ped);
108
static diElemVecRec eROIVec = {
109
PrepECROI /* prepare for analysis and execution */
113
/*------------------------------------------------------------------------
114
----------------- routine: make an ExportClientROI element ----------------
115
------------------------------------------------------------------------*/
116
peDefPtr MakeECROI(floDefPtr flo, xieTypPhototag tag, xieFlo *pe)
120
ELEMENT(xieFloExportClientROI);
121
ELEMENT_AT_LEAST_SIZE(xieFloExportClientROI);
122
ELEMENT_NEEDS_1_INPUT(src);
124
if(!(ped = MakePEDef(1, (CARD32)stuff->elemLength<<2, 0)))
125
FloAllocError(flo,tag,xieElemExportClientROI, return(NULL));
127
ped->diVec = &eROIVec;
129
ped->flags.export = TRUE;
130
ped->flags.getData = TRUE;
131
raw = (xieFloExportClientROI *)ped->elemRaw;
133
* copy the standard client element parameters (swap if necessary)
135
if (flo->reqClient->swapped) {
136
raw->elemType = stuff->elemType;
137
raw->elemLength = stuff->elemLength;
138
cpswaps(stuff->src, raw->src);
139
raw->notify = stuff->notify;
141
memcpy((char *)raw, (char *)stuff, sizeof(xieFloExportClientROI));
143
* assign phototags to inFlos
145
inFlo = ped->inFloLst;
146
inFlo[SRCtag].srcTag = raw->src;
149
} /* end MakeECROI */
152
/*------------------------------------------------------------------------
153
---------------- routine: prepare for analysis and execution -------------
154
------------------------------------------------------------------------*/
155
static Bool PrepECROI(floDefPtr flo, peDefPtr ped)
157
xieFloExportClientROI *raw = (xieFloExportClientROI *)ped->elemRaw;
158
inFloPtr inf = &ped->inFloLst[SRCtag];
159
outFloPtr src = &inf->srcDef->outFlo;
160
outFloPtr dst = &ped->outFlo;
162
/* Make sure notify value is valid
164
if(raw->notify != xieValDisable &&
165
raw->notify != xieValFirstData &&
166
raw->notify != xieValNewData)
167
ValueError(flo,ped,raw->notify, return(FALSE));
169
/* Validate and Propagate input attributes to our output */
170
if (src->bands != 1 || src->format[0].class != RUN_LENGTH)
171
FloSourceError(flo,raw->src,raw->elemType, return(FALSE));
173
dst->bands = inf->bands = src->bands;
174
dst->format[0] = inf->format[0] = src->format[0];
175
ped->swapUnits[0] = sizeof(xieTypRectangle);
178
} /* end PrepECROI */
180
/* end module ecroi.c */