From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/gio/gim/gimcpras.x | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sys/gio/gim/gimcpras.x (limited to 'sys/gio/gim/gimcpras.x') diff --git a/sys/gio/gim/gimcpras.x b/sys/gio/gim/gimcpras.x new file mode 100644 index 00000000..ea1ab32f --- /dev/null +++ b/sys/gio/gim/gimcpras.x @@ -0,0 +1,56 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include + +# GIM_COPYRASTER -- Copy a portion of the source raster to a rectangular +# region of the destination raster. + +procedure gim_copyraster (gp, rop, src,st,sx,sy,sw,sh, dst,dt,dx,dy,dw,dh) + +pointer gp #I graphics descriptor +int rop #I rasterop +int src #I source raster +int st #I coordinate type for source raster +real sx,sy,sw,sh #I source rect +int dst #I destination raster +int dt #I coordinate type for destination raster +real dx,dy,dw,dh #I destination rect + +short gim[GIM_COPYRASTER_LEN] + +begin + gim[GIM_COPYRASTER_OP] = rop + gim[GIM_COPYRASTER_SR] = src + gim[GIM_COPYRASTER_ST] = st + + if (st == CT_PIXEL) { + gim[GIM_COPYRASTER_SX] = sx + gim[GIM_COPYRASTER_SY] = sy + gim[GIM_COPYRASTER_SW] = sw + gim[GIM_COPYRASTER_SH] = sh + } else { + gim[GIM_COPYRASTER_SX] = sx * GKI_MAXNDC + gim[GIM_COPYRASTER_SY] = sy * GKI_MAXNDC + gim[GIM_COPYRASTER_SW] = nint (sw * GKI_MAXNDC) + gim[GIM_COPYRASTER_SH] = nint (sh * GKI_MAXNDC) + } + + gim[GIM_COPYRASTER_DR] = dst + gim[GIM_COPYRASTER_DT] = dt + + if (dt == CT_PIXEL) { + gim[GIM_COPYRASTER_DX] = dx + gim[GIM_COPYRASTER_DY] = dy + gim[GIM_COPYRASTER_DW] = dw + gim[GIM_COPYRASTER_DH] = dh + } else { + gim[GIM_COPYRASTER_DX] = dx * GKI_MAXNDC + gim[GIM_COPYRASTER_DY] = dy * GKI_MAXNDC + gim[GIM_COPYRASTER_DW] = nint (dw * GKI_MAXNDC) + gim[GIM_COPYRASTER_DH] = nint (dh * GKI_MAXNDC) + } + + call gescape (gp, GIM_COPYRASTER, gim, GIM_COPYRASTER_LEN) +end -- cgit