bitblt.h

changeset 57
b2a2f61135bb
parent 53
bb180150e603
child 72
cddd6226b509
     1.1 --- a/bitblt.h	Wed Feb 19 10:34:35 2003 +0000
     1.2 +++ b/bitblt.h	Thu Feb 20 12:11:06 2003 +0000
     1.3 @@ -4,7 +4,7 @@
     1.4   *      will be compressed using ITU-T T.6 (G4) fax encoding.
     1.5   *
     1.6   * bitblt routines
     1.7 - * $Id: bitblt.h,v 1.10 2003/02/19 02:14:44 eric Exp $
     1.8 + * $Id: bitblt.h,v 1.11 2003/02/20 04:11:06 eric Exp $
     1.9   * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
    1.10   *
    1.11   * This program is free software; you can redistribute it and/or modify
    1.12 @@ -98,3 +98,25 @@
    1.13  
    1.14  
    1.15  void reverse_bits (uint8_t *p, int byte_count);
    1.16 +
    1.17 +
    1.18 +/*
    1.19 + * get_row_run_lengths counts the runs of 0 and 1 bits in row
    1.20 + * y of a bitmap, from min_x through max_x inclusive.  The run lengths
    1.21 + * will be stored in the run_length array.  The first entry will be
    1.22 + * the length of a zero run (which length may be zero, if the first
    1.23 + * bit is a one).  The next entry will the be the length of a run of
    1.24 + * ones, and they will alternate from there, with even entries representing
    1.25 + * runs of zeros, and odd entries representing runs of ones.
    1.26 + *
    1.27 + * max_runs should be set to the maximum number of run lengths that
    1.28 + * can be stored in the run_length array.
    1.29 + *
    1.30 + * Returns the actual number of runs counted, or -max_runs if there
    1.31 + * was not enough room in the array.
    1.32 + */
    1.33 +int32_t get_row_run_lengths (Bitmap *src,
    1.34 +			     int32_t y,
    1.35 +			     int32_t min_x, int32_t max_x,
    1.36 +			     int32_t max_runs,
    1.37 +			     uint32_t *run_length);