Hey,
here's some stuff I found. Doesn't work in LV though, as Canon locks the resources it needs (see ResLock stuff thread).
The following is by no means complete:
There's quite a list of things you can do:
All the functions above result in a call to the specified callback with the specified value as the first and an error code (0 meaning success) as the second parameter. They immediately return with the return value being an image play driver handle that needs to be deleted _after the operation finishes_ using
The uninit functions can also be called from the callback, but Canon code usually uses a semaphore to wait after calling the Execute* function (GiveSemaphore in the callback, TakeSemaphore after the function call).
I only checked ExecuteJpegDecoding/ExecuteJpegAnalysis and ExecuteJpegEncoding so far. The parameters should be something like that:
Feel free to try around and fill in the gaps.
here's some stuff I found. Doesn't work in LV though, as Canon locks the resources it needs (see ResLock stuff thread).
The following is by no means complete:
Code Select
// start image player (driver only)
// there's also StartImagePlayer(...)
StartImpDrvOnly();
// start image play driver, returns handle
void *img_play_driver_handle = StartImagePlayDriver();
// do something with it
void *handle = Execute.....(img_play_driver_handle, params, cb, cb_priv);
wait for Execute... to finish, i.e. using a semaphore
// delete handle
DeleteImagePlayDriverHandle(handle);
// stop image play driver by handle
StopImagePlayDriver(img_play_driver_handle);
// stop image player
StopImagePlayer();
There's quite a list of things you can do:
- void *ExecuteJpegAnalysis(void *img_play_driver_handle, struct jpeg_decode_params, void (jpeg_decode_cb)(void *cb_priv, int err), void *cb_priv);
Analyze (as in decode, but return meta data only) a JPEG - void *ExecuteJpegDecoding(void *img_play_driver_handle, struct jpeg_decode_params, void (jpeg_decode_cb)(void *cb_priv, int err), void *cb_priv);
Decode a JPEG - void *ExecuteYuvResizing(void *img_play_driver_handle, struct yuv_resize_params, void (yuv_resize_cb)(void *cb_priv, int err), void *cb_priv);
Resize YUV buffer - void *ExecuteYuvRotating(void *img_play_driver_handle, struct yuv_rorate_params, void (yuv_rorate_cb)(void *cb_priv, int err), void *cb_priv);
Rotate YUV buffer - void *ExecuteLowPassFilter(void *img_play_driver_handle, struct lpf_params, void (lpf_cb)(void *cb_priv, int err), void *cb_priv);
Some low pass filter? - void *ExecuteRectangleCopy(void *img_play_driver_handle, struct rect_copy_params, void (rect_copy_cb)(void *cb_priv, int err), void *cb_priv);
Rect to rect copying - void *ExecuteRectangleColoring(void *img_play_driver_handlestruct rect_color_params, void (rect_color_cb)(void *cb_priv, int err), void *cb_priv);
Guess what ;-) - void *ExecuteJpegEncoding(void *img_play_driver_handle, struct jpeg_encode_params, void (jpeg_encode_cb)(void *cb_priv, int err), void *cb_priv);
Encode jpeg
All the functions above result in a call to the specified callback with the specified value as the first and an error code (0 meaning success) as the second parameter. They immediately return with the return value being an image play driver handle that needs to be deleted _after the operation finishes_ using
Code Select
DeleteImagePlayDriverHandle(void *handle);
The uninit functions can also be called from the callback, but Canon code usually uses a semaphore to wait after calling the Execute* function (GiveSemaphore in the callback, TakeSemaphore after the function call).
I only checked ExecuteJpegDecoding/ExecuteJpegAnalysis and ExecuteJpegEncoding so far. The parameters should be something like that:
Code Select
struct jpeg_decode_params
{
struct memSuite *in_suite; // needed!
unsigned int in_size; // needed!
int unknown_1;
int unknown_2;
int unknown_3;
int out_addr; // address of output
int out_size; // size of buffer for output?
int x;
int y;
int width;
int height;
int Pfil;
int PreRes;
int xxa;
int xxb;
int xya;
int xyb;
};
struct jpeg_encode_params
{
int yuv_maybe; // always 1?
void *baseAdd; // address in memory
unsigned int baseW;
int x;
int y;
int width;
int height;
int Pfil; // 1
int PreRes; // 1
int xxa; // 8
int xya; // 8
int jpgAdd; // allocated buffer for output
unsigned int maxSize; // size in output buffer
int unknown; // 2
int Qscal; // 2
unsigned int *size; // used to return real size, must not be NULL
};
Feel free to try around and fill in the gaps.