psxdev-libs[top|sitemap|download|docs]

psxdev libs - shared libraries

Here is the programming documentation for the PSXDEV shared libraries. This documentation is not yet completed.

psxdev server library

The PSXDEV server library (libpsxdev.so) does contain commonly used code. Currently there is only but important function which is documented.
  • void psxdev_init (void);
    initialize the library.
  • int psxdev_server (int dev, int sockin, int sockout);
    This is the complete file server and I/O redirection for caetla. You can provide two file descriptors/sockets (use 0=stdin and 1=stdout) which are used as stdin and stdout streams. This allows you to connect the sockets to something more useful than shell output, just take a look at the XtAppAddInput function or any other function with the same purpose (in Gtk+, Qt, libc, ...)

TIM image format library

The TIM image library (libtim.so) lets you deal with TIM images. It aids you in accessing their contents and creating them
  • void tim_init (void);
    Initialize the library. Required.
  • tim_t *tim_new (tim_mode_t mode, u_short width, u_short height, u_short ncluts);
    Create a new TIM image with the given attributes. The image is linear mapped after the returned pointer, so if you write tim_sizeof(tim) bytes you have saved the TIM image.
  • void tim_free (tim_t *tim);
    Frees the TIM image.
  • tim_chunk_t *tim_clut_addr (tim_t *tim);
    Get the address of the CLUT in the TIM image
  • tim_chunk_t *tim_pixel_addr (tim_t *tim);
    Get the address of the first pixel in the TIM image
  • int tim_sizeof (tim_t *tim);
    Get the size in bytes of an TIM image
  • int tim_width (tim_t *tim,int ofclut);
    Get the width in pixels of a TIM image
  • int tim_height (tim_t *tim,int ofclut);
    Get the height in pixels of a TIM image
  • tim_pixel_t *tim_pixel (tim_t *tim, int x, int y);
    Get the address (16-bit pointer) for an X,Y pixel in an TIM image
  • tim_pixel_t *tim_clut (tim_t *tim, int x, int y);
    Get the address (16-bit pointer) for an X,Y CLUT entry in an TIM image
  • char *tim_get_alpha (tim_t *tim);
    This extracts the transparency plane, which is width x height bytes long. You should free this pointer with a call to free().
  • char *tim_get_rgb (tim_t *tim, int shift);
    This will convert a TIM image into a RGB image. You should free this pointer with a call to free() if it is no more needed.

BS image format library

The BS image library (libbs.so) lets you deal with BS images.
  • void bs_init (void);
    Initialize the library. Required.
  • int bs_encode (bs_header_t *outbuf,bs_input_image_t *img,int type,int q_scale,unsigned char *myiqtab);
    Encode a raw 24-bit RGB buffer directly into a BS image
  • void bs_decode_rgb24 (unsigned char *outbuf,bs_header_t *img,int width, int height,unsigned char *myiqtab);
    Decode a BS image into a raw 24-bit RGB buffer
  • void bs_decode_rgb15 (unsigned short *outbuf,bs_header_t *img,int width, int height,unsigned char *myiqtab);
    Decode a BS image into a raw 15-bit RGB buffer (*untested*)


Created with psxdev.pl
Copyright ©2000 by Daniel Balster