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