1 /**
2 ** istretch.c ---- Source Image Utility
3 **
4 ** Copyright (c) 1998 by Michal Stencl and Hartmut Schirmer
5 **
6 ** This file is part of the GRX graphics library.
7 **
8 ** The GRX graphics library is free software; you can redistribute it
9 ** and/or modify it under some conditions; see the "copying.grx" file
10 ** for details.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 **
16 **/
17
18 #include "libgrx.h"
19 #include "grdriver.h"
20 #include "clipping.h"
21 #include "image/image.h"
22
GrImageStretch(GrImage * p,int nwidth,int nheight)23 GrImage *GrImageStretch(GrImage *p,int nwidth,int nheight)
24 {
25 GrContext ctx;
26 GrImage *img;
27
28 GRX_ENTER();
29 img = _GrImageAllocate(&ctx,nwidth,nheight);
30 if ( img )
31 _GrFrDrvGenericStretchBlt(&ctx.gc_frame,0,0,nwidth,nheight,
32 &p->pxp_source,0,0,p->pxp_width,p->pxp_height,
33 p->pxp_oper);
34 GRX_RETURN(img);
35 }
36