File: ean13.include-2

package info (click to toggle)
ean13 0.4-8.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 140 kB
  • ctags: 19
  • sloc: makefile: 96; ansic: 67; sh: 58
file content (44 lines) | stat: -rw-r--r-- 2,297 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ------------------------------------------------------------------------- */
/* ean13.include-2                                                           


   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version
   2 of the License, or (at your option) any later version.

   THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
   ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   SUCH DAMAGE.


*/   



void plot (int x, int y)
{                                                                               
    int xbyte = x >> 3;                                                         
    int xbit = x & 0x7;                                                         
                                                                                
    if (x >= 0 && x < WIDTH && y >= 0 && y < HEIGHT)                            
        buf[y][xbyte] |= 1 << xbit;                                             
} 

void vertical_line (int x, int y1, int y2)                                      
{       /* position, start-row, end-row */                                      
    while (y1 <= y2)                                                            
    {                                                                           
        plot (x, y1);                                                           
        y1++;                                                                   
    }                                                                           
}
/* end of file */