// Allocate defaults. MappAllocDefault(M_SETUP, &MilApplication, &MilSystem, &MilDisplay, &MilDigitizer, M_NULL); SizeBand = MdigInquire(MilDigitizer, M_SIZE_BAND, M_NULL); SizeX = MdigInquire(MilDigitizer, M_SIZE_X, M_NULL); SizeY = MdigInquire(MilDigitizer, M_SIZE_Y, M_NULL); // Allocate and select a display buffer. MbufAllocColor(MilSystem, SizeBand, SizeX, SizeY, 8L+M_UNSIGNED, M_IMAGE + M_DISP + M_NON_PAGED, &MilImageDisp); MbufClear(MilImageDisp, M_BLACK); MdispSelect(MilDisplay, MilImageDisp); // Allocate grab buffers in Host memory. for(i = 0; i < 2; i++) MbufAllocColor(MilSystem, SizeBand, SizeX, SizeY, 8L+M_UNSIGNED, M_IMAGE + M_GRAB, &MilImage[i]); // Allocate grab buffers in on-board memory. for(i = 0; i < 2; i++) MbufAllocColor(MilSystem, SizeBand, SizeX, SizeY, 8L+M_UNSIGNED, M_IMAGE + M_GRAB + M_ON_BOARD, &MilImageOnBoard[i]); // Allocate JPEG2000 buffer. MbufAllocColor(MilSystem, SizeBand, SizeX, SizeY, 8L+M_UNSIGNED, M_IMAGE + M_COMPRESS + M_JPEG2000_LOSSY, &MilImageCompress); while(!kbhit()) { // Grab in to on-board memory. MdigGrab(MilDigitizer, MilImageOnBoard[0]); // Compress the buffer. MbufCopy(MilImageOnBoard[0], MilImageCompress); // Decompresses the buffer to the display. MbufCopy(MilImageCompress, MilImageDisp); }