Public Types | Static Public Member Functions | List of all members
Celartem::DjVu::Imaging Struct Reference

#include <djv_imaging.h>

Public Types

enum  BitonalNoiseReduction { bnr_None = 0 }
 
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, size_t inForeX, size_t inForeY, 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)
 
static void bitonalNoiseReduction (void *outDestImage, ssize_t inDestImageRowStride, const void *inImage, ssize_t inImageRowStride, size_t inWidth, size_t inHeight, bool inPacked, BitonalNoiseReduction inNoiseReduction)
 

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
inSrcThe 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.
ioSrcRowStrideOn 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.
inRectToLockThe actual area to be used by resampling process.
For the second call, this value should be ignored.
inForLockFor 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 Enumeration Documentation

Noise reduction method.

Enumerator
bnr_None 

No noise reduction.

Member Function Documentation

static void Celartem::DjVu::Imaging::bitonalNoiseReduction ( void *  outDestImage,
ssize_t  inDestImageRowStride,
const void *  inImage,
ssize_t  inImageRowStride,
size_t  inWidth,
size_t  inHeight,
bool  inPacked,
BitonalNoiseReduction  inNoiseReduction 
)
static

Do noise reduction on bitonal image.

Parameters
outDestImagePointer to a buffer which receives the output image.
inDestImageRowStrideThe row-stride of the output image.
inImagePointer to a buffer which contains the input image.
inImageRowStrideThe row-stride of the input image.
inWidthThe width of the input image.
inHeightThe height of the input image.
inPackedWhether the source/destination image are packed or not. true if both are in packed (1 bit-per-pixel), false if both are in unpacked (8 bit-per-pixel).
inNoiseReductionOne of BitonalNoiseReduction to specify bitonal noise reduction method.
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
outDestImagePointer to a buffer which receives the output image.
inDestImageRowStrideThe row-stride of the output image.
inImagePointer to a buffer which contains the input image.
inImageRowStrideThe row-stride of the input image.
inWidthThe width of the input image.
inHeightThe height of the input image.
inPMThe 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
outGrayscalePointer to a buffer which receives the output grayscale image.
inGrayRowStrideThe row-stride of the output grayscale image.
inImagePointer to a buffer which contains the input image.
inImageRowStrideThe row-stride of the input image.
inWidthThe width of the input image.
inHeightThe height of the input image.
inPMThe 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
ioDestPointer to a buffer to copy onto. image.
inDestRowStrideThe row-stride of the output image..
inSrcPointer to a buffer which contains the input image.
inSrcRowStrideThe row-stride of the input image.
inWidthThe width of the image.
inHeightThe height of the image.
inPMThe 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
outImagePointer to a buffer which receives the resulting image.
inRowStrideThe row-stride of the image.
inWidthThe width of the input image.
inHeightThe height of the input image.
inPMThe 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
ioImagePtrPointer to a buffer which contains an image.
inRowStrideThe row-stride of the image.
inPMThe photometric of the image.
inWidthThe width of the image.
inHeightThe 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
outDestPointer to a buffer which receives the resampled result.
inDestRowStrideThe row-stride of the resampled result.
inDestRectPortion to rescale in the resampled scale.
inDestAllWidthThe width of the resampled image.
This function works as if the input image were resampled into the size specified by inDestAllWidth and inDestAllHeight.
inDestAllHeightThe height of the resampled image.
inSrcPointer 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.
inSrcRowStrideThe row-stride of the input image.
inSrcWidthThe width of the input image.
inSrcHeightThe height of the input image.
inPMThe photometric of the images. This is one of Photometric enumeration.
inUseFastRescalingDetermine whether to use fast scaling or not.
The default is not to use fast scaling.
inSrcLockFuncSpecifies a callback function to locate the pointer to the source image. See SrcLockFunc for more information.

Referenced by Celartem::DjVu::ImageRenderer::render().

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,
size_t  inForeX,
size_t  inForeY,
bool  inNeedAlphaChannel,
bool  inUseFastRescaling 
)
static

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

Parameters
ioImagePtrPointer to a buffer which contains an image to which the mask will be blended.
inRowStrideThe row-stride of the image on the buffer.
inPmThe photometric of the images. This is one of Photometric enumeration.
inRectPortion to rescale in the resampled scale.
inRescaledWidthThe width of the resampled image.
This function works as if the input image were resampled into the size specified by inRescaledWidth and inRescaledHeight.
inRescaledHeightThe height of the resampled image.
inMaskPointer to a 1-bit mask (0:background, 1:foreground).
inMaskRowStrideThe row-stride of the mask.
inMaskWidthThe width of the mask.
inMaskHeightThe height of the mask.
This should be same to the size of inMask array.
inForegroundOptional 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.
inForeRowStrideThe row-stride of the foreground image.
inForeWidthThe width of the foreground image.
inForeHeightThe height of the foreground image.
inNeedAlphaChannelDetermine whether or not to add the alpha (opacity) channel to the output image.
inUseFastRescalingDetermine 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
outDestPointer to a buffer which receives the resulting image.
inDestRowStrideThe row-stride of the resulting image.
inSrcPointer to a buffer which contains the input image.
inSrcRowStrideThe row-stride of the input image.
inSrcWidthThe width of the input image.
inSrcHeightThe height of the input image.
inPMThe photometric of the images.
inRotationThe 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
outDestPointer to a buffer which receives the resulting image.
inDestRowStrideThe row-stride of the resulting image.
inSrcPointer to a buffer which contains the input image.
inSrcRowStrideThe row-stride of the input image.
inSrcWidthThe width of the input image.
inSrcHeightThe height of the input image.
inPMThe photometric of the images.
inAntiClockWisetrue to rotate the image anti-clockwise; otherwise clockwise.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo