diff options
author | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2016-01-12 21:01:30 +0100 |
---|---|---|
committer | Dmitrij D. Czarkoff <czarkoff@gmail.com> | 2016-01-14 21:43:36 +0100 |
commit | ecca345f3ea63dfe85759311cea90227bdc4384a (patch) | |
tree | 2a5f7a633454f870135e3391d46526266f36b43d /src/loader.h | |
parent | de41f9854ec827c5cfe89cc44c644e4c38a6faa0 (diff) | |
download | imv-ecca345f3ea63dfe85759311cea90227bdc4384a.tar.gz |
Loading image data from standard input
This commit changes processing of arguments:
* When called without arguments (with or without flags), imv reads list of files
from standard input.
* When called with "-" among arguments, read image data from standard input.
Diffstat (limited to 'src/loader.h')
-rw-r--r-- | src/loader.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/loader.h b/src/loader.h index 65c8689..6e20349 100644 --- a/src/loader.h +++ b/src/loader.h @@ -28,6 +28,9 @@ struct imv_loader { pthread_mutex_t lock; pthread_t bg_thread; char *path; + BYTE *buffer; + size_t buffer_size; + FIMEMORY *fi_buffer; FIBITMAP *out_bmp; int out_is_new_image; char *out_err; @@ -48,7 +51,8 @@ void imv_init_loader(struct imv_loader *img); void imv_destroy_loader(struct imv_loader *img); /* Asynchronously load the given file */ -void imv_loader_load_path(struct imv_loader *ldr, const char *path); +void imv_loader_load(struct imv_loader *ldr, const char *path, + const void *buffer, const size_t buffer_size); /* Returns 1 if image data is available. 0 if not. Caller is responsible for * cleaning up the data returned. Each image is only returned once. |