1 /**
2  ** putscl.c ---- put scanline pixels
3  **
4  ** Copyright (c) 1998 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 "clipping.h"
20 
GrPutScanline(int x1,int x2,int yy,const GrColor * c,GrColor op)21 void GrPutScanline(int x1,int x2,int yy,const GrColor *c, GrColor op)
22 /* Input   x1 : first x coordinate to be set                        */
23 /*         x2 : last  x coordinate to be set                        */
24 /*         yy : y coordinate                                        */
25 /*         c  : c[0..(|x2-x1|] hold the pixel data                  */
26 /*         op : Operation (GrWRITE/GrXOR/GrOR/GrAND/GrIMAGE)        */
27 /*                                                                  */
28 /* Note    c[..] data must fit GrCVALUEMASK otherwise the results   */
29 /*         are implementation dependend.                            */
30 /*         => You can't supply operation code with the pixel data!  */
31 {
32 	int xs;
33 	isort(x1,x2);
34 	xs = x1;
35 	clip_hline(CURC,x1,x2,yy);
36 	mouse_block(CURC,x1,yy,x2,yy);
37 	(*FDRV->putscanline)(
38 	    x1 + CURC->gc_xoffset,
39 	    yy + CURC->gc_yoffset,
40 	    x2 - x1 + 1,
41 	    &c[x1-xs],  /* adjust pixel pointer when clipped */
42 	    op
43 	);
44 	mouse_unblock();
45 }
46