00001
00020 #include "mfcpch.h"
00021 #include "grphshm.h"
00022 #include "showim.h"
00023
00024 void (*show_func) (IMAGE *, INT32, INT32, INT32, INT32, WINDOW, INT32,
00025 INT32) = def_show_sub_image;
00026
00030 DLLSYM void def_show_sub_image(
00031 IMAGE *source,
00032 INT32 xstart,
00033 INT32 ystart,
00034 INT32 xext,
00035 INT32 yext,
00036 WINDOW win,
00037 INT32 xpos,
00038 INT32 ypos
00039 ) {
00040 EIGHTOP *newop;
00041 INT32 y;
00042 INT32 linelength;
00043 IMAGE dummyimage;
00044 IMAGEOP *sendline;
00045 INT32 structsize;
00046 INT32 destbpp;
00047
00048 destbpp = source->get_bpp ();
00049
00050 newop = (EIGHTOP *) getshm (sizeof (EIGHTOP));
00051 if (newop != NULL) {
00052
00053 newop->header.fd = win->get_fd ();
00054 newop->type = SHOWIMAGE;
00055 newop->param.p[0].i = xext;
00056 newop->param.p[1].i = yext;
00057 newop->param.p[2].i = destbpp;
00058 newop->param.p[3].i = xpos;
00059 newop->param.p[4].i = ypos;
00060
00061
00062 linelength = COMPUTE_IMAGE_XDIM (xext, destbpp);
00063 linelength++;
00064 linelength &= ~1;
00065
00066 structsize = (INT32) (sizeof (IMAGEOP) + linelength - 2);
00067 for (y = yext - 1; y >= 0; --y) {
00068
00069 sendline = (IMAGEOP *) getshm (structsize);
00070 if (sendline != NULL) {
00071 sendline->header.fd = win->get_fd ();
00072 sendline->type = SHOWLINE;
00073 sendline->size = structsize;
00074 dummyimage.capture (sendline->line, xext, 1, (INT8) destbpp);
00075
00076
00077 copy_sub_image (source, xstart, ystart + y, xext, 1, &dummyimage, 0, 0, FALSE);
00078 }
00079 }
00080 }
00081 }