diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 17:43:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 17:43:19 +0000 |
commit | 0292059f4a16434600564cfa3f0ad2309a508a54 (patch) | |
tree | d95953cd53011917c4df679b96aedca39401b54f /kernel/include | |
download | libksquirrel-0292059f4a16434600564cfa3f0ad2309a508a54.tar.gz libksquirrel-0292059f4a16434600564cfa3f0ad2309a508a54.zip |
Added libksquirrel for KDE3
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/libksquirrel@1095624 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kernel/include')
51 files changed, 2626 insertions, 0 deletions
diff --git a/kernel/include/fmt_codec_avs.h b/kernel/include/fmt_codec_avs.h new file mode 100644 index 0000000..8bc4f9f --- /dev/null +++ b/kernel/include/fmt_codec_avs.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_avs_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_avs_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + private: + // define variables you need here +}; + +#endif diff --git a/kernel/include/fmt_codec_bmp.h b/kernel/include/fmt_codec_bmp.h new file mode 100644 index 0000000..e49f351 --- /dev/null +++ b/kernel/include/fmt_codec_bmp.h @@ -0,0 +1,46 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_BMP_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_BMP_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + private: + RGB pal[256]; + s32 pal_entr; + u16 filler; + BITMAPFILE_HEADER bfh; + BITMAPINFO_HEADER bih; + s32 m_FILLER; + BITMAPFILE_HEADER m_bfh; + BITMAPINFO_HEADER m_bih; +}; + +#endif diff --git a/kernel/include/fmt_codec_cd_func.h b/kernel/include/fmt_codec_cd_func.h new file mode 100644 index 0000000..da38f56 --- /dev/null +++ b/kernel/include/fmt_codec_cd_func.h @@ -0,0 +1,35 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_create_destroy_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_create_destroy_H + +extern "C" fmt_codec_base* codec_create() +{ + return (new fmt_codec); +} + +extern "C" void codec_destroy(fmt_codec_base *p) +{ + delete p; +} + +#endif diff --git a/kernel/include/fmt_codec_cut.h b/kernel/include/fmt_codec_cut.h new file mode 100644 index 0000000..df8f099 --- /dev/null +++ b/kernel/include/fmt_codec_cut.h @@ -0,0 +1,38 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_CUT_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_CUT_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + RGB pal[256]; + u8 *bits; +}; + +#endif diff --git a/kernel/include/fmt_codec_dds.h b/kernel/include/fmt_codec_dds.h new file mode 100644 index 0000000..6def2c5 --- /dev/null +++ b/kernel/include/fmt_codec_dds.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2007 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_dds_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_dds_H + +#include "dds.h" + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + DDSINFO dds; +}; + +#endif diff --git a/kernel/include/fmt_codec_fli.h b/kernel/include/fmt_codec_fli.h new file mode 100644 index 0000000..cea637c --- /dev/null +++ b/kernel/include/fmt_codec_fli.h @@ -0,0 +1,42 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_FLI_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_FLI_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + bool skip_flood(ifstreamK &s); + + private: + FLICHEADER flic; + RGB pal[768]; + u8 **buf; +}; + +#endif diff --git a/kernel/include/fmt_codec_gif.h b/kernel/include/fmt_codec_gif.h new file mode 100644 index 0000000..f04077b --- /dev/null +++ b/kernel/include/fmt_codec_gif.h @@ -0,0 +1,45 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_GIF_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_GIF_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + GifFileType *gif; + GifRecordType record; + GifByteType *Extension; + u8 *buf; + RGBA *saved; + s32 i, j, Error, Row, Col, Width, Height, lastRow, lastCol, lastWidth, lastHeight, ExtCode, Count, + transIndex, Lines_h, curLine, linesz, disposal, lastDisposal, currentImage, currentPass; + RGBA **Lines, back, **Last; + ColorMapObject *map; +}; + +#endif diff --git a/kernel/include/fmt_codec_hdr.h b/kernel/include/fmt_codec_hdr.h new file mode 100644 index 0000000..c6759ed --- /dev/null +++ b/kernel/include/fmt_codec_hdr.h @@ -0,0 +1,42 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_hdr_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_hdr_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + bool read_scan(u8 *s, const s32 w); + bool getHdrHead(); + + private: + u8 *scanline; + hdr_header hdr; +}; + +#endif diff --git a/kernel/include/fmt_codec_ico.h b/kernel/include/fmt_codec_ico.h new file mode 100644 index 0000000..73cbaa1 --- /dev/null +++ b/kernel/include/fmt_codec_ico.h @@ -0,0 +1,43 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_ICO_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_ICO_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u8 *bAND; + ICO_HEADER ifh; + ICO_DIRENTRY *ide; + BITMAPINFO_HEADER bih; + s32 pixel; + RGB pal[256]; + s32 pal_entr; +}; + +#endif diff --git a/kernel/include/fmt_codec_iff.h b/kernel/include/fmt_codec_iff.h new file mode 100644 index 0000000..62012f9 --- /dev/null +++ b/kernel/include/fmt_codec_iff.h @@ -0,0 +1,41 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_IFF_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_IFF_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + RGB *pal; + s32 pal_entr; + CHUNK_BMHD bmhd; + u8 **tile; + u8 *dline; +}; + +#endif diff --git a/kernel/include/fmt_codec_jbig.h b/kernel/include/fmt_codec_jbig.h new file mode 100644 index 0000000..d2429bd --- /dev/null +++ b/kernel/include/fmt_codec_jbig.h @@ -0,0 +1,34 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_jbig_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_jbig_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS +}; + +#endif diff --git a/kernel/include/fmt_codec_jpeg.h b/kernel/include/fmt_codec_jpeg.h new file mode 100644 index 0000000..b54e7b9 --- /dev/null +++ b/kernel/include/fmt_codec_jpeg.h @@ -0,0 +1,48 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_JPEG_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_JPEG_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + private: + struct jpeg_decompress_struct cinfo; + struct my_error_mgr jerr; + JSAMPARRAY buffer; + FILE *fptr; + + FILE *m_fptr; + struct jpeg_compress_struct m_cinfo; + struct jpeg_error_mgr m_jerr; + JSAMPROW row_pointer; + bool zerror; +}; + +#endif diff --git a/kernel/include/fmt_codec_jpeg2000.h b/kernel/include/fmt_codec_jpeg2000.h new file mode 100644 index 0000000..23e9ac1 --- /dev/null +++ b/kernel/include/fmt_codec_jpeg2000.h @@ -0,0 +1,51 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_jpeg2000_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_jpeg2000_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +typedef struct +{ + jas_image_t *image; + s32 cmptlut[MAXCMPTS]; + jas_image_t *altimage; + jas_matrix_t *data[3]; + jas_seqent_t *d[3]; + +} gs_t; + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + bool convert_colorspace(); + + private: + gs_t gs; + jas_stream_t *in; +}; + +#endif diff --git a/kernel/include/fmt_codec_koala.h b/kernel/include/fmt_codec_koala.h new file mode 100644 index 0000000..24a55b4 --- /dev/null +++ b/kernel/include/fmt_codec_koala.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_koala_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_koala_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + koala_t koala; + u8 pixel_mask[4], pixel_displ[4], foundcolor; + s32 index, pixel, colorindex; +}; + +#endif diff --git a/kernel/include/fmt_codec_lif.h b/kernel/include/fmt_codec_lif.h new file mode 100644 index 0000000..489b057 --- /dev/null +++ b/kernel/include/fmt_codec_lif.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_lif_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_lif_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + RGBA pal[256]; + lif_header lif; + s32 bytes; +}; + +#endif diff --git a/kernel/include/fmt_codec_mac.h b/kernel/include/fmt_codec_mac.h new file mode 100644 index 0000000..f65dcaf --- /dev/null +++ b/kernel/include/fmt_codec_mac.h @@ -0,0 +1,37 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_mac_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_mac_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u8 bytes[72], byte[8]; +}; + +#endif diff --git a/kernel/include/fmt_codec_mdl.h b/kernel/include/fmt_codec_mdl.h new file mode 100644 index 0000000..c24134b --- /dev/null +++ b/kernel/include/fmt_codec_mdl.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_mdl_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_mdl_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + TEX_HEAD tex; + RGB pal[256]; + s32 numtex, texoff, texdataoff; + fstream::pos_type opos; +}; + +#endif diff --git a/kernel/include/fmt_codec_mng.h b/kernel/include/fmt_codec_mng.h new file mode 100644 index 0000000..ff4b546 --- /dev/null +++ b/kernel/include/fmt_codec_mng.h @@ -0,0 +1,51 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_mng_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_mng_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +struct mngstuff; + +struct _priv +{ + RGBA *frame; + int w, ms; + +}priv; + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + mngstuff *mymng; + mng_handle mng; + s32 total; + + public: + _priv priv; +}; + +#endif diff --git a/kernel/include/fmt_codec_msp.h b/kernel/include/fmt_codec_msp.h new file mode 100644 index 0000000..5ef6f7c --- /dev/null +++ b/kernel/include/fmt_codec_msp.h @@ -0,0 +1,41 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_msp_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_msp_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + msp_header msp; + std::vector<u16> scanmap; + s32 version; + u8 *bytes; + u8 byte[8]; +}; + +#endif diff --git a/kernel/include/fmt_codec_mtv.h b/kernel/include/fmt_codec_mtv.h new file mode 100644 index 0000000..77062a3 --- /dev/null +++ b/kernel/include/fmt_codec_mtv.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_mtv_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_mtv_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + private: + // define variables you need here +}; + +#endif diff --git a/kernel/include/fmt_codec_openexr.h b/kernel/include/fmt_codec_openexr.h new file mode 100644 index 0000000..a08e370 --- /dev/null +++ b/kernel/include/fmt_codec_openexr.h @@ -0,0 +1,45 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_openexr_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_openexr_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +#include <ImfRgbaFile.h> +#include <ImfArray.h> + +using namespace Imf; + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + Array2D<Rgba> *pixels; + std::string file, ref; + RgbaOutputFile *out; + Rgba *hs; +}; + +#endif diff --git a/kernel/include/fmt_codec_pcx.h b/kernel/include/fmt_codec_pcx.h new file mode 100644 index 0000000..4daedb6 --- /dev/null +++ b/kernel/include/fmt_codec_pcx.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_PCX_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_PCX_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + PCX_HEADER pfh; + s16 TotalBytesLine; + RGB pal[256]; + s32 pal_entr; +}; + +#endif diff --git a/kernel/include/fmt_codec_pix.h b/kernel/include/fmt_codec_pix.h new file mode 100644 index 0000000..58c23a1 --- /dev/null +++ b/kernel/include/fmt_codec_pix.h @@ -0,0 +1,34 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_PIX_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_PIX_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS +}; + +#endif diff --git a/kernel/include/fmt_codec_png.h b/kernel/include/fmt_codec_png.h new file mode 100644 index 0000000..2051187 --- /dev/null +++ b/kernel/include/fmt_codec_png.h @@ -0,0 +1,63 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_PNG_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_PNG_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + +#ifdef CODEC_ANOTHER + virtual void fill_default_settings(); +#endif + +#ifdef CODEC_PNG + WRITE_CODEC_DECLARATIONS +#endif + + private: + png_structp png_ptr; + png_infop info_ptr; + png_uint_32 width, height, number_passes; + s32 color_type; + png_bytep *cur, *prev, *frame; + FILE *fptr; + s32 bit_depth, interlace_type; + s32 frames; + fmt_image img; + + png_uint_32 next_frame_width, next_frame_height, next_frame_x_offset, next_frame_y_offset; + png_uint_16 next_frame_delay_num, next_frame_delay_den; + png_byte next_frame_dispose_op, next_frame_blend_op; + + FILE *m_fptr; + png_structp m_png_ptr; + png_infop m_info_ptr; + png_bytep m_row_pointer; + bool zerror, m_zerror; +}; + +#endif diff --git a/kernel/include/fmt_codec_pnm.h b/kernel/include/fmt_codec_pnm.h new file mode 100644 index 0000000..d2e9c60 --- /dev/null +++ b/kernel/include/fmt_codec_pnm.h @@ -0,0 +1,48 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_PNM_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_PNM_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + +#ifdef CODEC_ANOTHER + virtual void fill_default_settings(); +#endif + +#ifdef CODEC_PNM + WRITE_CODEC_DECLARATIONS +#endif + + private: + s32 pnm; + FILE *fptr; + s8 format[10]; + double koeff; +}; + +#endif diff --git a/kernel/include/fmt_codec_psd.h b/kernel/include/fmt_codec_psd.h new file mode 100644 index 0000000..94ee1f2 --- /dev/null +++ b/kernel/include/fmt_codec_psd.h @@ -0,0 +1,41 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_PSD_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_PSD_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u32 width, height; + u16 channels, depth, mode, compression; + RGBA **last; + u8 *L; + RGB pal[256]; +}; + +#endif diff --git a/kernel/include/fmt_codec_psp.h b/kernel/include/fmt_codec_psp.h new file mode 100644 index 0000000..730269b --- /dev/null +++ b/kernel/include/fmt_codec_psp.h @@ -0,0 +1,53 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_psp_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_psp_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + bool iGetPspHead(); + bool iCheckPsp(); + bool ReadGenAttributes(); + bool ParseChunks(); + bool ReadLayerBlock(); + bool ReadAlphaBlock(); + ILubyte *GetChannel(); + bool UncompRLE(ILubyte *CompData, ILubyte *Data, ILuint CompLen); + bool ReadPalette(); + + private: + GENATT_CHUNK AttChunk; + PSPHEAD Header; + ILuint NumChannels; + ILubyte **Channels; + ILubyte *Alpha; + RGBA *pal; +}; + +#endif diff --git a/kernel/include/fmt_codec_pxr.h b/kernel/include/fmt_codec_pxr.h new file mode 100644 index 0000000..af1a9a0 --- /dev/null +++ b/kernel/include/fmt_codec_pxr.h @@ -0,0 +1,34 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_pxr_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_pxr_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS +}; + +#endif diff --git a/kernel/include/fmt_codec_ras.h b/kernel/include/fmt_codec_ras.h new file mode 100644 index 0000000..6c60ab7 --- /dev/null +++ b/kernel/include/fmt_codec_ras.h @@ -0,0 +1,43 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_RAS_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_RAS_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + RGB pal[256]; + RAS_HEADER rfh; + bool rle, isRGB; + u16 fill; + u8 fillchar; + u16 linelength; + u8 *buf; +}; + +#endif diff --git a/kernel/include/fmt_codec_rawrgb.h b/kernel/include/fmt_codec_rawrgb.h new file mode 100644 index 0000000..db756e2 --- /dev/null +++ b/kernel/include/fmt_codec_rawrgb.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_rawrgb_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_rawrgb_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + private: + // define variables you need here +}; + +#endif + diff --git a/kernel/include/fmt_codec_sct.h b/kernel/include/fmt_codec_sct.h new file mode 100644 index 0000000..416a780 --- /dev/null +++ b/kernel/include/fmt_codec_sct.h @@ -0,0 +1,37 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_sct_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_sct_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + sct_header sct; +}; + +#endif diff --git a/kernel/include/fmt_codec_sgi.h b/kernel/include/fmt_codec_sgi.h new file mode 100644 index 0000000..ce65fb7 --- /dev/null +++ b/kernel/include/fmt_codec_sgi.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_SGI_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_SGI_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u32 *starttab, *lengthtab; + SGI_HEADER sfh; + s32 rle_row; + s8 *channel[4]; +}; + +#endif diff --git a/kernel/include/fmt_codec_sun.h b/kernel/include/fmt_codec_sun.h new file mode 100644 index 0000000..3fc730b --- /dev/null +++ b/kernel/include/fmt_codec_sun.h @@ -0,0 +1,38 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_sun_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_sun_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u32 validbits; +}; + +#endif + diff --git a/kernel/include/fmt_codec_tga.h b/kernel/include/fmt_codec_tga.h new file mode 100644 index 0000000..535d108 --- /dev/null +++ b/kernel/include/fmt_codec_tga.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_TGA_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_TGA_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + s32 pal_entr; + RGB pal[256]; + TGA_FILEHEADER tfh; + bool fliph; +}; + +#endif diff --git a/kernel/include/fmt_codec_tiff.h b/kernel/include/fmt_codec_tiff.h new file mode 100644 index 0000000..713a8d6 --- /dev/null +++ b/kernel/include/fmt_codec_tiff.h @@ -0,0 +1,46 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_TIFF_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_TIFF_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +#include <map> + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + WRITE_CODEC_DECLARATIONS + + void fill_default_settings(); + + private: + TIFF *ftiff, *out; + TIFFRGBAImage img; + s32 dircount, line, pages; + std::map<s32, std::string> compr; +}; + +#endif diff --git a/kernel/include/fmt_codec_ttf.h b/kernel/include/fmt_codec_ttf.h new file mode 100644 index 0000000..d97df91 --- /dev/null +++ b/kernel/include/fmt_codec_ttf.h @@ -0,0 +1,34 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_ttf_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_ttf_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS +}; + +#endif diff --git a/kernel/include/fmt_codec_utah.h b/kernel/include/fmt_codec_utah.h new file mode 100644 index 0000000..5076afb --- /dev/null +++ b/kernel/include/fmt_codec_utah.h @@ -0,0 +1,38 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_utah_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_utah_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + UTAH_HEADER utah; +}; + +#endif + diff --git a/kernel/include/fmt_codec_wal.h b/kernel/include/fmt_codec_wal.h new file mode 100644 index 0000000..5496bdc --- /dev/null +++ b/kernel/include/fmt_codec_wal.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_wal_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_wal_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + wal_header wal; + s32 neww, newh; + u8 *bits; +}; + +#endif diff --git a/kernel/include/fmt_codec_wbmp.h b/kernel/include/fmt_codec_wbmp.h new file mode 100644 index 0000000..cdaa382 --- /dev/null +++ b/kernel/include/fmt_codec_wbmp.h @@ -0,0 +1,49 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_wbmp_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_wbmp_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class Wbmp; + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + s32 putmbi(s32 i, ofstreamK &f); + s32 getmbi(ifstreamK &f); + s32 skipheader(ifstreamK &f); + + Wbmp* createwbmp(s32 width, s32 height, s32 color); + + s32 writewbmp(Wbmp *wbmp, ofstreamK &out); + + private: + Wbmp wbmp; +}; + +#endif + diff --git a/kernel/include/fmt_codec_wmf.h b/kernel/include/fmt_codec_wmf.h new file mode 100644 index 0000000..aa5d373 --- /dev/null +++ b/kernel/include/fmt_codec_wmf.h @@ -0,0 +1,39 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_wmf_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_wmf_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + u8 *buf; + s32 w, h; +}; + +#endif + diff --git a/kernel/include/fmt_codec_xbm.h b/kernel/include/fmt_codec_xbm.h new file mode 100644 index 0000000..5a36dbf --- /dev/null +++ b/kernel/include/fmt_codec_xbm.h @@ -0,0 +1,40 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_XBM_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_XBM_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + FILE *fptr; + RGB pal[2]; + s32 lscan; + s32 version; +}; + +#endif diff --git a/kernel/include/fmt_codec_xcur.h b/kernel/include/fmt_codec_xcur.h new file mode 100644 index 0000000..6f4fd16 --- /dev/null +++ b/kernel/include/fmt_codec_xcur.h @@ -0,0 +1,43 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_XCUR_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_XCUR_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + s32 currentToc; + bool lastToc; + + XCUR_HEADER xcur_h; + XCUR_CHUNK_DESC *tocs; + XCUR_CHUNK_HEADER xcur_chunk; + XCUR_CHUNK_IMAGE xcur_im; +}; + +#endif diff --git a/kernel/include/fmt_codec_xpm.h b/kernel/include/fmt_codec_xpm.h new file mode 100644 index 0000000..277f438 --- /dev/null +++ b/kernel/include/fmt_codec_xpm.h @@ -0,0 +1,44 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_XPM_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_XPM_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + void fillmap(); + RGBA hex2rgb(const s8 *hex); + + private: + s32 numcolors; + s32 cpp; + std::map<std::string, RGBA> named; + std::map<std::string, RGBA> file; +}; + +#endif diff --git a/kernel/include/fmt_codec_xwd.h b/kernel/include/fmt_codec_xwd.h new file mode 100644 index 0000000..690afa7 --- /dev/null +++ b/kernel/include/fmt_codec_xwd.h @@ -0,0 +1,38 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + as32 with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_XWD_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_XWD_H + +#include "ksquirrel-libs/fmt_codec_base.h" + +class fmt_codec : public fmt_codec_base +{ + public: + + BASE_CODEC_DECLARATIONS + + private: + s32 pal_entr, filler; + RGB *pal; +}; + +#endif diff --git a/kernel/include/ksquirrel-libs/error.h b/kernel/include/ksquirrel-libs/error.h new file mode 100644 index 0000000..bfeec9e --- /dev/null +++ b/kernel/include/ksquirrel-libs/error.h @@ -0,0 +1,49 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) libraries + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_ERROR_CODES_H +#define KSQUIRREL_LIBS_ERROR_CODES_H + + +/////////////////////////////////// +// // +// Error codes for libraries // +// // +/////////////////////////////////// + + +#define SQE_NOTOK 0 +#define SQE_OK 1 + +#define SQE_R_NOFILE 1024 +#define SQE_R_BADFILE 1025 +#define SQE_R_NOMEMORY 1026 +#define SQE_R_NOTSUPPORTED 1027 +#define SQE_R_WRONGDIM 1028 + +#define SQE_W_NOFILE 1029 +#define SQE_W_NOMEMORY SQE_R_NOMEMORY +#define SQE_W_NOTSUPPORTED 1032 +#define SQE_W_ERROR 1033 +#define SQE_W_WRONGPARAMS 1034 +#define SQE_W_WRONGDIM SQE_R_WRONGDIM + +#endif diff --git a/kernel/include/ksquirrel-libs/fileio.h b/kernel/include/ksquirrel-libs/fileio.h new file mode 100644 index 0000000..3bf3921 --- /dev/null +++ b/kernel/include/ksquirrel-libs/fileio.h @@ -0,0 +1,73 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2004 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_FIO_H +#define KSQUIRREL_LIBS_FIO_H + +#include <fstream> + +using namespace std; + +#include <ksquirrel-libs/fmt_types.h> + +//////////////////////////////// +// // +// Binary-oriented file i/o // +// // +//////////////////////////////// + + +// read binary data +class ifstreamK : public ifstream +{ + public: + ifstreamK(); + + // read 'size' bytes of binary data and store it into 'data'. + // return true if reading was successful, and false otherwise + bool readK(void *data, int size); + + // read string from file + bool getS(char *, const int); + + // read ascii hex value from file + bool readCHex(u32 &hex); + + // big-endian-oriented reading + bool be_getchar(u8 *c); + bool be_getshort(u16 *s); + bool be_getlong(u32 *l); + + void close(); +}; + +// write binary data +class ofstreamK : public ofstream +{ + public: + ofstreamK(); + + bool writeK(void *data, int size); + + void close(); +}; + +#endif diff --git a/kernel/include/ksquirrel-libs/fmt_codec_base.h b/kernel/include/ksquirrel-libs/fmt_codec_base.h new file mode 100644 index 0000000..cae04ea --- /dev/null +++ b/kernel/include/ksquirrel-libs/fmt_codec_base.h @@ -0,0 +1,258 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CLASS_DEFINITION_H +#define KSQUIRREL_LIBS_CLASS_DEFINITION_H + +#include <ksquirrel-libs/fmt_defs.h> +#include <ksquirrel-libs/fileio.h> +#include <ksquirrel-libs/settings.h> + +////////////////////////////////// +// // +// Base class for all // +// codecs // +// // +////////////////////////////////// + + +class fmt_codec_base +{ + public: + fmt_codec_base() + {} + + virtual ~fmt_codec_base() + {} + + // version of the library, e.g. "1.2.2", etc. + // + // tell clients that fmt_codec_base couldn't be + // instantianted + virtual void options(codec_options *) = 0; + + // return file extension for a given bpp + virtual std::string extension(const s32 bpp); + + /* + * read methods + */ + + // fmt_read_init: do what you need before decoding + virtual s32 read_init(const std::string &file); + + // fmt_read_next: seek to correct file offset, do other initialization stuff. + // this method should be (and will be) called before image is about to + // be decoded. + virtual s32 read_next(); + + // fmt_read_next_pass: do somethimg important before the next pass + // will be decoded (usually do nothing, if the image has only 1 pass (like BMP, PCX ...), + // or adjust variables if the image is interlaced, with passes > 1 (like GIF, PNG)) + virtual s32 read_next_pass(); + + // fmt_readscanline: read one scanline from file + virtual s32 read_scanline(RGBA *scan); + + // fmt_read_close: close all handles, free memory, etc. + virtual void read_close(); + + /* + * write methods + */ + + // fmt_getwriteoptions: return write options for this image format + virtual void getwriteoptions(fmt_writeoptionsabs *); + + // fmt_write_init: init writing + virtual s32 write_init(const std::string &file, const fmt_image &image, const fmt_writeoptions &opt); + + virtual s32 write_next(); + + virtual s32 write_next_pass(); + + // fmt_write_scanline: write scanline + virtual s32 write_scanline(RGBA *scan); + + // fmt_write_close: close writing(close descriptors, free memory, etc.) + virtual void write_close(); + + fmt_info information() const; + + fmt_image* image(const int index); + + void addmeta(const fmt_metaentry &m); + + void settempfile(const std::string &t); + + // fill fmt_settings with values + void set_settings(const fmt_settings &sett); + + fmt_settings settings() const; + + virtual void fill_default_settings() + {} + + protected: + // image index in finfo.image + s32 currentImage; + + // fmt_info structure + fmt_info finfo; + + // input stream + ifstreamK frs; + + // output stream + ofstreamK fws; + + // some additional error checkers + bool read_error, write_error; + + // line and layer indexes - needed by some + // interlaced or layered images + s32 line, layer; + + // error code + s32 write_error_code; + + // write options + fmt_writeoptions writeopt; + + // saved fmt_image + fmt_image writeimage; + + // path to temporary file + // should be set by the highlevel application + // with settempfile() + std::string tmp; + + fmt_settings m_settings; +}; + +inline +fmt_settings fmt_codec_base::settings() const +{ + return m_settings; +} + +inline +void fmt_codec_base::set_settings(const fmt_settings &sett) +{ + m_settings = sett; +} + +inline +fmt_info fmt_codec_base::information() const +{ + return finfo; +} + +inline +fmt_image* fmt_codec_base::image(const int index) +{ + return &finfo.image[index]; +} + +inline +void fmt_codec_base::addmeta(const fmt_metaentry &m) +{ + finfo.meta.push_back(m); +} + +inline +void fmt_codec_base::settempfile(const std::string &t) +{ + tmp = t; +} + +inline +std::string fmt_codec_base::extension(const s32) +{ + return std::string(""); +} + +inline +s32 fmt_codec_base::read_init(const std::string &) +{ return 1; } + +inline +s32 fmt_codec_base::read_next() +{ return 1; } + +inline +s32 fmt_codec_base::read_next_pass() +{ return 1; } + +inline +s32 fmt_codec_base::read_scanline(RGBA *) +{ return 1; } + +inline +void fmt_codec_base::read_close() +{} + +inline +void fmt_codec_base::getwriteoptions(fmt_writeoptionsabs *) +{} + +inline +s32 fmt_codec_base::write_init(const std::string &, const fmt_image &, const fmt_writeoptions &) +{ return 1; } + +inline +s32 fmt_codec_base::write_next() +{ return 1; } + +inline +s32 fmt_codec_base::write_next_pass() +{ return 1; } + +inline +s32 fmt_codec_base::write_scanline(RGBA *) +{ return 1; } + +inline +void fmt_codec_base::write_close() +{} + +#define BASE_CODEC_DECLARATIONS \ + fmt_codec(); \ + ~fmt_codec(); \ + \ + virtual void options(codec_options *o); \ + virtual s32 read_init(const std::string &file);\ + virtual s32 read_next(); \ + virtual s32 read_next_pass(); \ + virtual s32 read_scanline(RGBA *scan); \ + virtual void read_close(); + +#define WRITE_CODEC_DECLARATIONS \ + virtual std::string extension(const s32 bpp); \ + virtual void getwriteoptions(fmt_writeoptionsabs *); \ + virtual s32 write_init(const std::string &file, const fmt_image &image, const fmt_writeoptions &opt); \ + virtual s32 write_next(); \ + virtual s32 write_next_pass(); \ + virtual s32 write_scanline(RGBA *scan); \ + virtual void write_close(); + +#endif + diff --git a/kernel/include/ksquirrel-libs/fmt_defs.h b/kernel/include/ksquirrel-libs/fmt_defs.h new file mode 100644 index 0000000..a2bbd6c --- /dev/null +++ b/kernel/include/ksquirrel-libs/fmt_defs.h @@ -0,0 +1,242 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_DEFS_H +#define KSQUIRREL_LIBS_DEFS_H + +#include <vector> +#include <string> + +#include <ksquirrel-libs/fmt_types.h> + +struct codec_options +{ + std::string version, + name, + filter, + mime, + mimetype, + config; + + void *pixmap; + + bool readable, + canbemultiple, + writestatic, + writeanimated, + needtempfile; +}; + +/* Metainfo support */ + +struct fmt_metaentry +{ + std::string group; + std::string data; +}; + +/* RGBA and RGB pixels */ + +struct RGBA +{ + RGBA() : r(0), g(0), b(0), a(0) + {} + + RGBA(s32 r1, s32 g1, s32 b1, s32 a1) : r(r1), g(g1), b(b1), a(a1) + {} + + u8 r; + u8 g; + u8 b; + u8 a; + +}PACKED; + +struct RGB +{ + RGB() : r(0), g(0), b(0) + {} + + RGB(s32 r1, s32 g1, s32 b1) : r(r1), g(g1), b(b1) + {} + + u8 r; + u8 g; + u8 b; + +}PACKED; + +/* Image decription */ +struct fmt_image +{ + fmt_image() : w(0), h(0), bpp(0), hasalpha(false), needflip(false), delay(0), + interlaced(false), passes(1) + {} + + // width and height + s32 w; + s32 h; + + // bit depth + s32 bpp; + + // has alpha channel ? + bool hasalpha; + + // need to be flipped ? + bool needflip; + + // if it's a frame in animated sequence, + // 'delay' will define a delay time + s32 delay; + + // interlaced or normal ? + bool interlaced; + + // if interlaced, 'passes' stores the number + // of passes. if no, passes should be 1 + s32 passes; + + // some useful info about image. + // this is a replacement for 'dump' in older versions of ksquirrel-libs + // -------------------------------------------------------------------- + + // color space (RGB, RGBA, CMYK, LAB ...) + std::string colorspace; + + // compression type (RLE, JPEG, Deflate ...) + std::string compression; + + // palette types + enum fmt_palette { monochrome = 1, indexed4 = 2, indexed8 = 4, indexed15 = 8, + indexed16 = 16, pure24 = 32, pure32 = 64, internal = 128 }; + + // palette, if exists + std::vector<RGB> palette; +}; + +/* General description */ +struct fmt_info +{ + fmt_info() : animated(false) + {} + + /* + * TODO: make 'image' and 'meta' implicitly shared ? + */ + + // array of images + std::vector<fmt_image> image; + + // array of metainfo entries + std::vector<fmt_metaentry> meta; + + // animated or static + bool animated; +}; + +/* Internal cmpression. + E.g. compression_level will be + passed to internal routines, + No compression RLE compression for ex. in libjpeg, libpng. +*/ +enum fmt_compression { CompressionNo = 1, CompressionRLE = 2, CompressionInternal = 4 }; +/* Note: if the image can be compressed + with RLE encoding and with only RLE + encoding, compression_scheme should be + CompressionInternal +*/ + +/* Write options for image format */ +struct fmt_writeoptionsabs +{ + // can be interlaced ? + bool interlaced; + + // if interlaced, this value should store preferred number of passes. + s32 passes; + + // if the image should be flipped before writing + bool needflip; + + // with which compression it can be encoded ? + // for example: CompressionNo | CompressionRLE. + // it means, that image can be encoded with RLE + // method or can be saved uncompressed. + s32 compression_scheme; + + // minimum compression level, maximum and default + // For example, JPEG library has minimum = 0, + // maximum = 100 and default = 25. + s32 compression_min, compression_max, compression_def; + + // with which bit depth it can be encoded ? + // 1 means support of this bit depth, + // and 0 otherwise. This param cann't be null. + // + // bits 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + // bit depth 32 24 16 15 8 4 1 + u8 palette_flags; + +}PACKED; + +/* this information will be passed to writing function */ +struct fmt_writeoptions +{ + // write interlaced image or normal ? + bool interlaced; + + // with which compression encode the image ? + fmt_compression compression_scheme; + + // compression level + s32 compression_level; + + // has alpha channel ? + // If no, A channel in RGBA image will be ignored + bool alpha; + + s32 bitdepth; + +}PACKED; + +#if defined SQ_NEED_OPERATOR_RGBA_RGBA +static s32 operator== (const RGBA &rgba1, const RGBA &rgba2) +{ + return (rgba1.r == rgba2.r && rgba1.g == rgba2.g && rgba1.b == rgba2.b && rgba1.a == rgba2.a); +} +#endif + +#if defined SQ_NEED_OPERATOR_RGB_RGBA +static s32 operator== (const RGB &rgb, const RGBA &rgba) +{ + return (rgb.r == rgba.r && rgb.g == rgba.g && rgb.b == rgba.b); +} +#endif + +#if defined SQ_NEED_OPERATOR_RGBA_RGB +static s32 operator== (const RGBA &rgba, const RGB &rgb) +{ + return (rgba.r == rgb.r && rgba.g == rgb.g && rgba.b == rgb.b); +} +#endif + +#endif diff --git a/kernel/include/ksquirrel-libs/fmt_types.h b/kernel/include/ksquirrel-libs/fmt_types.h new file mode 100644 index 0000000..75b6f02 --- /dev/null +++ b/kernel/include/ksquirrel-libs/fmt_types.h @@ -0,0 +1,36 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2005 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_TYPES_H +#define KSQUIRREL_LIBS_TYPES_H + +typedef char s8; +typedef unsigned char u8; + +typedef short s16; +typedef unsigned short u16; + +typedef int s32; +typedef unsigned int u32; + +#define PACKED __attribute__ ((packed)) + +#endif diff --git a/kernel/include/ksquirrel-libs/fmt_utils.h b/kernel/include/ksquirrel-libs/fmt_utils.h new file mode 100644 index 0000000..1ab42e3 --- /dev/null +++ b/kernel/include/ksquirrel-libs/fmt_utils.h @@ -0,0 +1,64 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2004 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_UTILS_H +#define KSQUIRREL_LIBS_UTILS_H + +#include <string> + +using namespace std; + +#include <ksquirrel-libs/fmt_types.h> + +struct RGBA; + +//////////////////////// +// // +// Helper namespace // +// // +//////////////////////// + + +namespace fmt_utils +{ + void fillAlpha(RGBA *scan, int w, u8 value = 255); + + // flip the image vertically + // usually BMP, SGI (or some other formats) need to be flipped + void flipv(s8 *image, s32 bytes_w, s32 h); + + // flip the image horizontally + void fliph(s8 *image, s32 w, s32 h, s32 bpp); + + // Big endian to Little endian conversion + u16 konvertWord(u16 a); + u32 konvertLong(u32 a); + + // return color system name by bpp. + // for example 32 bpp means RGBA image, 1 bpp - monochrome + std::string colorSpaceByBpp(const s32 bpp); + + void expandMono1Byte(const u32 byte, u8 *array); + void expandMono2Byte(const u32 byte, u8 *array); + void expandMono4Byte(const u32 byte, u8 *array); +} + +#endif diff --git a/kernel/include/ksquirrel-libs/settings.h b/kernel/include/ksquirrel-libs/settings.h new file mode 100644 index 0000000..b8472c6 --- /dev/null +++ b/kernel/include/ksquirrel-libs/settings.h @@ -0,0 +1,69 @@ +/* This file is part of ksquirrel-libs (http://ksquirrel.sf.net) + + Copyright (c) 2007 Dmitry Baryshev <ksquirrel@tut.by> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any later + version. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KSQUIRREL_LIBS_CODEC_SETTINGS_H +#define KSQUIRREL_LIBS_CODEC_SETTINGS_H + +#include <map> +#include <string> + +struct settings_value +{ + enum settings_value_type { v_bool, v_int, v_double, v_string }; + + settings_value() + : type(v_int), bVal(false), iVal(0), dVal(0.0) + {} + + settings_value(bool _b) + : type(v_bool), bVal(_b) + {} + + settings_value(int _i) + : type(v_int), iVal(_i) + {} + + settings_value(double _d) + : type(v_double), dVal(_d) + {} + + settings_value(const std::string &_s) + : type(v_string), sVal(_s) + {} + + settings_value_type type; + + // means QCheckBox + bool bVal; + + // means KNumInput or QGroupBox + int iVal; + + // means KDoubleNumInput + double dVal; + + // means QLineEdit + std::string sVal; +}; + +typedef std::map<std::string, settings_value> fmt_settings; + +#endif |