| 233 | } |
| 234 | |
| 235 | void rleFrString( RLE *R, char *s, siz h, siz w ) { |
| 236 | siz m=0, p=0, k; long x; int more; uint *cnts; |
| 237 | while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0; |
| 238 | while( s[p] ) { |
| 239 | x=0; k=0; more=1; |
| 240 | while( more ) { |
| 241 | char c=s[p]-48; x |= (c & 0x1f) << 5*k; |
| 242 | more = c & 0x20; p++; k++; |
| 243 | if(!more && (c & 0x10)) x |= -1 << 5*k; |
| 244 | } |
| 245 | if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x; |
| 246 | } |
| 247 | rleInit(R,h,w,m,cnts); free(cnts); |
| 248 | } |
no test coverage detected