1#ifndef __JBXL_CPP_JPEG_TOOl_H_
2#define __JBXL_CPP_JPEG_TOOl_H_
24#if defined(DISABLE_JPEG) || defined(DISABLE_JPEGLIB)
40#pragma comment(lib, "libjpeg.lib")
61 JPEGImage(
void) { init();}
62 virtual ~JPEGImage(
void) {}
67 void fill(JSAMPLE v=(JSAMPLE)0);
70 JSAMPLE& point(
int x,
int y,
int c) {
return image[y][x*col + c];}
71 void getm(
int x,
int y,
int c);
72 void set (
int x,
int y,
int c);
78JPEGImage readJPEGFile (
const char* fname);
79JPEGImage readJPEGData (FILE* fp);
80int writeJPEGFile(
const char* fname, JPEGImage* jp,
int qulty);
81int writeJPEGData(FILE* fp, JPEGImage* jp,
int qulty);
83int isJPEGHeader(
Buffer buf);
85CmnHead JPEGImage2CmnHead(JPEGImage jp);
86JPEGImage CmnHead2JPEGImage(
CmnHead hd);
103template <
typename T> MSGraph<T> JPEGImage2MSGraph(JPEGImage jp)
112 vp.set(jp.xs, jp.ys, jp.col);
113 if (vp.isNull())
return vp;
117 for (
int k=0; k<jp.col; k++) {
118 int zp = k*jp.xs*jp.ys;
119 for (
int j=0; j<jp.ys; j++) {
120 int yp = zp + j*jp.xs;
121 for (
int i=0; i<jp.xs; i++) {
122 vp.gp[yp + i] = (T)jp.point(i, j, k);
141template <
typename T> JPEGImage MSGraph2JPEGImage(MSGraph<T> vp)
150 jp.set(vp.xs, vp.ys, vp.zs);
151 if (jp.isNull())
return jp;
153 for (
int k=0; k<jp.col; k++) {
154 int zp = k*jp.xs*jp.ys;
155 for (
int j=0; j<jp.ys; j++) {
156 int yp = zp + j*jp.xs;
157 for (
int i=0; i<jp.xs; i++) {
158 jp.point(i, j, k) = (JSAMPLE)vp.gp[yp + i];
#define JBXL_GRAPH_NODATA_ERROR
データが無い