sprint 1-alpha
Namespaces | Classes | Typedefs | Enumerations | Functions
sprint Namespace Reference

Sprint is a lightweight c++ library to handle different task with crossplatform attention (trying to compile both on MSVC and Mingw on WIn32 and GCC on Linux. More...

Namespaces

namespace  gtl
 

GTL, GUI Template Library is an ATL compatible framework, oriented to cross-compile Win32 application on more operative systems.


namespace  io
 

the sprint::io namespace, which contains API to read and write from various device


namespace  ipc
 

inter-process comunication


namespace  xml
 

xml namespace


Classes

class  BaseArchive
class  ArchiveOut
 An Output Archive: an object to save a configuration. More...
struct  DefineList
 Una lista di Define (macro) More...
class  ArchiveInBase
class  ArchiveImporter
class  ArchiveIn
 An object used to read a configuration. More...
class  SemanthicContext
class  SimpleTextArchiveOut
 Sequential Archive file output. More...
class  SimpleTextArchiveIn
 Storage reader. More...
class  WaveIn
class  WaveOut
class  buffer_cast
 a dummy class to hold a small buffer (allocated in stack) More...
class  alias
 handles reference between const string list and index associa a delle stringhe allocate dall'utente un indice interno Al momento attuale non viene eseguita nessuna indicizzazione particolare e la ricerca è sequenziale all'interno della lista More...
class  alias_vector
class  named_alias_vector
class  alias_map
 associate string and index è un map tra stringhe e interi More...
struct  array
 an array of N elements of T More...
class  autovector
 a memory ptr wrapper Provides an auto deallocation array with a destructive `resize` method and without boundaries check. More...
class  const_buffer
struct  mutable_buffer
struct  cachemap_iterator
class  cachemap
class  lazy_vector
 a lazy vector hidden internal _Tp using a char buffer More...
class  light_string
 Dynamic allocated string, without shared pointer and capacity feature. More...
struct  ref_any
struct  sharable
 a sharable object Help class to create a sharable intrusive object. This object represents the intrusive part. More...
class  shared_ptr
 an intrusive shared_ptr implementation. More...
class  shared_string
 similar to STL string (used in no STL projects), but use a sprint::shared_vector object More...
class  shared_vector
 a shared vector More...
class  static_buffer
class  storage_buffer
 Use an user buffer to implement IO and cat of string/data. More...
struct  tuple1
 a tuple, representing 1 ordered elements More...
struct  tuple2
 a tuple, representing 2 ordered elements More...
struct  tuple3
 a tuple, representing 3 ordered elements More...
struct  tuple4
 a tuple, representing 4 ordered elements More...
struct  tuple5
 a tuple, representing 5 ordered elements More...
struct  tuple6
 a tuple, representing 6 ordered elements More...
struct  tuple7
 a tuple, representing 7 ordered elements More...
struct  tuple8
 a tuple, representing 8 ordered elements More...
struct  tuple9
 a tuple, representing 9 ordered elements More...
struct  tuple10
 a tuple, representing 10 ordered elements More...
struct  tuple11
 a tuple, representing 11 ordered elements More...
struct  tuple12
 a tuple, representing 12 ordered elements More...
class  unordered_map
class  unordered_set
class  uncopiable
 an uncopiable class it marks derived class as uncopiable More...
class  if_copiable< true >
 a copiable class template More...
class  if_copiable< false >
 an uncopiable class template More...
class  function0
 no parameter, only return type More...
class  function1
 virtual function with 1 parameters. R is the return type More...
class  function2
 virtual function with 2 parameters. R is the return type More...
class  function3
 virtual function with 3 parameters. R is the return type More...
class  function4
 virtual function with 4 parameters. R is the return type More...
class  function5
 virtual function with 5 parameters. R is the return type More...
class  function6
 virtual function with 6 parameters. R is the return type More...
class  function7
 virtual function with 7 parameters. R is the return type More...
class  function8
 virtual function with 8 parameters. R is the return type More...
class  function9
 virtual function with 9 parameters. R is the return type More...
class  function10
 virtual function with 10 parameters. R is the return type More...
class  function11
 virtual function with 11 parameters. R is the return type More...
class  function12
 virtual function with 12 parameters. R is the return type More...
struct  simple_function
class  SplashImageManager
struct  CharDescr
 the font character layout More...
struct  kerning_pair
 kernings pair for font More...
struct  font
 A FONT structure handler. More...
struct  iimage
 an image buffer capable of release, realloc, clonable More...
class  image
 an image container More...
struct  imageview
class  data_buffer
 A simple buffer class (it is like a vector<char> with an additional pos pointer) More...
class  read_buffer
class  write_buffer
class  Tftdiserial
 Communication handle. More...
class  ostringstream
class  async_socket
 async socket class. Extend a socket with async methods. More...
class  ftp
 the ftp library More...
class  network
 Classe Wrapper per caricare la DLL di rete. More...
class  dmatrix
 Variable size Matrix. More...
class  fmatrix
 Fixed size Matrix. More...
struct  point2
 2d point More...
struct  point3
 2d homogeneous coordinate, 3d point More...
struct  point4
 3d homogeneous coordinate, quaternion More...
struct  rect
 a rectangle More...
class  odbc
 Un Wrapper C++ verso ODBC. More...
class  lua_script
class  singleton
 A singleton. More...
struct  thread_function
 win32 thread creation params More...
class  event
 Event object. can be signaled or unsignaled, waited on it. More...
class  scoped_lock
class  mutex
 mutex class (implemented using Critical Section) More...
class  pipe
 a pipe wrapper More...
class  ReadWriteMutex
 A multiple Read-Write Mutex. More...
class  ScopedReadLock
 Reading Lock. More...
class  ScopedWriteLock
 Writing Lock. More...
class  semaphore
 Semaphore object. More...
class  thread
class  runnable
 a java-like runnable task using virtual function. class must implement a void *the_thread() method. More...
class  thread_group
class  rtc
class  timer

Typedefs

typedef const char * SEMANTHIC []
 semanthic format
typedef sprint::unordered_map
< std::string, std::string > 
SimpleTextArchive
 una semplice coppia chiave valore non ordinata
typedef detail::const_string
< true > 
const_string
 a const_string case sensitive
typedef detail::const_string
< false > 
const_istring
 a const_string case insensitive
typedef bool(* read_image_proc )(sprint::io::xstream *, sprint::iimage *)
 type of read image proc
typedef bool(* write_image_proc )(sprint::io::xstream *, const sprint::imageview &)
 type of write image proc
typedef Tftdiserial< false > ftdiserial
 a FTDI serial interface (the device is closed in the destructor)
typedef Tftdiserial< true > ftdiserialhandle
 a FTDI serial handle (it not close the device)
typedef BOOL(* ENUMFILESCALLBACK )(LPVOID lpContext)
typedef detail::socket< true > socket
 a socket descriptor released with destructor
typedef detail::socket< false > socket_handle
 a socket descriptor unreleased
typedef detail::udp_socket< true > udp_socket
 A Datagram Socket.
typedef detail::udp_socket< false > udp_socket_handle
typedef detail::tcp_socket< true > tcp_socket
 A stream socket.
typedef detail::tcp_socket< false > tcp_socket_handle
typedef dmatrix< float > dmatrixf
 a dynamic single precisiong floatingpoint matrix
typedef dmatrix< double > dmatrixd
 a dynamic double precision floatingpoint matrix
typedef mutex thread_mutex
 Under Win32 Mutex are also thread dependent mutex.

Enumerations

enum  TextAlign {
  TextAlign_Default = 0, TextAlign_Left = 1, TextAlign_Right = 2, TextAlign_HCenter = 3,
  TextAlign_HMask = 3, TextAlign_Top = 4, TextAlign_Bottom = 8, TextAlign_VCenter = 12,
  TextAlign_VMask = 12
}
 text alignment macros
enum  InterpolationAlgorithm { Nearest, Bilinear, Bicubic, Trilinear }
enum  FtpResponseCode {
  FTP_RESPONSE_RESTATRT_MARKER_REPLY = 110, FTP_RESPONSE_SERVICE_READY_IN_MINUTES = 120, FTP_RESPONSE_DATA_CONNECTION_ALREADY_OPEN = 125, FTP_RESPONSE_FILE_STATUS_OK = 150,
  FTP_RESPONSE_COMMAND_OK = 200, FTP_RESPONSE_COMMAND_NOT_IMPLEMENTED_SUPERFLUOUS_AT_THIS_SITE = 202, FTP_RESPONSE_SYSTEM_STATUS_OR_SYSTEM_HELP_REPLY = 211, FTP_RESPONSE_DIRECTORY_STATUS = 212,
  FTP_RESPONSE_FILE_STATUS = 213, FTP_RESPONSE_HELP_MESSAGE = 214, FTP_RESPONSE_NAME_SYSTEM_TYPE = 215, FTP_RESPONSE_SERVICE_READY_FOR_NEW_USER = 220,
  FTP_RESPONSE_SERVICE_CLOSING_CONTROL_CONNECTION = 221, FTP_RESPONSE_DATA_CONNECTION_OPEN = 225, FTP_RESPONSE_CLOSING_DATA_CONNECTION = 226, FTP_RESPONSE_ENTERING_PASSIVE_MODE = 227,
  FTP_RESPONSE_USER_LOGGED_IN = 230, FTP_RESPONSE_REQUESTED_FILE_ACTION_OK_COMPLETED = 250, FTP_RESPONSE_PATHNAME_CREATED = 257, FTP_RESPONSE_USER_NAME_OK_NEED_PASSWORD = 331,
  FTP_RESPONSE_NEED_ACCOUNT_FOR_LOGIN = 332, FTP_RESPONSE_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFO = 350, FTP_RESPONSE_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION = 421, FTP_RESPONSE_CANNOT_OPEN_DATA_CONNECTION = 425,
  FTP_RESPONSE_CONNECTION_CLOSED_TRANSFER_ABORTED = 426, FTP_RESPONSE_REQUESTED_FILE_ACTION_NOT_TAKEN = 450, FTP_RESPONSE_REQUESTED_ACTION_ABORTED = 451, FTP_RESPONSE_REQUESTED_ACTION_NOT_TAKEN = 452,
  FTP_RESPONSE_SYNTAX_ERROR_COMMAND_UNRECOGNIZED = 500, FTP_RESPONSE_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS = 501, FTP_RESPONSE_COMMAND_NOT_IMPLEMENTED = 502, FTP_RESPONSE_BAD_SEQUENCE_OF_COMMANDS = 503,
  FTP_RESPONSE_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = 504, FTP_RESPONSE_NOT_LOGGED_IN = 530, FTP_RESPONSE_NEED_ACCOUNT_FOR_STORING_FILES = 532, FTP_RESPONSE_REQUESTED_ACTION_NOT_TAKEN_FILE_UNAVAILABLE = 550,
  FTP_RESPONSE_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN = 551, FTP_RESPONSE_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE_ALLOCATION = 552, FTP_RESPONSE_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED = 553
}
enum  FtpStatus { FTP_DISCONNECTED, FTP_USER_LOGGED, FTP_CONNECTION_AUTHENTICATION, FTP_CONNECTION_CONNECTED }
enum  FtpTransferMode { FTP_ASCII_MODE, FTP_BINARY_MODE }
enum  Type {
  Void = 0, Int8, UnsignedInt8, In16,
  UnsignedInt16, Int32, UnsignedInt32, Int64,
  UnsignedInt64, RGB24, RGBA32, Float,
  Double, String, Vector, Pair,
  Enum
}
 A reduced set of type in order to serialize data over a network or describe an interface. More...

Functions

template<class D , class S >
void copy (D &dst, const S &src, unsigned int len)
 Copia tra due array o std::vector Questa non \`e una semplice copia come fa std::copy ma e' un `generator', che a differenza di std::generator permette sia di usare vector e array oltre a funzioni proprietarie.
template<class D , class S >
void set (D &dst, const S value, unsigned int len)
template<class D >
void zero (D *dst, unsigned int len)
BOOL ArchiveGenericExport (ArchiveOut *a, const BYTE *priv, const char **semanthic)
BOOL ArchiveGenericImport (ArchiveIn *a, BYTE *priv, const char **semanthic)
void ArchiveSetServerName (const char *name)
bool LoadSimpleTextArchive (std::vector< std::pair< std::string, std::string > > &s, const char *fileName)
 read a file in format <key>:and put in the vector
bool SaveSimpleTextArchive (const std::vector< std::pair< std::string, std::string > > &s, const char *fileName)
 save the vector in the file
void RegisterAlias (Alias *als)
 A singleton where register all aliases.
template<class T >
mutable_buffer buffer (T *ptr, int size)
template<class T >
mutable_buffer buffer (T *ptr)
template<class T >
const_buffer buffer (const T *ptr, int size)
template<class T >
const_buffer buffer (const T *ptr)
const_buffer buffer (const std::string &s)
light_string operator+ (const light_string &a, const char *str)
light_string operator+ (const light_string &a, const light_string &b)
template<class T >
sprint::detail::const_ref< T > ref (const T &ptr)
 utility to creare const_ref object
template<class T >
sprint::detail::ref< T > ref (T &ptr)
 utility to create ref object
template<class T >
void add_ref (T *obj)
 increase reference count
template<class T >
void release (T *obj)
 decrease reference count. when ref_count reaches 0 the object is detroyed using delete
template<class P1 >
tuple1< P1 > make_tuple (const P1 &p1)
template<class P1 , class P2 >
tuple2< P1, P2 > make_tuple (const P1 &p1, const P2 &p2)
template<class P1 , class P2 , class P3 >
tuple3< P1, P2, P3 > make_tuple (const P1 &p1, const P2 &p2, const P3 &p3)
template<class P1 , class P2 , class P3 , class P4 >
tuple4< P1, P2, P3, P4 > make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
template<class P1 , class P2 , class P3 , class P4 , class P5 >
tuple5< P1, P2, P3, P4, P5 > make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
tuple6< P1, P2, P3, P4, P5, P6 > make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
tuple7< P1, P2, P3, P4, P5, P6,
P7 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
tuple8< P1, P2, P3, P4, P5, P6,
P7, P8 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
tuple9< P1, P2, P3, P4, P5, P6,
P7, P8, P9 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
tuple10< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
tuple11< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10, P11 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10, const P11 &p11)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 >
tuple12< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10, P11, P12 > 
make_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10, const P11 &p11, const P12 &p12)
template<class P1 >
tuple1< P1 > * new_tuple (const P1 &p1)
template<class P1 , class P2 >
tuple2< P1, P2 > * new_tuple (const P1 &p1, const P2 &p2)
template<class P1 , class P2 , class P3 >
tuple3< P1, P2, P3 > * new_tuple (const P1 &p1, const P2 &p2, const P3 &p3)
template<class P1 , class P2 , class P3 , class P4 >
tuple4< P1, P2, P3, P4 > * new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4)
template<class P1 , class P2 , class P3 , class P4 , class P5 >
tuple5< P1, P2, P3, P4, P5 > * new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
tuple6< P1, P2, P3, P4, P5, P6 > * new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
tuple7< P1, P2, P3, P4, P5, P6,
P7 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
tuple8< P1, P2, P3, P4, P5, P6,
P7, P8 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
tuple9< P1, P2, P3, P4, P5, P6,
P7, P8, P9 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
tuple10< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
tuple11< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10, P11 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10, const P11 &p11)
template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 >
tuple12< P1, P2, P3, P4, P5,
P6, P7, P8, P9, P10, P11, P12 > * 
new_tuple (const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, const P7 &p7, const P8 &p8, const P9 &p9, const P10 &p10, const P11 &p11, const P12 &p12)
template<class R >
function0< R > * bind (R(*fn)())
 binding function to allocate a function0 object from a ptr function and 0 its parameters
template<class R , class P1 >
function0< R > * bind (R(*fn)(P1), P1 p1)
 binding function to allocate a function0 object from a ptr function and 1 its parameters
template<class R , class P1 , class P2 >
function0< R > * bind (R(*fn)(P1, P2), P1 p1, P2 p2)
 binding function to allocate a function0 object from a ptr function and 2 its parameters
template<class R , class P1 , class P2 , class P3 >
function0< R > * bind (R(*fn)(P1, P2, P3), P1 p1, P2 p2, P3 p3)
 binding function to allocate a function0 object from a ptr function and 3 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4), P1 p1, P2 p2, P3 p3, P4 p4)
 binding function to allocate a function0 object from a ptr function and 4 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 binding function to allocate a function0 object from a ptr function and 5 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 binding function to allocate a function0 object from a ptr function and 6 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6, P7), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 binding function to allocate a function0 object from a ptr function and 7 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6, P7, P8), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 binding function to allocate a function0 object from a ptr function and 8 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6, P7, P8, P9), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
 binding function to allocate a function0 object from a ptr function and 9 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
 binding function to allocate a function0 object from a ptr function and 10 its parameters
template<class R , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
function0< R > * bind (R(*fn)(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
 binding function to allocate a function0 object from a ptr function and 11 its parameters
int blend (imageview &dst, int x, int y, const imageview &src)
int blend (imageview &dst, int x, int y, const imageview &src, int x0, int y0, int width, int height)
int blend (imageview &dst, int x, int y, const imageview &src, unsigned int factor)
int blend (imageview &dst, int x, int y, const imageview &src, int x0, int y0, int width, int height, unsigned int color)
bool read_bmp (sprint::io::xstream *in, sprint::iimage *image)
 read a image from a bmp file
bool write_bmp (sprint::io::xstream *out, const imageview &image)
 save a image onto a bmp file
bool convert (sprint::imageview &dst, const sprint::imageview &src)
bool convert (sprint::iimage &dst, const sprint::imageview &src, int image_type)
bool convert (sprint::iimage &dst, const sprint::imageview &src, int *image_type)
bool copy (imageview &dst, const imageview &src)
 copy entire surface. both buffer must be allocated
bool copy (imageview &dst, const imageview &src, int x0, int y0)
bool copy (imageview &dst, int x0, int y0, const imageview &src)
bool copy (imageview &dst, int x, int y, const imageview &src, int x0, int y0, int width, int height)
int pixel (imageview &image, int x0, int y0, unsigned int color)
int line (imageview &image, int x0, int y0, int x1, int y1, unsigned int color, unsigned int thikness=1)
int circle (imageview &image, int x0, int y0, int radius, unsigned int color)
int circumference (imageview &image, int x0, int y0, int radius, unsigned int color, unsigned int thikness=1)
int box (imageview &image, int x0, int y0, int x1, int y1, unsigned int color)
int rectangle (imageview &image, int x0, int y0, int x1, int y1, unsigned int color, unsigned int thikness=1)
int triangle (imageview &image, int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color)
int polygon (imageview &image, int *x, int *y, unsigned int color)
int apoint (imageview &image, float x0, float y0, float size, unsigned int color, float thikness=1.0f)
int aline (imageview &image, float x0, float y0, float x1, float y1, unsigned int color, float thikness=1.0f)
void print (imageview &dst, int x, int y, const char *text, unsigned int color, const font &font, int text_align=TextAlign_Default)
 draw a text on a image
bool read_gif (const char *filename, sprint::iimage *image)
 read a image from a gif file
bool write_gif (const char *filename, const sprint::imageview &image, int compression_level=-1)
 save a image onto a gif file
void delete_heap_image_buffer (iimage *)
 delete heap image buffer
void alloc_heap_image_buffer (iimage *)
 alloc heap image buffer
void dummy_image_buffer (iimage *)
 do nothing (user must release memory)
void copy (sprint::iimage &dst, const sprint::imageview &src)
 copy the image (the two images are formally separated)
void copy (sprint::iimage &dst, const sprint::imageview &src, int x0, int y0, int x1, int y1)
 copy a subpart of the image
void register_image_io (read_image_proc *in, write_image_proc *out, const char *ext, int image_id=-1)
 register a IO image proc
bool read_image (const char *filename, sprint::iimage *image, int image_id=-1)
bool write_image (const char *filename, const sprint::imageview &image, int image_id=-1)
bool read_jpeg (sprint::io::xstream *in, sprint::iimage *image)
bool write_jpeg (sprint::io::xstream *out, const sprint::imageview &image, unsigned int quality=90)
bool read_jpeg (const char *filename, sprint::iimage *image)
 read a jpeg from file
bool write_jpeg (const char *filename, const sprint::imageview &image, unsigned int quality=90)
 write a jpeg to file
bool write_jpeg (sprint::io::xstream *out, sprint::gtl::CBitmapHandle hbmp, int quality=90)
 Save a BMP.
bool read_png (sprint::io::xstream *in, sprint::iimage *image)
bool write_png (sprint::io::xstream *out, const imageview &image, int compression_level=-1)
 save a image onto a png file
bool write_png (sprint::io::xstream *out, sprint::gtl::CBitmapHandle hbmp, int compression_level=-1)
 Save a BMP object.
bool write_png (sprint::io::xstream *out, unsigned int width, long stride, unsigned int height, int color_type, const unsigned char *data, int compression_level=-1)
int raw_convert (unsigned char *dst, int dst_type, const unsigned char *src, int src_type, int pixelcount)
 convert a raw array of pixels
bool resize (sprint::imageview &dst, const sprint::imageview &src, InterpolationAlgorithm algorithm=Trilinear)
 resize src in dst
void SurfaceToImage (sprint::imageview &target, const SDL_Surface *src)
bool read_tga (sprint::io::xstream *in, sprint::iimage *image)
 read a image from a tga file
bool write_tga (sprint::io::xstream *out, const imageview &image, bool rle, bool topdown)
 save a image onto a tga file
bool read_tga (const char *filename, sprint::iimage *image)
 read a image from a tga file
bool write_tga (const char *filename, const imageview &image, bool rle, bool topdown)
 save a image onto a tga file
bool read_tiff (sprint::io::xstream *in, sprint::iimage *image)
 read a image from a tiff file
bool write_tiff (sprint::io::xstream *out, const imageview &image, int compression_mode=-1)
 save a image onto a tiff file
template<class _Ostream , class R >
void _out_stream (_Ostream &d, const R &obj)
bool socket_bind (SOCKET s, WORD wPort)
 bind socket to all local interface with port wPort
bool socket_connect (SOCKET s, LPCSTR server_name, WORD port)
 connect socket s with server_name:port
bool socket_accept (SOCKET s, SOCKET *target, sockaddr_in &addr)
 accept an incoming connection
int aff_write (SOCKET s, const char *mem, unsigned int len)
int aff_read (SOCKET desc, char *buffer, unsigned int len)
LPCSTR IdentifyError (UINT error)
int print_sockerr ()
BOOL CreateSocketAddress (sockaddr_in *target, LPCSTR server_name, UINT port)
BOOL CreateSocketByHostName (sockaddr_in *target, LPCSTR host_name)
SOCKET CreateBindSocket (WORD wPort, int type)
SOCKET ConnectToLocalHost (UINT port)
SOCKET ConnectToServer (sockaddr_in *target, int type)
SOCKET AcceptConnection (UINT port)
SOCKET ConnectToServerByName (LPCSTR server_name, WORD port, int type)
template<class _Stream , class _Storage >
int read_until (_Stream &b, _Storage &s, char c, int max_read_size=1048576)
template<class _S >
int readsome (_S &s, char *buffer, int len)
template<class T >
void transpose (T &dst, const T &src)
template<typename A , typename B , typename C >
bool multiply (C &out, const A &a, const B &b)
bool runtime_cast (ref_any &D, const ref_any &S)
template<class T >
runtime_cast (const ref_any &S)
void my_luaL_register (lua_State *L, const luaL_Reg *)
 register a table
template<class T >
Type rtti ()
 method to convert statically from a Type to a global Identifier
template<>
Type rtti< void > ()
template<>
Type rtti< char > ()
template<>
Type rtti< unsigned char > ()
template<>
Type rtti< int > ()
template<>
Type rtti< unsigned int > ()
template<>
Type rtti< float > ()
template<>
Type rtti< double > ()
template<>
Type rtti< char * > ()
template<class D , class S >
smart_cast (S s)
 default convert: static_cast
template<class D , class S , class P >
smart_cast (S s, P p)
 a conversion with a parameter
template<>
int smart_cast< int, const char * > (const char *str)
template<>
int smart_cast< int, std::string > (std::string str)
template<>
int smart_cast< int, char * > (char *str)
template<>
unsigned int smart_cast< unsigned int, const char * > (const char *str)
template<>
unsigned int smart_cast< unsigned int, std::string > (std::string str)
template<>
unsigned int smart_cast< unsigned int, char * > (char *str)
template<>
long smart_cast< long, const char * > (const char *str)
template<>
long smart_cast< long, std::string > (std::string str)
template<>
long smart_cast< long, char * > (char *str)
template<>
unsigned long smart_cast< unsigned long, const char * > (const char *str)
template<>
unsigned long smart_cast< unsigned long, char * > (char *str)
template<>
float smart_cast< float, const char * > (const char *str)
template<>
float smart_cast< float, std::string > (std::string str)
template<>
float smart_cast< float, char * > (char *str)
template<>
double smart_cast< double, const char * > (const char *str)
template<>
double smart_cast< double, std::string > (std::string str)
template<>
bool smart_cast< bool, std::string > (std::string str)
template<>
const char * smart_cast< const char *, std::string > (std::string str)
template<>
std::string smart_cast< std::string, bool > (bool value)
template<>
const char * smart_cast< const char *, bool > (bool value)
template<>
double smart_cast< double, char * > (char *str)
template<>
std::string smart_cast< std::string, int > (int n)
template<>
std::string smart_cast< std::string, unsigned int > (unsigned int n)
template<>
std::string smart_cast< std::string, long int > (long int n)
template<>
std::string smart_cast< std::string, unsigned long int > (unsigned long int n)
template<>
std::string smart_cast< std::string, double > (double n)
template<>
std::string smart_cast< std::string, double > (double n, int d)
template<>
std::string smart_cast< std::string, float > (float n)
template<>
std::string smart_cast< std::string, float > (float n, int d)
template<class _S >
_S trim (const _S &src)
template<class _S >
_S trim (const _S &src, int start)
template<class _S >
_S right_trim (const _S &src)
bool iequals (const char *a, const char *b)
 compare insensitive two zero-terminate char array
template<class _S >
bool iequals (const _S &a, const char *b)
 compare insentive one string and a char array
template<class _S >
bool iequals (const char *a, const _S &b)
 compare insentive one string and a char array
template<class _S >
bool iequals (const _S &a, const _S &b)
template<typename T , typename R , R(T::*)(void) F>
thread_function thread_bind (T *obj)
template<class R >
thread_function thread_bind (R(*Proc)())
 instantiate a 0 parameters thread callback
template<>
thread_function thread_bind (void(*Proc)())
template<class R , class A1 , class P1 >
thread_function thread_bind (R(*Proc)(A1), P1 p1)
 instantiate a 1 parameters thread callback
template<class A1 , class P1 >
thread_function thread_bind (void(*Proc)(A1), P1 p1)
template<class R , class A1 , class A2 , class P1 , class P2 >
thread_function thread_bind (R(*Proc)(A1, A2), P1 p1, P2 p2)
 instantiate a 2 parameters thread callback
template<class A1 , class A2 , class P1 , class P2 >
thread_function thread_bind (void(*Proc)(A1, A2), P1 p1, P2 p2)
template<class R , class A1 , class A2 , class A3 , class P1 , class P2 , class P3 >
thread_function thread_bind (R(*Proc)(A1, A2, A3), P1 p1, P2 p2, P3 p3)
 instantiate a 3 parameters thread callback
template<class A1 , class A2 , class A3 , class P1 , class P2 , class P3 >
thread_function thread_bind (void(*Proc)(A1, A2, A3), P1 p1, P2 p2, P3 p3)
template<class R , class A1 , class A2 , class A3 , class A4 , class P1 , class P2 , class P3 , class P4 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4), P1 p1, P2 p2, P3 p3, P4 p4)
 instantiate a 4 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class P1 , class P2 , class P3 , class P4 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4), P1 p1, P2 p2, P3 p3, P4 p4)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class P1 , class P2 , class P3 , class P4 , class P5 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 instantiate a 5 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class P1 , class P2 , class P3 , class P4 , class P5 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 instantiate a 6 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6, A7), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 instantiate a 7 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6, A7), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 instantiate a 8 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
 instantiate a 9 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
 instantiate a 10 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
template<class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
thread_function thread_bind (R(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
 instantiate a 11 parameters thread callback
template<class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class A10 , class A11 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
thread_function thread_bind (void(*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11), P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
template<class T , class R >
thread_function thread_bind (R(T::*Proc)(), T *_this)
 instantiate a 0 parameters thread callback
template<class T , class R , class A1 , class P1 >
thread_function thread_bind (R(T::*Proc)(A1), T *_this, P1 p1)
 instantiate a 1 parameters thread callback
template<class T , class R , class A1 , class A2 , class P1 , class P2 >
thread_function thread_bind (R(T::*Proc)(A1, A2), T *_this, P1 p1, P2 p2)
 instantiate a 2 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class P1 , class P2 , class P3 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3), T *_this, P1 p1, P2 p2, P3 p3)
 instantiate a 3 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class P1 , class P2 , class P3 , class P4 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4), T *_this, P1 p1, P2 p2, P3 p3, P4 p4)
 instantiate a 4 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class A5 , class P1 , class P2 , class P3 , class P4 , class P5 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4, A5), T *_this, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
 instantiate a 5 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4, A5, A6), T *_this, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
 instantiate a 6 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4, A5, A6, A7), T *_this, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
 instantiate a 7 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4, A5, A6, A7, A8), T *_this, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
 instantiate a 8 parameters thread callback
template<class T , class R , class A1 , class A2 , class A3 , class A4 , class A5 , class A6 , class A7 , class A8 , class A9 , class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
thread_function thread_bind (R(T::*Proc)(A1, A2, A3, A4, A5, A6, A7, A8, A9), T *_this, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
 instantiate a 9 parameters thread callback
void msleep (int msec)
 Milliseconds sleep.
void sleep (int sec)
 seconds sleep
void usleep (int usec)
 microseconds sleep (
BOOL mcast_add_membership (SOCKET sd, LPCSTR mcastgroup, struct ip_mreq *pmreq)
BOOL mcast_drop_membership (SOCKET sd, struct ip_mreq *pmreq)

Variables

Type of Image supported by this framework
int image_byte_per_pixel [TYPE_LAST]
 Table for Bytes per Pixel.

Detailed Description

Sprint is a lightweight c++ library to handle different task with crossplatform attention (trying to compile both on MSVC and Mingw on WIn32 and GCC on Linux.


Enumeration Type Documentation

Enumerator:
Nearest 

fastest

Bilinear 

fasters for upsampling

Bicubic 

good for upsampling

Trilinear 

good for downsampling and upsampling

A reduced set of type in order to serialize data over a network or describe an interface.

Enumerator:
Void 

a dummy value

RGB24 

RGB color.

RGBA32 

RGBA color.

Float 

32 bit floating point

Double 

64 bit floating point

String 

char * null terminated

Vector 

a list of elements

Pair 

a couple key,value

Enum 

special multiple choice


Function Documentation

SOCKET sprint::AcceptConnection ( UINT  port)

crea un socket in ascolto su una porta

int sprint::aff_read ( SOCKET  desc,
char *  buffer,
unsigned int  len 
)

Legge in maniera affidabile il buffer

Returns:
-1 se ci sono stati errori, altrimenti len
int sprint::aff_write ( SOCKET  s,
const char *  mem,
unsigned int  len 
)

Scrive in maniera affidabile il buffer

Returns:
0 se e' stato scritto tutto, altrimenti -1
int sprint::aline ( imageview &  image,
float  x0,
float  y0,
float  x1,
float  y1,
unsigned int  color,
float  thikness = 1.0f 
)

draw a line

int sprint::apoint ( imageview &  image,
float  x0,
float  y0,
float  size,
unsigned int  color,
float  thikness = 1.0f 
)

draw a single point

int sprint::blend ( imageview &  dst,
int  x,
int  y,
const imageview &  src 
)

merge content of image src in (x,y) of image dest with alpha channel or trasparent color

int sprint::blend ( imageview &  dst,
int  x,
int  y,
const imageview &  src,
int  x0,
int  y0,
int  width,
int  height 
)

merge content of image src in (x,y) of image dest with alpha channel

int sprint::blend ( imageview &  dst,
int  x,
int  y,
const imageview &  src,
unsigned int  factor 
)

merge content of image src in (x,y) of image dest with a multiplication factor (per channel)

int sprint::blend ( imageview &  dst,
int  x,
int  y,
const imageview &  src,
int  x0,
int  y0,
int  width,
int  height,
unsigned int  color 
)

blend an opacity image subpart in x,y

Parameters:
srcdeve essere un greyscale o rgba. greyscale usa color come blending factor, rgba usa il canale alpha
int sprint::box ( imageview &  image,
int  x0,
int  y0,
int  x1,
int  y1,
unsigned int  color 
)

draw a box

template<class T >
mutable_buffer sprint::buffer ( T *  ptr)

allocate a mutable buffer from a T object

template<class T >
mutable_buffer sprint::buffer ( T *  ptr,
int  size 
)

allocate a mutable buffer from a T array

template<class T >
const_buffer sprint::buffer ( const T *  ptr,
int  size 
)

allocate a const buffer from a T array

template<class T >
const_buffer sprint::buffer ( const T *  ptr)

allocate a const buffer from a T object

const_buffer sprint::buffer ( const std::string &  s)

allocate a const_buffer from a stl std::string

int sprint::circle ( imageview &  image,
int  x0,
int  y0,
int  radius,
unsigned int  color 
)

draw a filled circle

int sprint::circumference ( imageview &  image,
int  x0,
int  y0,
int  radius,
unsigned int  color,
unsigned int  thikness = 1 
)

draw a circumference

SOCKET sprint::ConnectToLocalHost ( UINT  port)

crea un socket si collega con un socket in ascolto sul computer corrente

SOCKET sprint::ConnectToServer ( sockaddr_in *  target,
int  type 
)

crea un socket si collega a un target

SOCKET sprint::ConnectToServerByName ( LPCSTR  server_name,
WORD  port,
int  type 
)

crea un socket e si collega a un server

bool sprint::convert ( sprint::iimage dst,
const sprint::imageview src,
int  image_type 
)

convert an image from src to dst allocating surface

Returns:
true if conversion is possible
     sprint::convert(dstImg, srcImg, TYPE_GREYSCALE8);
bool sprint::convert ( sprint::iimage dst,
const sprint::imageview src,
int *  image_type 
)

convert an image from src to dst allocating surface with a list of possible image_type in this case will be choosen the best conversion between src a image_type(s).

bool sprint::convert ( sprint::imageview dst,
const sprint::imageview src 
)

Convert an image from src to dst format alredy allocated

Returns:
true if conversion is possibile
bool sprint::copy ( imageview &  dst,
const imageview &  src,
int  x0,
int  y0 
)

copy the image contain (the the image are formally separated) this image should be allocated copy a subpart of a image (starting from x0,y0) x0,y0 to x0+dstwidth y0+dstheight

bool sprint::copy ( imageview &  dst,
int  x0,
int  y0,
const imageview &  src 
)

copy in dst x0, y0, image src srcwidth, srcheight dst(x0,y0) - (x0+srcwidth,y0+srcheight) - (0,0) - (src width, src height) copy content of image src in (x,y) of image dest ignoring alpha channel or trasparent color

bool sprint::copy ( imageview &  dst,
int  x,
int  y,
const imageview &  src,
int  x0,
int  y0,
int  width,
int  height 
)

copy subpart of image src in (x,y) of image dest ignoring alpha channel or trasparent color

template<class D , class S >
void sprint::copy ( D &  dst,
const S &  src,
unsigned int  len 
)

Copia tra due array o std::vector Questa non \`e una semplice copia come fa std::copy ma e' un `generator', che a differenza di std::generator permette sia di usare vector e array oltre a funzioni proprietarie.

 copy(dst,src,20);
Note:
i prerequisiti e' che src sia un oggetto che ammette l'operator [ ] con l'indice dell'elemento da copiare
SOCKET sprint::CreateBindSocket ( WORD  wPort,
int  type 
)

Crea un socket in ascolto sulla porta wPort

BOOL sprint::CreateSocketByHostName ( sockaddr_in *  target,
LPCSTR  host_name 
)
Note:
questa funzione a differenza dall'altra perche' usa la sintassi [nome]:[porta]
LPCSTR sprint::IdentifyError ( UINT  error)

Error. Convert error in un human readable string

int sprint::line ( imageview &  image,
int  x0,
int  y0,
int  x1,
int  y1,
unsigned int  color,
unsigned int  thikness = 1 
)

draw a line

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 >
tuple12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10,
const P11 &  p11,
const P12 &  p12 
)

helping function to create a tuple12 object

template<class P1 >
tuple1<P1> sprint::make_tuple ( const P1 &  p1)

helping function to create a tuple1 object

template<class P1 , class P2 >
tuple2<P1, P2> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2 
)

helping function to create a tuple2 object

template<class P1 , class P2 , class P3 >
tuple3<P1, P2, P3> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3 
)

helping function to create a tuple3 object

template<class P1 , class P2 , class P3 , class P4 >
tuple4<P1, P2, P3, P4> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4 
)

helping function to create a tuple4 object

template<class P1 , class P2 , class P3 , class P4 , class P5 >
tuple5<P1, P2, P3, P4, P5> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5 
)

helping function to create a tuple5 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
tuple6<P1, P2, P3, P4, P5, P6> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6 
)

helping function to create a tuple6 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
tuple7<P1, P2, P3, P4, P5, P6, P7> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7 
)

helping function to create a tuple7 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
tuple8<P1, P2, P3, P4, P5, P6, P7, P8> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8 
)

helping function to create a tuple8 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
tuple9<P1, P2, P3, P4, P5, P6, P7, P8, P9> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9 
)

helping function to create a tuple9 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
tuple10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10 
)

helping function to create a tuple10 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
tuple11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11> sprint::make_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10,
const P11 &  p11 
)

helping function to create a tuple11 object

template<typename A , typename B , typename C >
bool sprint::multiply ( C &  out,
const A &  a,
const B &  b 
)

Moltiplicazione tra matrici (Visual Studio questa la capisce)

template<class P1 >
tuple1<P1>* sprint::new_tuple ( const P1 &  p1)

helping function to allocate a tuple1 object

template<class P1 , class P2 >
tuple2<P1, P2>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2 
)

helping function to allocate a tuple2 object

template<class P1 , class P2 , class P3 >
tuple3<P1, P2, P3>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3 
)

helping function to allocate a tuple3 object

template<class P1 , class P2 , class P3 , class P4 >
tuple4<P1, P2, P3, P4>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4 
)

helping function to allocate a tuple4 object

template<class P1 , class P2 , class P3 , class P4 , class P5 >
tuple5<P1, P2, P3, P4, P5>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5 
)

helping function to allocate a tuple5 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 >
tuple7<P1, P2, P3, P4, P5, P6, P7>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7 
)

helping function to allocate a tuple7 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 >
tuple6<P1, P2, P3, P4, P5, P6>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6 
)

helping function to allocate a tuple6 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 >
tuple8<P1, P2, P3, P4, P5, P6, P7, P8>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8 
)

helping function to allocate a tuple8 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 >
tuple9<P1, P2, P3, P4, P5, P6, P7, P8, P9>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9 
)

helping function to allocate a tuple9 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 >
tuple10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10 
)

helping function to allocate a tuple10 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 >
tuple11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10,
const P11 &  p11 
)

helping function to allocate a tuple11 object

template<class P1 , class P2 , class P3 , class P4 , class P5 , class P6 , class P7 , class P8 , class P9 , class P10 , class P11 , class P12 >
tuple12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>* sprint::new_tuple ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3,
const P4 &  p4,
const P5 &  p5,
const P6 &  p6,
const P7 &  p7,
const P8 &  p8,
const P9 &  p9,
const P10 &  p10,
const P11 &  p11,
const P12 &  p12 
)

helping function to allocate a tuple12 object

int sprint::pixel ( imageview &  image,
int  x0,
int  y0,
unsigned int  color 
)

convert an RGBA color uint32 in native format ??? draw a single point (color is native surface color)

int sprint::polygon ( imageview &  image,
int *  x,
int *  y,
unsigned int  color 
)

draw a polygon fan

int sprint::print_sockerr ( )

print in stdout current socket error

bool sprint::read_image ( const char *  filename,
sprint::iimage image,
int  image_id = -1 
)

read image from file use extension if image_id = -1

bool sprint::read_jpeg ( sprint::io::xstream in,
sprint::iimage image 
)

read a jpeg from an xstream

bool sprint::read_png ( sprint::io::xstream in,
sprint::iimage image 
)

read a image from a png file

    sprint::iimage img;
    sprint::io::xfile in("image.png", sprint::io::read);
    sprint::read_png(&in, &img);
template<class _Stream , class _Storage >
int sprint::read_until ( _Stream &  b,
_Storage &  s,
char  c,
int  max_read_size = 1048576 
)

user function used to read the character c goes inside TODO: get with timeout?

      sprint::read_until( m_io, storage, '\n');
template<class _S >
int sprint::readsome ( _S &  s,
char *  buffer,
int  len 
)

reliable read from a stream: read effective len bytes

 char buffer[256];
 readsome(MyStream, buffer, 256);
int sprint::rectangle ( imageview &  image,
int  x0,
int  y0,
int  x1,
int  y1,
unsigned int  color,
unsigned int  thikness = 1 
)

draw a rectangle

template<class _S >
_S sprint::right_trim ( const _S &  src)

trim remove CR LF SP TAB at the end of a string

bool sprint::runtime_cast ( ref_any &  D,
const ref_any &  S 
)

runtime cast from S to D

template<class T >
T sprint::runtime_cast ( const ref_any &  S)

runtime cast a ref_any object S in T

template<class D , class S >
void sprint::set ( D &  dst,
const S  value,
unsigned int  len 
)

Set an array (or a std::vector)

 set(dst,1,20);
template<typename T , typename R , R(T::*)(void) F>
thread_function sprint::thread_bind ( T *  obj)

instantiate a thread callback from an hardcoded mem fun obj an instance of object T is a Class Name R is the Function Return Type (important to match) F is a member function

 th.create_thread(sprint::thread_bind<ServerCom,DWORD,&ServerCom::Thread>(this));
Note:
NO HEAP fragmentation: viene creata una funzione trampolino per ogni funzione thread
template<class T >
void sprint::transpose ( T &  dst,
const T &  src 
)

traspose a matrix

int sprint::triangle ( imageview &  image,
int  x0,
int  y0,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned int  color 
)

draw a triangle

template<class _S >
_S sprint::trim ( const _S &  src,
int  start 
)

trim remove CR LF SP TAB at begin (from start) and at the end of a string

template<class _S >
_S sprint::trim ( const _S &  src)

trim remove CR LF SP TAB at begin and at the end of a string

void sprint::usleep ( int  usec)

microseconds sleep (

bool sprint::write_image ( const char *  filename,
const sprint::imageview image,
int  image_id = -1 
)

write image to file use extension if image_id = -1

bool sprint::write_jpeg ( sprint::io::xstream out,
const sprint::imageview image,
unsigned int  quality = 90 
)

write a jpeg onto an xstream

bool sprint::write_png ( sprint::io::xstream out,
unsigned int  width,
long  stride,
unsigned int  height,
int  color_type,
const unsigned char *  data,
int  compression_level = -1 
)

TODO: gestire meglio il color_type

Parameters:
color_type0: grey 2: RGB
   sprint::io::xfile out("out.png", sprint::io::write);
   write_png(&out, width, width*3, height, 2, data);
template<class D >
void sprint::zero ( D *  dst,
unsigned int  len 
)

Set an array at the default

 zero(dst,20);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines