2009-01-13 01:45:06 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
main.c
|
|
|
|
|
|
|
|
(c) 2008 Benoît Minisini <gambas@users.sourceforge.net>
|
|
|
|
|
|
|
|
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 1, 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., 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-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-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-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()
|
|
|
|
{
|
|
|
|
}
|