~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to lib/psdriver/Draw_bitmap.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#include "psdriver.h"
3
 
 
4
 
void PS_draw_bitmap(int ncols, int nrows, int threshold,
5
 
                    const unsigned char *buf)
6
 
{
7
 
    int i, j;
8
 
 
9
 
    output("%d %d %d %d BITMAP\n", cur_x, cur_y, ncols, nrows);
10
 
 
11
 
    for (j = 0; j < nrows; j++) {
12
 
        unsigned int bit = 0x80;
13
 
        unsigned int acc = 0;
14
 
 
15
 
        for (i = 0; i < ncols; i++) {
16
 
            unsigned int k = buf[j * ncols + i];
17
 
 
18
 
            if (k > threshold)
19
 
                acc |= bit;
20
 
 
21
 
            bit >>= 1;
22
 
 
23
 
            if (!bit) {
24
 
                output("%02X", acc);
25
 
                bit = 0x80;
26
 
                acc = 0;
27
 
            }
28
 
        }
29
 
 
30
 
        if (bit != 0x80)
31
 
            output("%02X", acc);
32
 
 
33
 
        output("\n");
34
 
    }
35
 
}