44 #define XRES 320 // Image X resolution
45 #define YRES 240 // Image Y resolution
46 #define TXRES 16 // Tile X resolution
47 #define TYRES 16 // Tile Y resolution
61 #define NPLANES (sizeof(thePlanes)/sizeof(PlaneDef))
68 for (
int i = 0; i <
NPLANES; i++)
70 int words = pixels * IMGvectorSize(thePlanes[i].myColorModel);
71 bytes += words * IMGbyteSize(thePlanes[i].myFormat);
74 void *tdata = ::malloc(bytes);
75 char *
ptr = (
char *)tdata;
76 for (
int i = 0; i <
NPLANES; i++)
78 unsigned short *sdata;
83 int words = pixels * IMGvectorSize(thePlanes[i].myColorModel);
85 cdata = (
unsigned char *)ptr;
86 sdata = (
unsigned short *)ptr;
87 idata = (
unsigned int *)ptr;
91 for (
int c = 0;
c < words;
c++)
93 switch (thePlanes[i].myFormat)
97 case IMG_UINT: *idata++ = 0x84123456;
break;
98 default: *fdata++ = 0.763;
102 ptr += words*IMGbyteSize(thePlanes[i].myFormat);
111 const char *colon = strchr(hostname,
':');
114 int len = colon - hostname;
132 for (
int i = 0; i <
NPLANES; i++)
137 0, thePlanes[i].myFormat, thePlanes[i].myColorModel);
152 ::fprintf(stderr,
"Error opening tile device\n");
158 writeTile(
IMG_TileDevice *dev,
void *tdata,
int tx0,
int tx1,
int ty0,
int ty1)
160 if (!dev->
writeTile(tdata, tx0, tx1, ty0, ty1))
162 ::fprintf(stderr,
"Error writing data: %d %d %d %d\n",
190 splitHostPort(host, port, args.
argp(
's'));
194 sendPlaneDefinitions(dev, host, port);
196 void *tdata = buildTiles();
199 ::writeTile(dev, tdata,
void append(IMG_TileOptions *opt)
static IMG_TileDevice * newDevice(const char *filename, const UT_Options *options=NULL)
void fprintf(FILE *file, const char *fmt, const Args &...args)
virtual int openMulti(IMG_TileOptionList &flist, int xres, int yres, int tile_width, int tile_height, fpreal aspect)
void stripOptions(const char *options)
static void setMPlayDevCreator(IMG_TileDevice *(*creator)(int))
void setPlaneInfo(const UT_StringHolder &filename, const UT_StringHolder &channel, const UT_StringHolder &format, IMG_DataType dtype=IMG_DT_ANY, IMG_ColorModel cmodel=IMG_CM_ANY, IMG_TypeInfo tinfo=IMG_TI_COLOR)
void harden()
Take shallow copy and make it deep.
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const void * pixels
virtual int writeTile(const void *data, unsigned x0, unsigned x1, unsigned y0, unsigned y1)=0
const char * argp(int opt, int which=0) const
void initialize(int argc, const char *const argv[])
int main(int argc, char *argv[])
IMG_ColorModel myColorModel
void setFormatOption(const char *token, const char *value)