#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) |
This structure provides a function for resampling images.
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.
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 . |
|
static |
Do noise reduction on bitonal image.
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. |
inPacked | Whether 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). |
inNoiseReduction | One of BitonalNoiseReduction to specify bitonal noise reduction method. |
|
static |
Do black compensastion.
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. |
true
if the process succeeded. false
if the process is failed due to some condition. In this case, nothing is returned to outDestImage.
|
static |
Convert image to grayscale.
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 |
Copy an image.
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 |
Fill the buffer with white.
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 |
Mirror an image horizontally.
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 |
Resample the specified image.
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. |
Referenced by Celartem::DjVu::ImageRenderer::render().
|
static |
Resample the specified mask and alphablend against the image already on the specified buffer.
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 |
Rotate the image.
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 |
Rotate the image 90 degree clockwise or anti-clockwise.
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. |