Table of Contents

NAME

QccIMGImageComponentClipPixel, QccIMGImageComponentClip, QccIMGImageComponentNormalize - clip and normalize image component

SYNOPSIS

#include "libQccPack.h"

double QccIMGImageComponentClipPixel(double pixel_value);
int QccIMGImageComponentClip(QccIMGImageComponent *image_component);
int QccIMGImageComponentNormalize(QccIMGImageComponent *image_component);

DESCRIPTION

These routines assume that the range of permissible pixel values in image_component is be 0 to 255, which is the common range for 8-bit images.

QccIMGImageComponentClipPixel() clips a single pixel value to the 0-255 range, returning 0 for values less than 0, 255 for values greater than 255, and pixel_value itself, unchanged, for values greater than or equal to 0 and less than or equal to 255.

QccIMGImageComponentClip() calls QccIMGImageComponentClipPixel() for each pixel in image_component, effectively ensuring that each pixel in image_component is clipped to the 0-255 range.

QccIMGImageComponentNormalize() expands or contracts the dynamic range of the pixel values in image_component to the 0-255 range. QccIMGImageComponentNormalize() maps the range image_component->min_val to image_component->max_val to the range 0-255 in a linear fashion. image_component->min_val and image_component->max_val must be set correctly via a call to QccIMGImageComponentSetMaxMin(3) prior to calling QccIMGImageComponentNormalize().

RETURN VALUES

QccIMGImageComponentClip() and QccIMGImageComponentNormalize() return 0 on success and 1 on error; QccIMGImageComponentClipPixel() returns the value of the clipped pixel.

SEE ALSO

QccIMGImageComponent(3) , QccPackIMG(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads