Enhance PB - A call for all C/C++ Developers in PB community

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Enhance PB - A call for all C/C++ Developers in PB community

Post by Yogi Yang »

There are many good and some very good and yet some are just excellent libraries floating around on net. It would be really great if some kind of small teamw were formed by hard core C/C++ developers and these Libraries were converted to User Libs for PB. Where User Libs are not possible one should write wrapper for such libraries.

I know there are many developers who are already working on building such User Libs but they are wide spread and everybody seems to be working on their own rather than as a Group. I feel such developers should get together (without bringing their egos in-between) and develope as a group.

I am listing a few that I personally feel would be useful to mass developers community of PB

LTI-Lib
The LTI-Lib is an object oriented library with algorithms and data structures frequently used in image processing and computer vision. It has been developed at the Chair of Technical Computer Science (Lehrstuhl fuer Technische Informatik) LTI at the Aachen University of Technology, as part of many research projects in computer vision dealing with robotics, object recognition and sing language and gesture recognition.

The main goal of the LTI-Lib is to provide an object oriented library in C++, which simplifies the code sharing and maintenance, but still providing fast algorithms that can be used in real applications.

It has been developed using GCC under Linux, and Visual C++ under Windows NT. We have not tested it under other platforms.

Many classes encapsulate Windows/Linux functionality in order to simplify dealing with system or hardware specific code (for example classes for multi-threading and synchronization, time measurement and serial port access).
The rest of the more than 500 classes deal mainly with one of following fields:

Linear algebra

Matrices, Vectors, Tensors, and functors to extract eigenvalues, eigenvectors, linear equations solutions, statistics, etc. are provided.
Classification and Clustering

Radial Basis Function classifiers, Support Vector Machines, k-Means, Fuzzy C-Means, classification statistics are just some examples of what you can do with the LTI-Lib.

Image Processing

The most classes deal with image processing problems. Different segmentation approaches, linear filters, wavelets, steerable filters, und much more are already available.

Visualization and Drawing Tools

The most difficult part when developing image processing algorithms in C++ is showing temporary images while debugging. Due to the object oriented architecture of the LTI-Lib, you just need to create a viewer object and give it the image you need to show. That's it. An if you additionally need to draw some extra information on that image (some text, ellipses, boxes, lines or points) you can use one of the drawing objects. This will help you to save lots of time!
For more info please goto : http://ltilib.sourceforge.net/doc/homepage/index.shtml

Imview
Imview: a portable image viewing and analysis application where in
Arbitrary 1-D profile of 2-D images (or of 2-D slices of 3-D images) can be displayed.

Allows easy extraction of point and groups of points statistics.

Has support for arbitrary colourmaps for all pixel types (i.e.: false colour display).

Has standard image manipulation facilities (brightness/contrast, gamma, zoom, crop, rotation, etc).

Can be controlled remotely via sockets and text commands (for easy integration into various image analysis systems).

Images can be uploaded into Imview via sockets or shared memory.

Imview is portable. It works on many unices and under windows. A port to Mac OS/X is available under CVS.

And much more!

For more info please goto : http://www.cmis.csiro.au/Hugues.Talbot/imview/

SciLab
Scilab is an open source software. There are many ways to contribute to Scilab, and users are invited to share their experience of Scilab by submitting their own functions, toolboxes, introduction to Scilab, user guides, translations etc.

For more info please goto : http://www.scilab.org/

ImLib3D
ImLib3D is an open source C++ library for 3D (volumetric) image processing. Focus has been put on simplicity for the developer. It contains most basic image processing algorithms, and some more sophisticated ones. It comes with an optional viewer that features multiplanar views, animations, vector field views and 3D (OpenGL) multiplanar. All image processing operators can be interactively called from the viewer as well as from the UNIX command-line. ImLib3D's goal is to provide a standard and easy to use platform for volumetric image processing research. ImLib3D has been carefully designed, using modern, standards conforming C++. It intensively uses the Standard C++ Library, including strings, containers, and iterators.

For more info please goto : http://imlib3d.sourceforge.net

Unicode Libs
FreeType
A free, high-quality, and portable font engine, which supports True Type and Open Type Fonts as well as unicode.

For more info please goto : http://www.freetype.org/

IBM's ICU
The International Component for Unicode (ICU) is a mature, portable set of C/C++ and Java libraries for Unicode support, software internationalization (I18N) and globalization (G11N), giving applications the same results on all platforms.

For more info please goto : http://www-306.ibm.com/software/globali ... /index.jsp

UTF - CPP
A simple, portable and lightweight generic library for handling UTF-8 encoded strings.

For more info please goto : http://utfcpp.sourceforge.net/

International components for Unicode
Widely used set of C/C++ and Java libraries for Unicode support; open source.

For more info please goto : http://www-306.ibm.com/software/globali ... /index.jsp

LASi
A C++ library that provides a C++ stream output interface for creating Postscript documents containing Unicode characters.

For more info please goto : http://www.unifont.org/lasi/

libunicows
Unicode library for Win32, to alleviate the complications related to developing a single unicode app for all Win32 platforms.

For more info please goto : http://libunicows.sourceforge.net/

Pango
A library for laying out and rendering of text, with an emphasis on internationalization.

For more info please goto : http://www.pango.org/

xtklib
Free C++ library for Windows and Unix (Linux/BSD) with: streams, unicode strings, sockets, file access, exceptions hierarchy, etc.

For more info please goto : http://xtklib.berlios.de/

WordType Layout Engine - this lib is not free but is just superb
An ANSI-C based modular library designed for building complex subsystems that allow products to display multilingual text. With WorldType Layout Engine integrated into an operating system or application, the technology will handle various intricacies such as line layout, contextual character shaping or substitution, ligatures, combined characters and bi-directional text flow.

For more info please goto : http://www.monotypeimaging.com/Products ... /wtle.aspx

Office Suite Components
What is listed here are not libraries but they can be converted to libraries if the user interface part is removed (as the user interface part will be designed by the developer using such lib) and just the core engine is isolated and kept

AbiWord
AbiWord is a free word processing program similar to Microsoft® Word. It is suitable for a wide variety of word processing tasks.

For more info please goto : http://www.abisource.com/

Open Office Writer
is a word processor. use it for anything from writing a quick letter to producing an entire book with embedded illustrations, cross-references, tables of contents, indexes, bibliographies... Auto-complete, auto-format, and real-time spelling check make light work of the hardest task. Writer is powerful enough to tackle desktop publishing tasks such as creating multi-column newsletters, brochures – the only limit is your imagination.

For more info please goto : http://www.openoffice.org/product/writer.html

Open Office Calc
Use it to bring your numbers under control. This powerful spreadsheet has all the tools you need to calculate, analyse, summarise, and present your data in numerical reports or sizzling graphics. A fully-integrated help system makes entering complex formulas a breeze. Sophisticated decision-making tools are just a few mouse clicks away. Pull in external data using the Data Pilot, and sort it, filter it, and produce subtotals and statistical analyses. Use previews to select from thirteen categories of 2-D and 3-D charts including line, area, column, pie, XY, stock and net with dozens of variants.

For more info please goto : http://www.openoffice.org/product/calc.html

Open Office Impress
It is the fastest, most powerful way to create effective multimedia presentations. Your presentations will truly stand out with special effects, animation and high-impact drawing tools.

For more info please goto : http://www.openoffice.org/product/impress.html

Open Office Base 2
BASE enables you to manipulate database data seamlessly within OpenOffice.org. Create and modify tables, forms, queries, and reports, either using your own database or BASE’s own built-in HSQL database engine. BASE offers a choice of using Wizards, Design Views, or SQL Views for beginners, intermediate, and advanced users.

For more info please goto : http://www.openoffice.org/product/base.html

Open-source Databases
The list is very long but I am keeping it to minimum

Berkeley DB
Open Source embedded database system. It consists of a toolkit that provides high-performance built-in database support for desktop and server applications. Access through B+tree, Extended Linear Hashing, Fixed and Variable-length records, and Queues. No support for SQL. Also: transactions, database recovery, online backups, and separate access to locking, logging and shared memory caching subsystems.
Supports C, C++, Java, Tcl, Perl, and Python APIs. Runs on Windows 95/98/NT/2000, VxWorks, Linux and various other types of Unix.
Freeware when distributed with non-commercial or open-source applications.

http://sleepycat.com/

DataReel
A cross-platform C++ development kit used to build multi-threaded database and communications applications. Using DataReel you can build end-user applications, embedded systems, and reusable libraries for multiple operating systems.

http://www.datareel.com/

Firebird Database
Firebird is a relational database for Linux, Windows, and a variety of Unix platforms. Open-source, freeware, based on Interbase.

http://www.firebirdsql.org/

FlashFiler (This porudct can be developed 100 in PB from scratch!)
Freeware, open-source client/server database created using Delphi. FlashFiler features a component-based architecture and can be compiled into your applications. Easy to configure, fast, and includes SQL.

http://sourceforge.net/projects/tpflashfiler/

MySQL
Well-known freeware, multi-user, multi-threaded SQL database server. Versions available for Win95/Win98/NT, Linux, Solaris, FreeBSD, AIX, SunOS, etc. JDBC drivers available. Most Internet providers offer MySQL as part of their Webhosting packages. Freeware under the GPL license.

http://www.mysql.com/

Ocelot
Free database that supports the full ANSI / ISO SQL Standard (1992), and a list of SQL3 features (also known as SQL-99). Runs on various versions of Windows. Database can be called using ODBC. Programs written in C, BASIC, Pascal, Delphi, etc. can also use this database system with direct dll calls.
If you want to distribute this database with your freeware program, it might not be free.

http://www.ocelot.ca/

Real Isam
A database library (DLL) that uses the ISAM method (Indexed Sequential Access Method) to manage access keys and variable length data records. For C++, Delphi, Visual Basic, etc. Freeware for Windows.

http://www.alpes-software.com/realisam/

Of course there are many,many such libraries and products which can be converted to Pure User Libs but let us keep thinks short for now :?

I will post others in multiple post under this heading if there is interest from the community.
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Finding great library is not a hard task, the freshmeat's research engine find them easily though calling for C/C++ is a good thing but why not trying to teach yourself the needed skills for converting C/C++ code to a userlib ?
When the lib is well coded, it is just a matter of instancating a pointer to a object (instance) then, export each member call from this object.
Example : take jwSMTP, the code for a userlib :

Code: Select all

#include <iostream>
#include <assert.h>
#include "jwsmtp/jwsmtp.h"

#ifdef	__cplusplus
	extern "C" {
#endif

#define API			__stdcall
#define EXPORTAPI	__declspec(dllexport)


typedef struct mail_info {
	const char * toAddress;
	const char * fromAddress;
	const char * subject;
	const char * message;
	const char * server;
	unsigned short Port;
	bool		mxLookup;
}mail_info;

using namespace jwsmtp;

EXPORTAPI mailer * API PB_jwSMTP_Create(mail_info * info )
{
mailer * m = new mailer(info->toAddress, info->fromAddress, info->subject, info->message, info->server, info->Port, info->mxLookup);

	assert(m);
	return m;
}

EXPORTAPI void API PB_jwSMTP_Destroy(mailer * m)
{
	assert(m);

	delete m;
	m = NULL;
}

EXPORTAPI void API PB_jwSMTP_Send(mailer *m)
{
	m->send();
}

EXPORTAPI void API PB_jwSMTP_Attach(mailer *m, const char * filename)
{
const std::string& s = filename;

	m->attach(s);
}

EXPORTAPI void API PB_jwSMTP_RemoveAttachment(mailer *m, const char * filename)
{
const std::string& s = filename;

	m->removeattachment(s);
}

EXPORTAPI bool API PB_jwSMTP_SetMessage(mailer *m, const char * newmessage)
{
const std::string& s = newmessage;

	return m->setmessage(s);
}

EXPORTAPI bool API PB_jwSMTP_SetMessageHTML(mailer *m, const char * newmessage)
{
const std::string& s = newmessage;

	return m->setmessageHTML(s);
}

EXPORTAPI bool API PB_jwSMTP_SetMessageHTMLfile(mailer *m, const char * filename)
{
const std::string& s = filename;

	return m->setmessageHTMLfile(s);
}

EXPORTAPI bool API PB_jwSMTP_SetSubject(mailer *m, const char * newSubject)
{
const std::string& s = newSubject;

	return m->setsubject(s);
}

EXPORTAPI bool API PB_jwSMTP_SetServer(mailer * m, const char * nameserver_or_smtpserver)
{
const std::string& s = nameserver_or_smtpserver;

	return m->setserver(s);
}

EXPORTAPI bool API PB_jwSMTP_SetSender(mailer * m, const char * newsender)
{
const std::string& s = newsender;

	return m->setsender(s);
}

EXPORTAPI bool API PB_jwSMTP_AddRecipient(mailer * m, const char * newrecipient, short recipient_type /*CC, BCC*/)
{
const std::string& s = newrecipient;

	return m->addrecipient(s, recipient_type);
}

EXPORTAPI bool API PB_jwSMTP_RemoveRecipient(mailer * m, const char * recipient)
{
const std::string& s = recipient;

	return m->removerecipient(s);
}

EXPORTAPI void API PB_jwSMTP_ClearRecipients(mailer * m)
{
	m->clearrecipients();
}

EXPORTAPI void API PB_jwSMTP_ClearAttachments(mailer * m)
{
	m->clearattachments();
}

EXPORTAPI void API PB_jwSMTP_Reset(mailer * m)
{
	m->reset();
}

EXPORTAPI const char * API PB_jwSMTP_Response(mailer * m)
{
	return m->response().data();
}

/*
void API jwSMTP_AuthType(mailer * m, const enum authtype Type)
{
	m->authtype(Type);
}
*/

EXPORTAPI void API PB_jwSMTP_UserName(mailer * m, const char * User)
{
const std::string& s = User;

	m->username(s);
}

EXPORTAPI void API PB_jwSMTP_Password(mailer * m, const char * Pass)
{
const std::string& s = Pass;

	m->password(s);
}

#ifdef __cplusplus
	}
#endif
You can also just compile the lib as static and use Import/ImportC, i show the old way, using a desc file.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Post by Yogi Yang »

KarLKoX wrote:Finding great library is not a hard task, the freshmeat's research engine find them easily though calling for C/C++ is a good thing but why not trying to teach yourself the needed skills for converting C/C++ code to a userlib ?
When the lib is well coded, it is just a matter of instancating a pointer to a object (instance) then, export each member call from this object.

You can also just compile the lib as static and use Import/ImportC, i show the old way, using a desc file.
I think you are righ but I do not know C++ at all and I do not have any plans to learn that shit of a language. If I knew C++ then I would not even think of moving to PB, coz I think the amount of work required to create even a simple software in PB is equivallent to that which is required in C/C++ (provided all those necessary include files and libs are there).

I like what I saw of PB and thought that if a few good libs were added then PB would become more powerful and would attract more users from all walks of life. Of course Fred would benefit here from the communicity efforts. People who will put in efforts may not get direct benefits!

By the way I did not leech anything from any site like FreshMeat or something. I have been searching the net for good usable libs for my clients as their developers do not have time for searching the net. I have mentioned what I came across and thought that it would be great to use such a lib.

For example in case of LTI-Lib I have used it's ActiveX version and really liked it a lot. SciLab is a good product. One of my client uses SciLab with LabView and told me that it is a really worth while product so I thought that I will mention it here and if possible motivate someone to convert it to PB.

The Unicode Lib part is borowed from various sites on the web as I till date do not use Unicode in any of my develpment, but I have got one of my client to try WordType Layout Engine and his feedback was that it is just great but a bit too costly.

Office Suite Components is just my own dream that one day there will be components available for developers to just plugin and use. BTW M$ has already started in this direction with their Office Suite. What I am suggesting here is to use Open Source products.

In short I am not just listing something here for the sake of listing it, I really think creating or converting existing C/C++ libs to PB will place PB is a better commercial viability position.

Thanks,
Post Reply