⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bit.h

📁 c++ Builder中网络图象渐进传输实例
💻 H
字号:
#ifdef __cplusplus // C++
extern "C" {
#endif

#ifndef _BIT_H_INCLUDED
#define _BIT_H_INCLUDED

#include <stdio.h>

#ifdef WAVELET_DLL
#define WAVELET_DLL_API __declspec(dllexport)
// if i define this to be __stdcall, then mega name-decoration kicks in :(
#define WAVELET_DLL_CC
#else
#define WAVELET_DLL_API
#define WAVELET_DLL_CC
#endif

#pragma pack(push, 1)

typedef struct {
	FILE*			file;
	unsigned char	*buffer;
	int				idx;
	int				bufsize;
	int				bufleft;
	int				bits_left;
	unsigned char	mask;	// mask for bit_read, count for bit_write
	unsigned char	current_byte;
	char			mode[2];
} t_bit_file;

#pragma pack(pop)

WAVELET_DLL_API t_bit_file* WAVELET_DLL_CC bit_open(char* name, const char *mode, const int mem_size);
WAVELET_DLL_API int WAVELET_DLL_CC bit_close(t_bit_file* f, unsigned char** mem);
WAVELET_DLL_API unsigned int WAVELET_DLL_CC bit_read(int num, t_bit_file* f);
WAVELET_DLL_API unsigned int WAVELET_DLL_CC bit_read_single(t_bit_file* f);
WAVELET_DLL_API int WAVELET_DLL_CC bit_write(const unsigned int bits, const int num, t_bit_file* f);
WAVELET_DLL_API int WAVELET_DLL_CC bit_write_zero(t_bit_file* f);

#endif // _BIT_H_INCLUDED

#ifdef __cplusplus // C++
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -