2009-01-13 01:45:06 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
main.c
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
(c) 2000-2009 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
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#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-01-27 14:39:38 +01:00
|
|
|
CColorInfoDesc,
|
|
|
|
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
|
|
|
|
2009-01-17 00:12:10 +01:00
|
|
|
GB.New(POINTER(&image), GB.FindClass("Image"), NULL, NULL);
|
|
|
|
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,
|
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-01-13 01:45:06 +01:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
int EXPORT GB_INIT(void)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EXPORT GB_EXIT()
|
|
|
|
{
|
|
|
|
}
|