1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
/* gap_frame_fetcher.h
*
*
* The FrameFetcher provides access to frames both from imagefiles and videofiles.
*
* It holds a global image cache of temporary gimp images intended for
* read only access in various gimp-gap render processings.
*
* There are methods to get the temporary image
* or to get a duplicate that has only one layer at imagesize.
* (merged or picked via desired stackposition)
*
* For videofiles it holds a cache of open videofile handles.
* (note that caching of videoframes is already available in the videohandle)
*
*
* Copyright (C) 2008 Wolfgang Hofer <hof@gimp.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _GAP_FRAME_FETCHER_H
#define _GAP_FRAME_FETCHER_H
#include "libgimp/gimp.h"
#ifdef GAP_ENABLE_VIDEOAPI_SUPPORT
#include "gap_vid_api.h"
#else
#ifndef GAP_STUBTYPE_GVA_HANDLE
typedef gpointer t_GVA_Handle;
#define GAP_STUBTYPE_GVA_HANDLE
#endif
#endif
/* -------------------------------------------------
* gap_frame_fetch_register_user
* -------------------------------------------------
* register for using the frame fetcher resource.
* returns a unique resource user id.
*/
gint32
gap_frame_fetch_register_user(const char *caller_name);
/* -------------------------------------------------
* gap_frame_fetch_unregister_user
* -------------------------------------------------
* unregister the specified resource user id.
+ (if there are still registered resource users
* cached images and videohandles are kept.
* until the last resource user calls this procedure.
* if there are no more registered users all
* cached resources and duplicates are dropped)
*/
void
gap_frame_fetch_unregister_user(gint32 user_id);
/* -------------------------------------------------
* gap_frame_fetch_drop_resources
* -------------------------------------------------
* drop all cached resources
* (regardless if there are still resource users registrated)
*/
void
gap_frame_fetch_drop_resources();
/* -------------------------------------------------
* gap_frame_fetch_delete_list_of_duplicated_images
* -------------------------------------------------
* deletes all duplicate imageas that wre created by the specified ffetch_user_id
* (if ffetch_user_id -1 is specified delte all duplicated images)
*/
void
gap_frame_fetch_delete_list_of_duplicated_images(gint32 ffetch_user_id);
/* ----------------------------
* gap_frame_fetch_orig_image
* ----------------------------
* returns image_id of the original cached image.
* RESTRICTION: the Caller must NOT not modify that image and shall not open a display for it!
*/
gint32
gap_frame_fetch_orig_image(gint32 ffetch_user_id
,const char *filename /* full filename of the image */
,gboolean addToCache /* enable caching */
);
/* ----------------------------
* gap_frame_fetch_dup_image
* ----------------------------
* returns merged or selected layer_id
* (that is the only visible layer in temporary created scratch image)
* the caller is resonsible to delete the scratch image when processing is done.
* this can be done by calling gap_frame_fetch_delete_list_of_duplicated_images()
*/
gint32
gap_frame_fetch_dup_image(gint32 ffetch_user_id
,const char *filename /* full filename of the image (already contains framenr) */
,gint32 stackpos /* 0 pick layer on top of stack, -1 merge visible layers */
,gboolean addToCache /* enable caching */
);
/* ----------------------------
* gap_frame_fetch_dup_video
* ----------------------------
* returns the fetched video frame as gimp layer_id.
* the returned layer id is (the only layer) in a temporary image.
* note the caller is responsible to delete that temporary image after processing is done.
* this can be done by calling gap_frame_fetch_delete_list_of_duplicated_images()
*/
gint32
gap_frame_fetch_dup_video(gint32 ffetch_user_id
,const char *filename /* full filename of a video */
,gint32 framenr /* frame within the video (starting at 1) */
,gint32 seltrack /* videotrack */
,const char *preferred_decoder
);
#endif
|