This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 6793b01905a9072059080e70fa79c685e43a945c (commit) from 156709b6343ea54485a3d662ddc66448e3337c76 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/6793b01905a9072059080e70fa79c685e43a9...
commit 6793b01905a9072059080e70fa79c685e43a945c Author: Cyril Hrubis metan@ucw.cz Date: Tue Nov 6 19:54:09 2012 +0100
loaders: Add forgotten header, ouch.
I will not forgot to add the headers. I will not forgot to add the headers. I will not forgot to add the headers. I will not forgot to add the headers.
diff --git a/include/loaders/GP_Loader.h b/include/loaders/GP_Loader.h new file mode 100644 index 0000000..a5ef06b --- /dev/null +++ b/include/loaders/GP_Loader.h @@ -0,0 +1,109 @@ +/***************************************************************************** + * This file is part of gfxprim library. * + * * + * Gfxprim is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * Gfxprim 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 * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with gfxprim; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, * + * Boston, MA 02110-1301 USA * + * * + * Copyright (C) 2009-2012 Cyril Hrubis metan@ucw.cz * + * * + *****************************************************************************/ + + /* + + Core include file for loaders API. + + */ + +#ifndef LOADERS_GP_LOADER_H +#define LOADERS_GP_LOADER_H + +#include "core/GP_Context.h" +#include "core/GP_ProgressCallback.h" + +#include "GP_MetaData.h" + +/* + * Tries to load image accordingly to the file extension. + * + * If operation fails NULL is returned and errno is filled. + */ +GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback); + +/* + * Loads image Meta Data (if possible). + */ +int GP_LoadMetaData(const char *src_path, GP_MetaData *data); + +/* + * Simple saving function, the image format is matched by file extension. + * + * Retruns zero on succes. + * + * On failure non-zero is returned. + * + * When file type wasn't recognized by extension or if support for requested + * image format wasn't compiled in non-zero is returned and errno is set to + * ENOSYS. + * + * The resulting errno may also be set to any possible error from fopen(3), open(3), + * write(3), fwrite(3), seek(3), etc.. + */ +int GP_SaveImage(const GP_Context *src, const char *dst_path, + GP_ProgressCallback *callback); + +/* + * You can register your own loader here. + */ +typedef struct GP_Loader { + /* + * Loads an image. + * + * Returns allocated and initialized bitmap on success, NULL on failure + * and errno must be set. + */ + GP_Context *(*Load)(const char *src_path, GP_ProgressCallback *callback); + + /* + * Save an image. + * + * Returns zero on succes, non-zero on failure and errno must be set. + */ + int (*Save)(const GP_Context *src, const char *dst_path, GP_ProgressCallback *callback); + + /* + * The buffer is filled with 32 bytes from an image start, returns 1 if + * image signature was found zero otherwise. + */ + int (*Match)(const void *buf); + + /* + * Short format name. + */ + const char *fmt_name; + + /* don't touch */ + struct GP_Loader *next; + + /* + * NULL terminated array of file extensions. + */ + const char *extensions[]; +} GP_Loader; + +void GP_LoaderRegister(GP_Loader *self); + +void GP_LoaderUnregister(GP_Loader *self); + +#endif /* LOADERS_GP_LOADER_H */
-----------------------------------------------------------------------
Summary of changes: include/loaders/GP_Loader.h | 109 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 include/loaders/GP_Loader.h
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.