GrafX2 2.9.3227
The ultimate 256-color painting program
|
Packbits compression as used in IFF etc. More...
#include <stdio.h>
#include <string.h>
#include "struct.h"
#include "io.h"
#include "gfx2log.h"
#include "packbits.h"
Functions | |
int | PackBits_unpack_from_file (FILE *f, byte *dest, unsigned int count) |
void | PackBits_pack_init (T_PackBits_data *data, FILE *f) |
init before packing More... | |
int | PackBits_pack_add (T_PackBits_data *data, byte b) |
Add a byte to the packbits stream. More... | |
int | PackBits_pack_flush (T_PackBits_data *data) |
Flush the packed data to the file. More... | |
int | PackBits_pack_buffer (FILE *f, const byte *buffer, size_t size) |
Pack a full buffer to FILE. More... | |
Packbits compression as used in IFF etc.
int PackBits_unpack_from_file | ( | FILE * | f, |
byte * | dest, | ||
unsigned int | count | ||
) |
References GFX2_Log(), GFX2_WARNING, PACKBITS_UNPACK_OK, PACKBITS_UNPACK_OVERFLOW_ERROR, and PACKBITS_UNPACK_READ_ERROR.
Referenced by Load_PC1(), and Test_Packbits().
void PackBits_pack_init | ( | T_PackBits_data * | data, |
FILE * | f | ||
) |
init before packing
data | storage for packbits data |
f | FILE output or NULL (for no output) |
References T_PackBits_data::f.
Referenced by PackBits_pack_buffer(), Save_IFF(), and Test_Packbits().
int PackBits_pack_add | ( | T_PackBits_data * | data, |
byte | b | ||
) |
Add a byte to the packbits stream.
References T_PackBits_data::list, T_PackBits_data::list_size, PackBits_pack_flush(), and T_PackBits_data::repetition_mode.
Referenced by PackBits_pack_buffer(), Save_IFF(), and Test_Packbits().
int PackBits_pack_flush | ( | T_PackBits_data * | data | ) |
Flush the packed data to the file.
References T_PackBits_data::f, GFX2_ERROR, GFX2_Log(), T_PackBits_data::list, T_PackBits_data::list_size, NULL, T_PackBits_data::output_count, T_PackBits_data::repetition_mode, Write_byte(), and Write_bytes().
Referenced by PackBits_pack_add(), PackBits_pack_buffer(), Save_IFF(), and Test_Packbits().
int PackBits_pack_buffer | ( | FILE * | f, |
const byte * | buffer, | ||
size_t | size | ||
) |
Pack a full buffer to FILE.
f | FILE output or NULL (for no output) |
buffer | input buffer |
size | byte size of input buffer |
References PackBits_pack_add(), PackBits_pack_flush(), and PackBits_pack_init().
Referenced by Save_PC1(), and Save_PRG().