The "imw" Package

These routines provide a means to convert from image data to raw images suitable for low level graphics display. Although these routines are made public, their use is NOT recommended. The viewimg package is the suggested means to manage image display.

Library: karma
Link With: -lkarma

Functions

imw_to8_lossyConvert generic image to 8 bit image, with resizing.
imw_to8_magnifyConvert generic image to 8 bit image, increasing size.
imw_to8_oiConvert generic image to 8 bit image, preserving size.
imw_scmap_16to24_lossyWrite 16bit image to a 24bit image using a software colourmap.
imw_scmap_16to24_oWrite 16bit image to a 24bit image using a software colourmap.

Prototype Functions

imw_PROTO_iscale_funcIntensity scaling callback.


Functions


flag imw_to8_lossy (unsigned char *out_image, iaddr out_hstride, iaddr out_vstride, int out_width, int out_height, CONST char *inp_image, CONST iaddr *inp_hoffsets, CONST iaddr *inp_voffsets, int inp_width, int inp_height, unsigned int inp_type, unsigned int conv_type, unsigned int num_pixels, CONST unsigned char *pixel_values, unsigned char blank_pixel, unsigned char min_sat_pixel, unsigned char max_sat_pixel, double i_min, double i_max, flag (*iscale_func) (), void *iscale_info)

This routine will convert an image from one format to an 8 bit image of pixels, permitting the input and output sizes to differ. If the input image is effectively shrunk, the input data is subsampled. The output image is flipped vertically relative to the input image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe.


EXPERIMENTAL FUNCTION: subject to change without notice

flag imw_to8_magnify (unsigned char *out_image, iaddr out_hstride, iaddr out_vstride, int inp_width, int inp_height, int mag_factor, CONST char *inp_image, CONST iaddr *inp_hoffsets, CONST iaddr *inp_voffsets, unsigned int inp_type, unsigned int conv_type, unsigned int num_pixels, CONST unsigned char *pixel_values, unsigned char blank_pixel, unsigned char min_sat_pixel, unsigned char max_sat_pixel, double i_min, double i_max, flag (*iscale_func) (), void *iscale_info)

This routine will convert an image from one format to an 8 bit image of pixels, maintaining the aspect ratio of the original image and magnifying. The output image is flipped vertically relative to the input image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe.


flag imw_to8_oi (unsigned char *out_image, iaddr out_hstride, iaddr out_vstride, int width, int height, CONST char *inp_image, CONST iaddr *inp_hoffsets, CONST iaddr *inp_voffsets, unsigned int inp_type, unsigned int conv_type, unsigned int num_pixels, CONST unsigned char *pixel_values, unsigned char blank_pixel, unsigned char min_sat_pixel, unsigned char max_sat_pixel, double i_min, double i_max, flag (*iscale_func) (), void *iscale_info)

This routine will convert an image from one format to an 8 bit image of pixels, maintaining the original image size. The output image is flipped vertically relative to the input image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe.


EXPERIMENTAL FUNCTION: subject to change without notice

flag imw_scmap_16to24_lossy (unsigned char *out_red_image, unsigned char *out_green_image, unsigned char *out_blue_image, flag preserve_pad, iaddr out_hstride, iaddr out_vstride, int out_width, int out_height, CONST unsigned short *inp_image, int inp_width, int inp_height, CONST iaddr *inp_hoffsets, CONST iaddr *inp_voffsets, CONST unsigned char *cmap_red, CONST unsigned char *cmap_green, CONST unsigned char *cmap_blue, iaddr cmap_stride)

This routine will write a 16bit PseudoColour image into a 24bit TrueColour image using a software colourmap to convert 16bit values to 24bit RGB values. The input and output sizes may be different. The output image is flipped vertically relative to the input image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe.


EXPERIMENTAL FUNCTION: subject to change without notice

flag imw_scmap_16to24_o (unsigned char *out_red_image, unsigned char *out_green_image, unsigned char *out_blue_image, flag preserve_pad, iaddr out_hstride, iaddr out_vstride, int width, int height,CONST unsigned short *inp_image, CONST iaddr *inp_hoffsets, CONST iaddr *inp_voffsets, CONST unsigned char *cmap_red, CONST unsigned char *cmap_green, CONST unsigned char *cmap_blue, iaddr cmap_stride)

This routine will write a 16bit PseudoColour image into a 24bit TrueColour image using a software colourmap to convert 16bit values to 24bit RGB values. The image size (in pixels) is preserved. The output image is flipped vertically relative to the input image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Safe.


Prototype Functions


flag imw_PROTO_iscale_func (double *out, unsigned int out_stride, CONST double *inp, unsigned int inp_stride, unsigned int num_values, double i_min, double i_max, void *info)

This routine will perform an arbitrary intensity scaling on an array of values. This routine may be called many times to scale an image.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services