GrafX2 2.9.3227
The ultimate 256-color painting program
|
Packbytes compression as used in Apple Preferred Format. More...
#include <stdio.h>
#include <string.h>
#include "struct.h"
#include "io.h"
#include "gfx2log.h"
#include "packbytes.h"
Functions | |
void | PackBytes_pack_init (T_PackBytes_data *data, FILE *f) |
init before packing More... | |
int | PackBytes_pack_add (T_PackBytes_data *data, byte b) |
Add a byte to the packbits stream. More... | |
int | PackBytes_pack_flush (T_PackBytes_data *data) |
Flush the packed data to the file. More... | |
int | PackBytes_pack_buffer (FILE *f, const byte *buffer, size_t size) |
Pack a full buffer to FILE. More... | |
Packbytes compression as used in Apple Preferred Format.
void PackBytes_pack_init | ( | T_PackBytes_data * | data, |
FILE * | f | ||
) |
init before packing
data | storage for packbits data |
f | FILE output or NULL (for no output) |
References T_PackBytes_data::f.
Referenced by PackBytes_pack_buffer(), and Save_2GS().
int PackBytes_pack_add | ( | T_PackBytes_data * | data, |
byte | b | ||
) |
Add a byte to the packbits stream.
References T_PackBytes_data::list, T_PackBytes_data::list_size, PackBytes_pack_flush(), and T_PackBytes_data::repetition_mode.
Referenced by PackBytes_pack_buffer(), and Save_2GS().
int PackBytes_pack_flush | ( | T_PackBytes_data * | data | ) |
Flush the packed data to the file.
References T_PackBytes_data::f, GFX2_ERROR, GFX2_Log(), T_PackBytes_data::list, T_PackBytes_data::list_size, NULL, T_PackBytes_data::output_count, T_PackBytes_data::repetition_mode, Write_byte(), and Write_bytes().
Referenced by PackBytes_pack_add(), PackBytes_pack_buffer(), and Save_2GS().
int PackBytes_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 PackBytes_pack_add(), PackBytes_pack_flush(), and PackBytes_pack_init().