Blame toonz/sources/image/compatibility/tnz4_cpp.cpp
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
extern "C" {
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tnz4.h"
|
|
Toshihiro Shimizu |
890ddd |
#include <memory.h></memory.h>
|
|
Toshihiro Shimizu |
890ddd |
#include <stdio.h></stdio.h>
|
|
Toshihiro Shimizu |
890ddd |
#include <sys types.h=""></sys>
|
|
Toshihiro Shimizu |
890ddd |
#include <sys stat.h=""></sys>
|
|
Shinya Kitaoka |
9f5a1b |
#ifndef _WIN32
|
|
Toshihiro Shimizu |
890ddd |
#include <unistd.h></unistd.h>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void free_img(IMAGE *img) {
|
|
Shinya Kitaoka |
120a6e |
if (!img) return;
|
|
Shinya Kitaoka |
120a6e |
delete[] img->buffer;
|
|
Shinya Kitaoka |
120a6e |
delete img;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
IMAGE *new_img() {
|
|
Shinya Kitaoka |
120a6e |
IMAGE *img = new IMAGE;
|
|
Shinya Kitaoka |
120a6e |
memset(img, 0, sizeof(IMAGE));
|
|
Shinya Kitaoka |
120a6e |
return img;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int allocate_pixmap(IMAGE *img, int w, int h) {
|
|
Shinya Kitaoka |
120a6e |
UCHAR *buf;
|
|
Shinya Kitaoka |
120a6e |
assert(img->type == TOONZRGB);
|
|
Shinya Kitaoka |
120a6e |
buf = new UCHAR[w * h * 4];
|
|
Shinya Kitaoka |
120a6e |
img->buffer = buf;
|
|
Shinya Kitaoka |
120a6e |
img->xSBsize = img->xsize = w;
|
|
Shinya Kitaoka |
120a6e |
img->ySBsize = img->ysize = h;
|
|
Shinya Kitaoka |
120a6e |
return TRUE;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|