Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/exf1Opencv.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#define EXF1API_WITH_OPENCV
#include "exf1api.h"
#include <highgui.h>
2 changes: 2 additions & 0 deletions src/exf1api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ static const char * const cdjpeg_message_table[] = {
NULL
};

#ifdef EXF1API_WITH_OPENCV
void exf1api::getCameraFrame(IplImage* frame)
{
char jpgImage[3*IMG_BUF_SIZE];
Expand Down Expand Up @@ -392,6 +393,7 @@ void exf1api::getCameraFrame(IplImage* frame)
else
printf("JPG size is negative!\n");
}
#endif // EXF1API_WITH_OPENCV

void exf1api::terminateCamera(void)
{
Expand Down
8 changes: 6 additions & 2 deletions src/exf1api.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
#define EXF1API_H

#include "libexf1.h"
#ifdef EXF1API_WITH_OPENCV
#define CV_NO_BACKWARD_COMPATIBILITY
#include <cv.h>
#include <ctype.h>
#include <jpeglib.h>
#endif // EXF1API_WITH_OPENCV
#include <ctype.h>
//#include <cderror.h>

#define JMESSAGE(code,string) string ,
Expand Down Expand Up @@ -57,7 +59,9 @@ class exf1api {
void focus(char focusIn, char continousFocus);

int grapPcMonitorFrame(const char *jpgImage);
void getCameraFrame(IplImage* frame);
#ifdef EXF1API_WITH_OPENCV
void getCameraFrame(IplImage* frame);
#endif
void exitCamera(void);

libexf1 lib;
Expand Down
2 changes: 1 addition & 1 deletion src/exf1ctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char** argv)
{
printf("> ");

gets(input);
fgets(input, 64, stdin);
sscanf(input, "%c", &com);

switch (com) {
Expand Down
4 changes: 2 additions & 2 deletions src/libexf1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void libexf1::exf1Cmd(WORD cmd, ...)
case CMD_GET_OBJECT:
wordVal = va_arg(ap, int); // File/memory destination.
dwordVal = va_arg(ap, int); // objectHandle
pString = (char *) va_arg(ap, int); //
pString = va_arg(ap, char *); //

switch (wordVal) {
case TO_FILE:
Expand All @@ -170,7 +170,7 @@ void libexf1::exf1Cmd(WORD cmd, ...)
usbRx();
break;
case TO_MEM:
pInt = (int *) va_arg(ap, int); //
pInt = va_arg(ap, int *); //
do {
usbTx(cmd, TYPE_CMD, sizeof(DWORD), dwordVal, 0);
usbRxToMem(pString, pInt);
Expand Down