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_lossy | Convert generic image to 8 bit image, with resizing.
|
imw_to8_oi | Convert generic image to 8 bit image, preserving size.
|
Prototype Functions
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:
- out_image :
The output image will be written here.
- out_hstride :
The stride between successive horizontal pixels (in bytes).
- out_vstride :
The stride between successive vertical pixels (in bytes).
- out_width :
The width of the output image.
- out_height :
The height of the output image.
- inp_image :
The input image data.
- inp_hoffsets :
The array of horizontal byte offsets.
- inp_voffsets :
The array of vertical byte offsets.
- inp_width :
The width of the input image.
- inp_height :
The height of the input image.
- inp_type :
The type of the input data.
- conv_type :
The input conversion type (when the input is complex).
- num_pixels :
The number of pixels in the pixel array.
- pixel_values :
The array of pixel values.
- blank_pixel :
The pixel value to be used when the intensity value is an
undefined value.
- min_sat_pixel :
The pixel value to be used when the intensity value is
below the minimum value.
- max_sat_pixel :
The pixel value to be used when the intensity value is
above the maximum value.
- i_min :
The minimum intensity value.
- i_max :
The maximum intensity value.
- iscale_func :
The function to be called when non-linear intensity scaling
is required. If NULL, linear intensity scaling is used. The prototype
function is IMW_PROTO_iscale_func.
- iscale_info :
A pointer to arbitrary information for iscale_func.
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:
- out_image :
The output image will be written here.
- out_hstride :
The stride between successive horizontal pixels (in bytes).
- out_vstride :
The stride between successive vertical pixels (in bytes).
- width :
The width of the image.
- height :
The height of the image.
- inp_image :
The input image data.
- inp_hoffsets :
The array of horizontal byte offsets.
- inp_voffsets :
The array of vertical byte offsets.
- inp_type :
The type of the input data.
- conv_type :
The input conversion type (when the input is complex).
- num_pixels :
The number of pixels in the pixel array.
- pixel_values :
The array of pixel values.
- blank_pixel :
The pixel value to be used when the intensity value is an
undefined value.
- min_sat_pixel :
The pixel value to be used when the intensity value is
below the minimum value.
- max_sat_pixel :
The pixel value to be used when the intensity value is
above the maximum value.
- i_min :
The minimum intensity value.
- i_max :
The maximum intensity value.
- iscale_func :
The function to be called when non-linear intensity scaling
is required. If NULL, linear intensity scaling is used. The prototype
function is IMW_PROTO_iscale_func.
- iscale_info :
A pointer to arbitrary information for iscale_func.
Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe.
Prototype Functions
flag
IMW_PROTO_iscale_func (double *out, unsigned int out_stride,
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:
- out :
The output array.
- out_stride :
The stride (in doubles) of the output array.
- inp :
The input array.
- inp_stride :
The stride (in doubles) of the input array.
- num_values :
The number of values to scale.
- i_min :
The minimum intensity value.
- i_max :
The maximum intensity value.
- info :
A pointer to arbitrary information.
Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe
Contact: Richard Gooch
Web Development: Ariel Internet Services