JunkBox_Lib 1.10.1
Loading...
Searching...
No Matches
jpeg_tool.h
Go to the documentation of this file.
1#ifndef __JBXL_JPEG_TOOL_H_
2#define __JBXL_JPEG_TOOL_H_
3
4#include "xtools.h"
5
6#ifndef HAVE_JPEGLIB_H
7#ifndef DISABLE_JPEG
8#define DISABLE_JPEG
9#endif
10#endif
11
12#if defined(DISABLE_JPEG) || defined(DISABLE_JPEGLIB)
13#undef ENABLE_JPEGLIB // for old version
14#undef ENABLE_JPEG
15#endif
16
17#ifndef HAVE_JPEGLIB_H
18#ifndef DISABLE_JPEG
19#define DISABLE_JPEG
20#endif
21#endif
22
23#ifdef ENABLE_JPEGLIB
24#define ENABLE_JPEG
25#endif
26
27
28#ifdef ENABLE_JPEG
29
43#include "gdata.h"
44#include <jpeglib.h>
45
46
47typedef struct
48{
49 int xs;
50 int ys;
51 int col;
52 int state;
53 JSAMPLE* gp;
54 JSAMPARRAY img;
55 //
56} JPEGImage;
57
58
59#if JPEG_LIB_VERSION < 80
60
61typedef struct {
62 struct jpeg_destination_mgr pub; // public fields
63
64 unsigned char** outbuffer; // target buffer
65 unsigned long* outsize;
66 unsigned char* newbuffer; // newly allocated buffer
67 JOCTET * buffer; // start of buffer
68 size_t bufsize;
70
72
73#endif
74
75
77
78JPEGImage read_jpeg_file (const char* fname);
79int write_jpeg_file(const char* fname, JPEGImage* jp, int qulty);
80int write_jpeg_mem(unsigned char** buf, unsigned long* len, JPEGImage* jp, int qulty);
81
86
87JPEGImage make_JPEGImage(int xs, int ys, int col);
89
90//
91#if JPEG_LIB_VERSION < 80
92
93METHODDEF(void) mem_init_destination(j_compress_ptr cinfo);
94METHODDEF(boolean) mem_empty_output_buffer(j_compress_ptr cinfo);
95METHODDEF(void) mem_term_destination(j_compress_ptr cinfo);
96GLOBAL(void) jpeg_mem_dest(j_compress_ptr cinfo, unsigned char** buf, unsigned long* len);
97
98#endif
99
100
101#endif // DISABLE_JPEG
102#endif // __JBXL_JPEG_TOOL_H_
103
104
グラフィックデータ定義用ヘッダ
JPEGImage WSGraph2JPEGImage(WSGraph vp)
Definition jpeg_tool.c:294
void free_JPEGImage(JPEGImage *jp)
Definition jpeg_tool.c:396
unsigned char ** buf
Definition jpeg_tool.h:96
METHODDEF(void) mem_init_destination(j_compress_ptr cinfo)
Definition jpeg_tool.c:415
int write_jpeg_mem(unsigned char **buf, unsigned long *len, JPEGImage *jp, int qulty)
Definition jpeg_tool.c:175
BSGraph JPEGImage2BSGraph(JPEGImage jp)
Definition jpeg_tool.c:262
JPEGImage BSGraph2JPEGImage(BSGraph vp)
Definition jpeg_tool.c:325
unsigned char unsigned long * len
Definition jpeg_tool.h:96
JPEGImage make_JPEGImage(int xs, int ys, int col)
Definition jpeg_tool.c:356
my_mem_destination_mgr * my_mem_dest_ptr
Definition jpeg_tool.h:71
GLOBAL(void) jpeg_mem_dest(j_compress_ptr cinfo
int write_jpeg_file(const char *fname, JPEGImage *jp, int qulty)
Definition jpeg_tool.c:108
WSGraph JPEGImage2WSGraph(JPEGImage jp)
Definition jpeg_tool.c:228
JPEGImage read_jpeg_file(const char *fname)
Definition jpeg_tool.c:31
JSAMPLE * gp
Definition jpeg_tool.h:53
int state
Definition jpeg_tool.h:52
JSAMPARRAY img
Definition jpeg_tool.h:54
unsigned char ** outbuffer
Definition jpeg_tool.h:64
unsigned long * outsize
Definition jpeg_tool.h:65
unsigned char * newbuffer
Definition jpeg_tool.h:66
汎用拡張ツールヘッダ