Celartem::ImageUtils Namespace Reference


Classes

struct  GFScaleParam
struct  FilterParam
struct  ApplyGammaParam
struct  CutOffOutOfRangeValuesParam
struct  ExpandRangeValuesParam
struct  ApplyToneFunctionParam
struct  CacheParam
struct  ScaleParam
struct  SmoothScaleParam
struct  OverlayParam
struct  PhotometricTransformParam
struct  QualityHintParam
struct  CallbackImageParam
struct  VFZQualityParam
struct  RotateAndFlipParam

Typedefs

typedef double(* ToneFunction )(double inValue, void *inContext)

Enumerations

enum  ScalingMethod {
  KeepCurrentMethod = 0, NearestNeighbour = 1, Average = 2, Bilinear = 3,
  Bicubic = 4
}
enum  FourAngles { faAngle0 = 0, faAngle90 = 90, faAngle180 = 180, faAngle270 = 270 }

Functions

AutoPtr< ImageGFScale (Image *inImage, double inMag=1.0, size_t inSrcPanelWidth=256, size_t inSrcPanelHeight=256)
AutoPtr< ImageGFScale (Image *inImage, ssize_t inDstWidth, ssize_t inDstHeight, size_t inSrcPanelWidth=256, size_t inSrcPanelHeight=256)
AutoPtr< ImageUniformFilter (Image *inImage, const ssize_t *inFilter, size_t inDiam, size_t inNorm=0)
AutoPtr< ImageSharpness_4 (Image *inImage, size_t n=0)
AutoPtr< ImageSharpness_8 (Image *inImage, size_t n=0)
AutoPtr< ImageApplyGamma (Image *inImage, double inGamma=1.0)
AutoPtr< ImageCutOffOutOfRangeValues (Image *inImage, double inMinValue=0.0L, double inMaxValue=1.0L)
AutoPtr< ImageExpandRangeValues (Image *inImage, double inMinValue=0.0L, double inMaxValue=1.0L)
AutoPtr< ImageApplyToneFunction (Image *inImage, ToneFunction inToneFunction, void *inContext)
AutoPtr< ImageToSRGB (Image *inImage, Photometric inRgbPhotometric=pmRGB8, RenderingIntent inIntent=riPerceptual)
AutoPtr< ImagePhotometricTransform (Image *inImage, Photometric inDestPhotometric, ColorProfile *inDestProfile=NULL, ColorProfile *inSrcProfile=NULL, RenderingIntent inIntent=riPerceptual)
AutoPtr< ImageCrop (Image *inImage, const Rect &inRect)
AutoPtr< ImageScale (Image *inImage, double inMag=1.0)
AutoPtr< ImageScale (Image *inImage, ssize_t inWidth, ssize_t inHeight)
AutoPtr< ImageSmoothScale (Image *inImage, double inMag=1.0)
AutoPtr< ImageSmoothScale (Image *inImage, ssize_t inWidth, ssize_t inHeight)
AutoPtr< ImageRotateAndFlip (Image *inImage, FourAngles inAngle=faAngle0, bool inFlipVertical=false, bool inFlipHorizontal=false)
AutoPtr< ImageOverlay (Image *inBackgroundImage, Image *inOverlayImage=NULL, ssize_t inOverlayPosLeft=0, ssize_t inOverlayPosTop=0)
AutoPtr< ImageExtraMargin (Image *inImage)
AutoPtr< ImageImageCache (Image *inImage, size_t inTileWidth=256, size_t inTileHeight=256, size_t inBytesAvailable=(size_t)-1)
AutoPtr< ImageCallbackImage (Image *inImage, ProcessCallback *inCallback=NULL, size_t inResponses=10)
AutoPtr< ImageImageFromRawData (const void *inFirstLinePtr, ssize_t inRowStride, Photometric inPm, ssize_t inWidth, ssize_t inHeight, ColorProfile *inProf=NULL)
AutoPtr< ImageWritableImageBuffer (ssize_t inWidth, ssize_t inHeight, Photometric inPm=pmRGB8, ColorProfile *inProf=NULL)
AutoPtr< ImageWritableImageBuffer2 (ssize_t inWidth, ssize_t inHeight, ssize_t inRowStride, Photometric inPm=pmRGB8, ColorProfile *inProf=NULL)
AutoPtr< ImageWritableImageBuffer (Image *inImage, bool inOnTheFly=false)
AutoPtr< ImageImageMultiThread (Image *inImage, size_t inMaxThreads)


Detailed Description

ImageUtils namespace provides the functions and structures to manipulate the Image instances.
For the factory functions that creates a variety of Image instances, see Factory Functions for Image Classes and for the parameter definitions, see Image Parameter Structures.
See also:
Factory Functions for Image Classes, Image Parameter Structures

Typedef Documentation

typedef double(* Celartem::ImageUtils::ToneFunction)(double inValue, void *inContext)

This defines a prototype for the tone transfer function.

Parameters:
inValue The input value. For normal images, it can be within 0.0 to 1.0. In some cases, especially for HDR images, it can be out of range value.
inContext This value is passed by ApplyToneFunction.
See also:
ApplyToneFunction, ApplyToneFunctionParam

Definition at line 144 of file pxl_imagefilters.h.


Enumeration Type Documentation

enum Celartem::ImageUtils::FourAngles

This defines 4 special angles, which stand for 0 degree, 90 degree, 180 degree and 270 degree. They're used for transformation of the images.

Enumerator:
faAngle0  0 degree
faAngle90  90 degree
faAngle180  180 degree
faAngle270  270 degree

Definition at line 493 of file pxl_imageparam.h.

enum Celartem::ImageUtils::ScalingMethod

This enumeration is used with ScaleParam to choose the method for rescaling the image.

Enumerator:
KeepCurrentMethod  Keep the current function.
NearestNeighbour  Use Nearest Neighbour function.
Average  Use Average function.
Bilinear  Use Bilinear interpolation function.
Bicubic  Use Bicubic interpolation function.

Definition at line 107 of file pxl_imageparam.h.


Function Documentation

AutoPtr<Image> Celartem::ImageUtils::ApplyGamma ( Image *  inImage,
double  inGamma = 1.0 
)

This function creates a new Image instance that applies the specified gamma value to the input instance.

Parameters:
inGamma The gamma value.
Returns:
Pointer to the newly created Image instance.
See also:
ApplyGammaParam

ApplyToneFunction, CutOffOutOfRangeValues, ExpandRangeValues, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::ApplyToneFunction ( Image *  inImage,
ToneFunction  inToneFunction,
void *  inContext 
)

This function creates a new Image instance that applies the specified tone transfer function to the input image.

Parameters:
inToneFunction The tone transfer function.
inContext The context for the tone transfer function.
Returns:
Pointer to the newly created Image instance.
See also:
ToneFunction,

ApplyGamma, CutOffOutOfRangeValues, ExpandRangeValues, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::CallbackImage ( Image *  inImage,
ProcessCallback *  inCallback = NULL,
size_t  inResponses = 10 
)

This function creates a new Image instance that periodically calls the specified ProcessCallback instance during the process of ImageLock::read function. The instance internally divides the area requested by ImageLock::read to several areas and process them separately. This function could not deal with the Image instances created by ImageCache function.

Parameters:
inImage The input image.
inCallback Pointer to a ProcessCallback class instance.
inResponses The number of responses during the process.
Returns:
Pointer to the newly created Image instance.
Please note that if you duplicate the instance that is created by this function, each the original one and the new one calls the same ProcessCallback instance asynchronously.

See also:
CallbackImageParam, ProcessCallback, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::Crop ( Image *  inImage,
const Rect &  inRect 
)

This function creates a new Image instance that extracts a portion of the input Image. We recommend you should use this function just before export functions. You should not insert the image created by the function since the output image behaves as if it were a static image and it does not accept any parameters by the Image::setParam function. Anyway, you don't have to crop the image if you don't want to export it since PixelLive SDK does not process the whole image unless you want to do it. The extraction of the partial image can be done by ImageLock::read function.

Parameters:
inImage Specifies the base Image instance.
inRect Rect instance that indicates the portion to be extracted.
Returns:
Pointer to the newly created Image instance.
See also:
Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::CutOffOutOfRangeValues ( Image *  inImage,
double  inMinValue = 0.0L,
double  inMaxValue = 1.0L 
)

This function creates a new Image instance that cuts off out of bound values.

Parameters:
inMinValue The minimum value accepted.
inMaxValue The maximum value accepted.
Returns:
Pointer to the newly created Image instance.
See also:
CutOffOutOfRangeValuesParam

ApplyToneFunction, ApplyGamma, ExpandRangeValues, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::ExpandRangeValues ( Image *  inImage,
double  inMinValue = 0.0L,
double  inMaxValue = 1.0L 
)

This function creates a new Image instance that cuts off out of bound values and expand [min max] range to [0 1].

Parameters:
inMinValue The minimum value accepted.
inMaxValue The maximum value accepted.
Returns:
Pointer to the newly created Image instance.
See also:
ExpandRangeValuesParam

ApplyToneFunction, ApplyGamma, CutOffOutOfRangeValues, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::ExtraMargin ( Image *  inImage  ) 

This function creates a new Image instance that generates extra margins to the input Image.
Some Image classes calls the input Images's read function with the rectangle of invalid range such as (-3,-3)-(50,50). This class generates the margins for the Image classes that could not create such margins.

Parameters:
inImage Specifies the Image instance that produces the main image.
Returns:
Pointer to the newly created ExtraMargin instance.
See also:
Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::GFScale ( Image *  inImage,
ssize_t  inDstWidth,
ssize_t  inDstHeight,
size_t  inSrcPanelWidth = 256,
size_t  inSrcPanelHeight = 256 
)

GFScale provides the image scaling function, which is known as Genuine Fractals. The technology is licensed by LizardTech, Inc. To customize the parameter for GF scaling, you can use GFScaleParam .
Please note that This function is provided by PixelLive 3.0 SDK GF Add-in (not included in PixelLive 3.0 SDK).

Parameters:
inImage The image to be scaled.
inDstWidth The width of the output image in pixels.
inDstHeight The height of the output image in pixels.
inSrcPanelWidth The panel width of the input image. It affects on the quality and speed. The larger the value goes, the higher the quality grows but the processing speed gets slow. Anyway, in usual cases, you don't have to touch the parameter.
inSrcPanelHeight The panel width of the input image. It affects on the quality and speed. The larger the value goes, the higher the quality grows but the processing speed gets slow. Anyway, in usual cases, you don't have to touch the parameter.
See also:
gf-addin, Factory Functions for Image Classes, GFScaleParam, ImageLock

AutoPtr<Image> Celartem::ImageUtils::GFScale ( Image *  inImage,
double  inMag = 1.0,
size_t  inSrcPanelWidth = 256,
size_t  inSrcPanelHeight = 256 
)

GFScale provides the image scaling function, which is known as Genuine Fractals. The technology is licensed by LizardTech, Inc.
To customize the parameter for GF scaling, you can use GFScaleParam . Please note that This function is provided by PixelLive 3.0 SDK GF Add-in (not included in PixelLive 3.0 SDK).

Parameters:
inImage The image to be scaled.
inMag The scale ratio. 1.0 stands for 100%.
inSrcPanelWidth The panel width of the input image. It affects on the quality and speed. The larger the value goes, the higher the quality grows but the processing speed gets slow. Anyway, in usual cases, you don't have to touch the parameter.
inSrcPanelHeight The panel width of the input image. It affects on the quality and speed. The larger the value goes, the higher the quality grows but the processing speed gets slow. Anyway, in usual cases, you don't have to touch the parameter.
See also:
gf-addin, Factory Functions for Image Classes, GFScaleParam, ImageLock

AutoPtr<ImageWritable> Celartem::ImageUtils::ImageBuffer ( Image *  inImage,
bool  inOnTheFly = false 
)

This function creates an ImageWritable instance from the raw data ripped from the specified Image instance. The function is useful when you want to manually modify the output image from some Image chain.

Parameters:
inImage Source Image instance.
inOnTheFly If this parameter is true, the ripping is done on the fly; the duplication is by only one ImageLock::read call.
Otherwise (false), this function is done by several ImageLock::read calls to reduce the memory usage.
The default is false.
Returns:
Pointer to the newly created memory based ImageWritable instance.

AutoPtr<ImageWritable> Celartem::ImageUtils::ImageBuffer ( ssize_t  inWidth,
ssize_t  inHeight,
Photometric  inPm = pmRGB8,
ColorProfile *  inProf = NULL 
)

This function creates an ImageWritable instance based on the specified metrics.
The Image instance returned by the function already equips its own ExtraMargin implementation.

Parameters:
inWidth Width of the image.
inHeight Height of the image.
inPm Photometric of the image.
inProf ColorProfile instance to be associated.
Returns:
Pointer to the newly created Image instance.

AutoPtr<ImageWritable> Celartem::ImageUtils::ImageBuffer2 ( ssize_t  inWidth,
ssize_t  inHeight,
ssize_t  inRowStride,
Photometric  inPm = pmRGB8,
ColorProfile *  inProf = NULL 
)

This function creates an ImageWritable instance based on the specified metrics.
The Image instance returned by the function already equips its own ExtraMargin implementation.

Parameters:
inWidth Width of the image.
inHeight Height of the image.
inRowStride Row-Stride of the image. If this value is negative, the image is created as bottom-up image.
inPm Photometric of the image.
inProf ColorProfile instance to be associated.
Returns:
Pointer to the newly created Image instance.

AutoPtr<Image> Celartem::ImageUtils::ImageCache ( Image *  inImage,
size_t  inTileWidth = 256,
size_t  inTileHeight = 256,
size_t  inBytesAvailable = (size_t)-1 
)

This function creates a new Image instance that caches the data from the specified Image.

Parameters:
inImage The input image.
inTileWidth The width of each cache tile.
inTileHeight The height of each cache tile.
inBytesAvailable The memory amount that the image created by this function can use. If this value is -1, the amount is automatically set.
Returns:
Pointer to the newly created Image instance.
See also:
Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::ImageFromRawData ( const void *  inFirstLinePtr,
ssize_t  inRowStride,
Photometric  inPm,
ssize_t  inWidth,
ssize_t  inHeight,
ColorProfile *  inProf = NULL 
)

This function creates a new Image instance from the specified read-only buffer.
The buffer should be accessible during the lifetime of the returned Image instance; in other words, you should be aware of the lifetime of the buffer.
The Image instance returned by the function already equips its own ExtraMargin implementation.

Parameters:
inFirstLinePtr The pointer to the first line in the RAW data.
inRowStride The row-stride of the RAW data.
inPm The photometric of the RAW data.
inWidth Width of the image.
inHeight Height of the image.
inProf A Color Profile that describes the colorspace of the RAW data.
Returns:
Pointer to the newly created Image instance.

AutoPtr<Image> Celartem::ImageUtils::ImageMultiThread ( Image *  inImage,
size_t  inMaxThreads 
)

This function enables you to render the image with multiple threads. The image passed to this function is automatically processed with multiple threads without any complex configurations.
With the current version, MrSID images cannot be used with this function. This restriction will be fixed in the future releases.
For more information about multi-threading, see ImageLock.

Parameters:
inImage Source Image instance.
Returns:
Pointer to the newly created Image instance.
See also:
ImageLock

AutoPtr<Image> Celartem::ImageUtils::Overlay ( Image *  inBackgroundImage,
Image *  inOverlayImage = NULL,
ssize_t  inOverlayPosLeft = 0,
ssize_t  inOverlayPosTop = 0 
)

This function creates a new Image instance that overlays an Image on another Image using alpha channel.

Parameters:
inBackgroundImage The base image to be overlaid onto.
inOverlayImage The image to be overlaid.
inOverlayPosLeft 
inOverlayPosTop The overlay position. The values can exceeds the limit of the base image; they can be negative values or a values no less than width of the inBackgroundImage.
Returns:
Pointer to the newly created Image instance.
See also:
Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::PhotometricTransform ( Image *  inImage,
Photometric  inDestPhotometric,
ColorProfile *  inDestProfile = NULL,
ColorProfile *  inSrcProfile = NULL,
RenderingIntent  inIntent = riPerceptual 
)

This function creats a new Image instance that provides a colormetric transformation from the specified Image instance. This function tries the following procedures to convert colors:

If you are going to convert images to sRGB, you had better use ToSRGB function.
Please note that this function may take long time.

You can also customize the transform dynamically using PhotometricTransformParam.

Parameters:
inImage The image to be transformed.
inDestPhotometric The destination photometric.
inDestProfile The destination color profile. It can be NULL if you don't care of the conversion result. If the profile is not NULL, it must be compatible with the Photometric specified by inDestPhotometric. The compatibility of the profile is checked by ColorProfile::isCompatiblePhotometric function.
inSrcProfile If you don't want to use the profile associated to the inImage, you can explicitly specify the profile by this parameter.
In usual case, it should be NULL.
inIntent The intent of the transform. This is one of the RenderingIntent enumeration values.
Returns:
Pointer to the newly created Image instance.
See also:
ToSRGB, PhotometricTransformParam, ColorProfile, Photometric, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::RotateAndFlip ( Image *  inImage,
FourAngles  inAngle = faAngle0,
bool  inFlipVertical = false,
bool  inFlipHorizontal = false 
)

This function creates a new Image instance that rotates and flips the input image.
The rotation is usually in conter-clockwise direction. Since the vertical/horizontal flip is done after rotation, the rotation is done in clockwise direction if only one of vertical or horizontal rotation is enabled.

Parameters:
inImage Specifies the base Image instance.
inAngle Specifies the angle of the output image.
inFlipVertical Whether flips the image vertically after the rotation.
inFlipHorizontal Whether flips the image horizontally after the rotation.
See also:
FourAngles, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::Scale ( Image *  inImage,
ssize_t  inWidth,
ssize_t  inHeight 
)

This function creates a new Image instance that rescales the input Image.
You can also direct the Image instance to re-rescale the Image runtimely by Image::setParam function with ScaleParam structure.

Parameters:
inImage Specifies the base Image instance.
inWidth The new width of the image in pixels.
inHeight The new height of the image in pixels.
Returns:
Pointer to the newly created Image instance.
See also:
ScaleParam, SmoothScale, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::Scale ( Image *  inImage,
double  inMag = 1.0 
)

This function creates a new Image instance that rescales the input Image.
You can also direct the Image instance to re-rescale the Image runtimely by Image::setParam function with ScaleParam structure.

Parameters:
inImage Specifies the base Image instance.
inMag The magnification coeffecient. 1.0 stands for the original size.
Returns:
Pointer to the newly created Image instance.
See also:
ScaleParam, SmoothScale, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::Sharpness_4 ( Image *  inImage,
size_t  n = 0 
)

This function creates a new Image instance that applies the following sharpness filter to the specified instance:
0-10
-15+n-1
0-10

Parameters:
inImage An image to apply sharpness on.
n The mildness of the output image. The default is 0. It can be any value no less than 0.
Returns:
Pointer to the newly created Image instance. This function internally used UniformFilter and it can accepts FilterParam.
See also:
UniformFilter, FilterDefinition, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::Sharpness_8 ( Image *  inImage,
size_t  n = 0 
)

This function creates a new Image instance that applies the following sharpness filter to the specified instance:
-1-1-1
-19+n-1
-1-1-1

Parameters:
inImage An image to apply sharpness on.
n The mildness of the output image. The default is 0. It can be any value no less than 0.
Returns:
Pointer to the newly created Image instance. This function internally used UniformFilter and it can accepts FilterParam.
See also:
UniformFilter, FilterDefinition, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::SmoothScale ( Image *  inImage,
ssize_t  inWidth,
ssize_t  inHeight 
)

This function creates a new Image instance that rescales the input Image.
You can also direct the Image instance to re-rescale the Image runtimely by Image::setParam function with SmoothScaleParam structure.

Parameters:
inImage Specifies the base Image instance.
inWidth The new width of the image in pixels.
inHeight The new height of the image in pixels.
Returns:
Pointer to the newly created Image instance.
See also:
ScaleParam, Scale, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::SmoothScale ( Image *  inImage,
double  inMag = 1.0 
)

This function creates a new Image instance that rescales the input Image.
You can also direct the Image instance to re-rescale the Image runtimely by Image::setParam function with SmoothScaleParam structure.

Parameters:
inImage Specifies the base Image instance.
inMag The magnification coeffecient. 1.0 stands for the original size.
Returns:
Pointer to the newly created Image instance.
See also:
ScaleParam, Scale, Factory Functions for Image Classes, ImageUtils

AutoPtr<Image> Celartem::ImageUtils::ToSRGB ( Image *  inImage,
Photometric  inRgbPhotometric = pmRGB8,
RenderingIntent  inIntent = riPerceptual 
)

This function creats a new Image instance that converts the Photometric of the specified Image instance into sRGB color space. This is the easiest way to obtain sRGB image.
This function internally calls PhotometricTransform and it may take so much time to create the internal photometric transform instance.

Parameters:
inImage The image to be transformed.
inRgbPhotometric The destination photometric; it should be one of RGB variants, otherwise this function fails and throws some exception.
For the list of Photometrics, see PhotometricDefinition.
inIntent The intent of the transform. This is one of the RenderingIntent enumeration values.
Returns:
Pointer to the newly created Image instance.
You can also customize the transform dynamically using PhotometricTransformParam.

See also:
PhotometricTransform, PhotometricTransformParam, ColorProfile, Photometric, Factory Functions for Image Classes, ImageUtils, PhotometricDefinition

AutoPtr<Image> Celartem::ImageUtils::UniformFilter ( Image *  inImage,
const ssize_t *  inFilter,
size_t  inDiam,
size_t  inNorm = 0 
)

This function creates a new Image instance that applies a filter to the specified Image instance.

Parameters:
inImage An image to apply filter on.
inFilter A filter to apply. It should be larger than diam*diam.
inDiam The diameter of the filter.
inNorm If norm is not equal to the sum of all elements in the filter, you should explicitly specify the value here; otherwise, the norm is automatically calculated.
Returns:
Pointer to the newly created Image instance. To update the filter dynamically, use FilterParam.
See also:
FilterDefinition, FilterParam, Factory Functions for Image Classes, ImageUtils
The following sample illustrates how to implement sharpness filter.
// sharpness is 3x3 matrix.
const ssize_t sharpness[] = {0, -1, 0, -1, 5, -1, 0, -1, 0};
AutoPtr<Image> output = UniformFilter(input, sharpness, 3);


This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:33 2008.