Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1542:69fa95707e65
Implement dmGenericRLEAnalyze() and use it where appropriate.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 12 May 2018 05:31:40 +0300 |
parents | 203e00a4dfc0 |
children | 3b613fcbf3ff |
comparison
equal
deleted
inserted
replaced
1541:203e00a4dfc0 | 1542:69fa95707e65 |
---|---|
79 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) | 79 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) |
80 goto out; | 80 goto out; |
81 | 81 |
82 // Analyze the data .. | 82 // Analyze the data .. |
83 dmGenericRLEAnalyze(&tmp, &cfg.rleMarker, DM_COMP_RLE_MARKER); | 83 dmGenericRLEAnalyze(&tmp, &cfg.rleMarker, DM_COMP_RLE_MARKER); |
84 cfg.rleMarker = 0xff; | |
85 | 84 |
86 // Add the header bits | 85 // Add the header bits |
87 if (!dmGrowBufPut(buf, magicID, strlen(magicID)) || | 86 if (!dmGrowBufPut(buf, magicID, strlen(magicID)) || |
88 !dmGrowBufPutU8(buf, cfg.rleMarker)) | 87 !dmGrowBufPutU8(buf, cfg.rleMarker)) |
89 { | 88 { |
365 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) | 364 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) |
366 goto out; | 365 goto out; |
367 | 366 |
368 // Analyze the data .. | 367 // Analyze the data .. |
369 dmGenericRLEAnalyze(&tmp, &cfg.rleMarker, DM_COMP_RLE_MARKER); | 368 dmGenericRLEAnalyze(&tmp, &cfg.rleMarker, DM_COMP_RLE_MARKER); |
370 cfg.rleMarker = 0xff; | |
371 | 369 |
372 // Add the header bits | 370 // Add the header bits |
373 if (!dmGrowBufPut(buf, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || | 371 if (!dmGrowBufPut(buf, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
374 !dmGrowBufPutU8(buf, cfg.rleMarker)) | 372 !dmGrowBufPutU8(buf, cfg.rleMarker)) |
375 { | 373 { |