int32_t cam_getFrameChirpFlags(const uint8_t &type, const uint16_t &xOffset, const uint16_t &yOffset, const uint16_t &xWidth, const uint16_t &yWidth, Chirp *chirp, uint8_t renderFlags) { int32_t result, len; uint8_t *frame = (uint8_t *)SRAM1_LOC; // fill buffer contents manually for return data len = Chirp::serialize(chirp, frame, SRAM1_SIZE, HTYPE(FOURCC('B','A','8','1')), HINT8(renderFlags), UINT16(xWidth), UINT16(yWidth), UINTS8_NO_COPY(xWidth*yWidth), END); // write frame after chirp args result = cam_getFrame(frame+len, SRAM1_SIZE-len, type, xOffset, yOffset, xWidth, yWidth); // tell chirp to use this buffer chirp->useBuffer(frame, len+xWidth*yWidth); return result; }
void sendCustom(uint8_t renderFlags=RENDER_FLAG_FLUSH) { int32_t len; uint8_t *frame = (uint8_t *)SRAM1_LOC; uint32_t fcc; // fill buffer contents manually for return data len = Chirp::serialize(g_chirpUsb, frame, SRAM1_SIZE, HTYPE(FOURCC('B','A','8','1')), HINT8(renderFlags), UINT16(CAM_RES2_WIDTH), UINT16(CAM_RES2_HEIGHT), UINTS8_NO_COPY(CAM_RES2_WIDTH*CAM_RES2_HEIGHT), END); // write frame after chirp args cam_getFrame(frame+len, SRAM1_SIZE-len, CAM_GRAB_M1R2, 0, 0, CAM_RES2_WIDTH, CAM_RES2_HEIGHT); //convolutionImage(CAM_RES2_WIDTH, CAM_RES2_HEIGHT, len, frame, true); //inverceImage(CAM_RES2_WIDTH, CAM_RES2_HEIGHT, len, frame); // tell chirp to use this buffer g_chirpUsb->useBuffer(frame, len+CAM_RES2_WIDTH*CAM_RES2_HEIGHT); // if (g_execArg==1) // { // cprintf("g_execArg==1"); // // fill buffer contents manually for return data // len = Chirp::serialize(g_chirpUsb, frame, SRAM1_SIZE, HTYPE(FOURCC('C','M','V','2')), HINT8(renderFlags), UINT16(CAM_RES2_WIDTH), UINT16(CAM_RES2_HEIGHT), UINTS8_NO_COPY(CAM_RES2_WIDTH*CAM_RES2_HEIGHT), END); // // write frame after chirp args // cam_getFrame(frame+len, SRAM1_SIZE-len, CAM_GRAB_M1R2, 0, 0, CAM_RES2_WIDTH, CAM_RES2_HEIGHT); // //inverceImage(CAM_RES2_WIDTH, CAM_RES2_HEIGHT, len, frame); // // tell chirp to use this buffer // g_chirpUsb->useBuffer(frame, len+CAM_RES2_WIDTH*CAM_RES2_HEIGHT); // } // else if (100<=g_execArg && g_execArg<200) // { // cprintf("100<=g_execArg && g_execArg<200"); // fcc = FOURCC('E','X',(g_execArg%100)/10 + '0', (g_execArg%10) + '0'); // len = Chirp::serialize(g_chirpUsb, frame, SRAM1_SIZE, HTYPE(fcc), HINT8(renderFlags), UINT16(CAM_RES2_WIDTH), UINT16(CAM_RES2_HEIGHT), UINTS8_NO_COPY(CAM_RES2_WIDTH*CAM_RES2_HEIGHT), END); // // write frame after chirp args // cam_getFrame(frame+len, SRAM1_SIZE-len, CAM_GRAB_M1R2, 0, 0, CAM_RES2_WIDTH, CAM_RES2_HEIGHT); // //inverceImage(CAM_RES2_WIDTH, CAM_RES2_HEIGHT, len, frame); // // tell chirp to use this buffer // g_chirpUsb->useBuffer(frame, len+CAM_RES2_WIDTH*CAM_RES2_HEIGHT); // } // else // { // cprintf("sendCustom else"); // cam_getFrameChirp(CAM_GRAB_M1R2, 0, 0, CAM_RES2_WIDTH, CAM_RES2_HEIGHT, g_chirpUsb); // } }