2009-01-13 01:45:06 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
main.c
|
|
|
|
|
2011-12-31 03:39:20 +01:00
|
|
|
(c) 2000-2012 Benoît Minisini <gambas@users.sourceforge.net>
|
2009-01-13 01:45:06 +01:00
|
|
|
|
|
|
|
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
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2009-01-13 01:45:06 +01:00
|
|
|
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
|
2009-08-17 12:41:51 +02:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2009-01-13 01:45:06 +01:00
|
|
|
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
|
2011-06-03 02:51:09 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
2011-12-31 03:39:20 +01:00
|
|
|
MA 02110-1301, USA.
|
2009-01-13 01:45:06 +01:00
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#define __MAIN_C
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2009-01-17 00:12:10 +01:00
|
|
|
#include "CImage.h"
|
2009-01-13 01:45:06 +01:00
|
|
|
#include "CImageStat.h"
|
2009-01-27 14:39:38 +01:00
|
|
|
#include "c_color.h"
|
2009-01-17 00:12:10 +01:00
|
|
|
#include "image.h"
|
2009-01-13 01:45:06 +01:00
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
GB_INTERFACE GB EXPORT;
|
|
|
|
|
|
|
|
|
2009-01-17 00:12:10 +01:00
|
|
|
GB_DESC *GB_CLASSES[] EXPORT =
|
2009-01-13 01:45:06 +01:00
|
|
|
{
|
2009-09-06 11:25:18 +02:00
|
|
|
CColorInfoDesc,
|
2009-01-27 14:39:38 +01:00
|
|
|
CColorDesc,
|
2009-01-17 00:12:10 +01:00
|
|
|
CImageDesc,
|
|
|
|
CImageStatDesc,
|
|
|
|
NULL
|
|
|
|
};
|
2009-01-13 01:45:06 +01:00
|
|
|
|
2009-01-17 00:12:10 +01:00
|
|
|
static GB_IMG *create_image(int width, int height, int format, unsigned char *data)
|
2009-01-13 01:45:06 +01:00
|
|
|
{
|
2009-01-17 00:12:10 +01:00
|
|
|
CIMAGE *image;
|
2009-01-13 01:45:06 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
image = GB.New(GB.FindClass("Image"), NULL, NULL);
|
2009-01-17 00:12:10 +01:00
|
|
|
IMAGE_create_with_data(&image->image, width, height, format, data);
|
|
|
|
return (GB_IMG *)image;
|
2009-01-13 01:45:06 +01:00
|
|
|
}
|
|
|
|
|
2009-01-17 00:12:10 +01:00
|
|
|
void *GB_IMAGE_1[] EXPORT =
|
2009-01-13 01:45:06 +01:00
|
|
|
{
|
2009-01-17 00:12:10 +01:00
|
|
|
(void *)IMAGE_INTERFACE_VERSION,
|
|
|
|
(void *)create_image,
|
|
|
|
(void *)IMAGE_take,
|
|
|
|
(void *)IMAGE_check,
|
2010-06-19 14:38:28 +02:00
|
|
|
(void *)IMAGE_synchronize,
|
2009-01-21 02:25:13 +01:00
|
|
|
(void *)IMAGE_size,
|
|
|
|
(void *)IMAGE_set_default_format,
|
2009-08-25 23:54:26 +02:00
|
|
|
(void *)IMAGE_get_default_format,
|
2009-01-25 23:23:04 +01:00
|
|
|
(void *)IMAGE_get_pixel,
|
2009-01-27 02:24:19 +01:00
|
|
|
(void *)IMAGE_convert,
|
2009-09-01 11:29:40 +02:00
|
|
|
(void *)COLOR_merge,
|
|
|
|
(void *)COLOR_lighter,
|
|
|
|
(void *)COLOR_darker,
|
2012-12-08 03:17:49 +01:00
|
|
|
(void *)IMAGE_format_to_string,
|
2009-01-13 01:45:06 +01:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
int EXPORT GB_INIT(void)
|
|
|
|
{
|
2010-01-10 14:40:48 +01:00
|
|
|
return 0;
|
2009-01-13 01:45:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void EXPORT GB_EXIT()
|
|
|
|
{
|
|
|
|
}
|