Public Types | Static Public Member Functions

Celartem::DjVu::Imaging Struct Reference

#include <djv_imaging.h>

List of all members.

Public Types

typedef const void *(* SrcLockFunc )(const void *inSrc, ssize_t &ioSrcRowStride, const Rect &inRectToLock, bool inForLock)

Static Public Member Functions

static void resample (void *outDest, ssize_t inDestRowStride, const Celartem::Rect &inDestRect, size_t inDestAllWidth, size_t inDestAllHeight, const void *inSrc, ssize_t inSrcRowStride, size_t inSrcWidth, size_t inSrcHeight, Photometric inPM, bool inUseFastRescaling=false, SrcLockFunc inSrcLockFunc=NULL)
static void resampleMask (u8 *ioImagePtr, ssize_t inRowStride, Photometric inPm, const Rect &inRect, size_t inRescaledWidth, size_t inRescaledHeight, const u8 *inMask, ssize_t inMaskRowStride, size_t inMaskWidth, size_t inMaskHeight, const u8 *inForeground, ssize_t inForeRowStride, size_t inForeWidth, size_t inForeHeight, bool inNeedAlphaChannel, bool inUseFastRescaling)
static void horzMirror (void *ioImagePtr, ssize_t inRowStride, Photometric inPM, size_t inWidth, size_t inHeight)
static void rotate90 (void *outDest, ssize_t inDestRowStride, const void *inSrc, ssize_t inSrcRowStride, size_t inSrcWidth, size_t inSrcHeight, Photometric inPM, bool inAntiClockWise)
static void rotate (void *outDest, ssize_t inDestRowStride, const void *inSrc, ssize_t inSrcRowStride, size_t inSrcWidth, size_t inSrcHeight, Photometric inPM, Rotation inRotation)
static void copyImage (void *ioDest, ssize_t inDestRowStride, const void *inSrc, ssize_t inSrcRowStride, size_t inWidth, size_t inHeight, Photometric inPM)
static void fillWhite (void *outImage, ssize_t inRowStride, size_t inWidth, size_t inHeight, Photometric inPM)
static void convertToGrayscale (void *outGrayscale, ssize_t inGrayRowStride, const void *inImage, ssize_t inImageRowStride, size_t inWidth, size_t inHeight, Photometric inPM)
static bool blackCompensation (void *outDestImage, ssize_t inDestImageRowStride, const void *inImage, ssize_t inImageRowStride, size_t inWidth, size_t inHeight, Photometric inPM)

Detailed Description

This structure provides a function for resampling images.


Member Typedef Documentation

typedef const void*(* Celartem::DjVu::Imaging::SrcLockFunc)(const void *inSrc, ssize_t &ioSrcRowStride, const Rect &inRectToLock, bool inForLock)

This callback provides a change to render the source image dynamically.
This callback function is called twice from Imaging::resample function. The first call is to lock a portion of the source image and the second call is to unlock that portion optionally.

Parameters:
inSrc The inSrc parameter passed to resample function.
This can be any value; it might not be actual pointer to the source image. You can use this value to pass some context/user-defined value.
ioSrcRowStride On input, this contains the row stride value passed to resample function.
On return, this should return the actual row stride of the source image.
For the second call, this value should be ignored.
inRectToLock The actual area to be used by resampling process.
For the second call, this value should be ignored.
inForLock For the first call (lock), this is true and for the second call (unlock), this is false.
Returns:
The pointer to the area of the source image.

Member Function Documentation

static bool Celartem::DjVu::Imaging::blackCompensation ( void *  outDestImage,
ssize_t  inDestImageRowStride,
const void *  inImage,
ssize_t  inImageRowStride,
size_t  inWidth,
size_t  inHeight,
Photometric  inPM 
) [static]

Do black compensastion.

Parameters:
outDestImage Pointer to a buffer which receives the output image.
inDestImageRowStride The row-stride of the output image.
inImage Pointer to a buffer which contains the input image.
inImageRowStride The row-stride of the input image.
inWidth The width of the input image.
inHeight The height of the input image.
inPM The photometric of the input image.
Returns:
true if the process succeeded. false if the process is failed due to some condition. In this case, nothing is returned to outDestImage.
static void Celartem::DjVu::Imaging::convertToGrayscale ( void *  outGrayscale,
ssize_t  inGrayRowStride,
const void *  inImage,
ssize_t  inImageRowStride,
size_t  inWidth,
size_t  inHeight,
Photometric  inPM 
) [static]

Convert image to grayscale.

Parameters:
outGrayscale Pointer to a buffer which receives the output grayscale image.
inGrayRowStride The row-stride of the output grayscale image.
inImage Pointer to a buffer which contains the input image.
inImageRowStride The row-stride of the input image.
inWidth The width of the input image.
inHeight The height of the input image.
inPM The photometric of the input image.
static void Celartem::DjVu::Imaging::copyImage ( void *  ioDest,
ssize_t  inDestRowStride,
const void *  inSrc,
ssize_t  inSrcRowStride,
size_t  inWidth,
size_t  inHeight,
Photometric  inPM 
) [static]

Copy an image.

Parameters:
ioDest Pointer to a buffer to copy onto. image.
inDestRowStride The row-stride of the output image..
inSrc Pointer to a buffer which contains the input image.
inSrcRowStride The row-stride of the input image.
inWidth The width of the image.
inHeight The height of the image.
inPM The photometric of the image.
static void Celartem::DjVu::Imaging::fillWhite ( void *  outImage,
ssize_t  inRowStride,
size_t  inWidth,
size_t  inHeight,
Photometric  inPM 
) [static]

Fill the buffer with white.

Parameters:
outImage Pointer to a buffer which receives the resulting image.
inRowStride The row-stride of the image.
inWidth The width of the input image.
inHeight The height of the input image.
inPM The photometric of the input image.
static void Celartem::DjVu::Imaging::horzMirror ( void *  ioImagePtr,
ssize_t  inRowStride,
Photometric  inPM,
size_t  inWidth,
size_t  inHeight 
) [static]

Mirror an image horizontally.

Parameters:
ioImagePtr Pointer to a buffer which contains an image.
inRowStride The row-stride of the image.
inPM The photometric of the image.
inWidth The width of the image.
inHeight The height of the image.
static void Celartem::DjVu::Imaging::resample ( void *  outDest,
ssize_t  inDestRowStride,
const Celartem::Rect inDestRect,
size_t  inDestAllWidth,
size_t  inDestAllHeight,
const void *  inSrc,
ssize_t  inSrcRowStride,
size_t  inSrcWidth,
size_t  inSrcHeight,
Photometric  inPM,
bool  inUseFastRescaling = false,
SrcLockFunc  inSrcLockFunc = NULL 
) [static]

Resample the specified image.

Parameters:
outDest Pointer to a buffer which receives the resampled result.
inDestRowStride The row-stride of the resampled result.
inDestRect Portion to rescale in the resampled scale.
inDestAllWidth The width of the resampled image.
This function works as if the input image were resampled into the size specified by inDestAllWidth and inDestAllHeight.
inDestAllHeight The height of the resampled image.
inSrc Pointer to the input image.
If inSrcLockFunc is not NULL, this is some context value, which will be passed to the callback function specified by inSrcLockFunc.
inSrcRowStride The row-stride of the input image.
inSrcWidth The width of the input image.
inSrcHeight The height of the input image.
inPM The photometric of the images. This is one of Photometric enumeration.
inUseFastRescaling Determine whether to use fast scaling or not.
The default is not to use fast scaling.
inSrcLockFunc Specifies a callback function to locate the pointer to the source image. See SrcLockFunc for more information.
static void Celartem::DjVu::Imaging::resampleMask ( u8 ioImagePtr,
ssize_t  inRowStride,
Photometric  inPm,
const Rect inRect,
size_t  inRescaledWidth,
size_t  inRescaledHeight,
const u8 inMask,
ssize_t  inMaskRowStride,
size_t  inMaskWidth,
size_t  inMaskHeight,
const u8 inForeground,
ssize_t  inForeRowStride,
size_t  inForeWidth,
size_t  inForeHeight,
bool  inNeedAlphaChannel,
bool  inUseFastRescaling 
) [static]

Resample the specified mask and alphablend against the image already on the specified buffer.

Parameters:
ioImagePtr Pointer to a buffer which contains an image to which the mask will be blended.
inRowStride The row-stride of the image on the buffer.
inPm The photometric of the images. This is one of Photometric enumeration.
inRect Portion to rescale in the resampled scale.
inRescaledWidth The width of the resampled image.
This function works as if the input image were resampled into the size specified by inRescaledWidth and inRescaledHeight.
inRescaledHeight The height of the resampled image.
inMask Pointer to a 1-bit mask (0:background, 1:foreground).
inMaskRowStride The row-stride of the mask.
inMaskWidth The width of the mask.
inMaskHeight The height of the mask.
This should be same to the size of inMask array.
inForeground Optional pointer to the foreground image. If this is NULL, then all the foreground related parameters are ignored and then the mask is painted with black.
inForeRowStride The row-stride of the foreground image.
inForeWidth The width of the foreground image.
inForeHeight The height of the foreground image.
inNeedAlphaChannel Determine whether or not to add the alpha (opacity) channel to the output image.
inUseFastRescaling Determine whether to use fast scaling or not.
The default is not to use fast scaling.
static void Celartem::DjVu::Imaging::rotate ( void *  outDest,
ssize_t  inDestRowStride,
const void *  inSrc,
ssize_t  inSrcRowStride,
size_t  inSrcWidth,
size_t  inSrcHeight,
Photometric  inPM,
Rotation  inRotation 
) [static]

Rotate the image.

Parameters:
outDest Pointer to a buffer which receives the resulting image.
inDestRowStride The row-stride of the resulting image.
inSrc Pointer to a buffer which contains the input image.
inSrcRowStride The row-stride of the input image.
inSrcWidth The width of the input image.
inSrcHeight The height of the input image.
inPM The photometric of the images.
inRotation The rotation of the output image.
static void Celartem::DjVu::Imaging::rotate90 ( void *  outDest,
ssize_t  inDestRowStride,
const void *  inSrc,
ssize_t  inSrcRowStride,
size_t  inSrcWidth,
size_t  inSrcHeight,
Photometric  inPM,
bool  inAntiClockWise 
) [static]

Rotate the image 90 degree clockwise or anti-clockwise.

Parameters:
outDest Pointer to a buffer which receives the resulting image.
inDestRowStride The row-stride of the resulting image.
inSrc Pointer to a buffer which contains the input image.
inSrcRowStride The row-stride of the input image.
inSrcWidth The width of the input image.
inSrcHeight The height of the input image.
inPM The photometric of the images.
inAntiClockWise true to rotate the image anti-clockwise; otherwise clockwise.

The documentation for this struct was generated from the following file:

This document is made with doxygen 1.7.1 at Thu Feb 17 2011 15:40:20.
Caminova Logo