tjEncodeYUV2

* Encode an RGB or grayscale image into a YUV planar image. This function * uses the accelerated color conversion routines in TurboJPEG's underlying * codec to produce a planar YUV image that is suitable for X Video. * Specifically, if the chrominance components are subsampled along the * horizontal dimension, then the width of the luminance plane is padded to the * nearest multiple of 2 in the output image (same goes for the height of the * luminance plane, if the chrominance components are subsampled along the * vertical dimension.) Also, each line of each plane in the output image is * padded to 4 bytes. Although this will work with any subsampling option, it * is really only useful in combination with TJ_420, which produces an image * compatible with the I420 (AKA "YUV420P") format. * * @param handle a handle to a TurboJPEG compressor or transformer instance * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels * to be encoded * @param width width (in pixels) of the source image * @param pitch bytes per line of the source image. Normally, this should be * <tt>width * #tjPixelSizepixelFormat</tt> if the image is unpadded, * or <tt>#TJPAD(width * #tjPixelSizepixelFormat)</tt> if each line of * the image is padded to the nearest 32-bit boundary, as is the case * for Windows bitmaps. You can also be clever and use this parameter * to skip lines, etc. Setting this parameter to 0 is the equivalent of * setting it to <tt>width * #tjPixelSizepixelFormat</tt>. * @param height height (in pixels) of the source image * @param pixelFormat pixel format of the source image (see @ref TJPF * "Pixel formats".) * @param dstBuf pointer to an image buffer that will receive the YUV image. * Use #tjBufSizeYUV() to determine the appropriate size for this buffer * based on the image width, height, and level of chrominance * subsampling. * @param subsamp the level of chrominance subsampling to be used when * generating the YUV image (see @ref TJSAMP * "Chrominance subsampling options".) * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP * "flags". * * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)

extern (C)
int
tjEncodeYUV2
(,
ubyte* srcBuf
,
int width
,
int pitch
,
int height
,,
ubyte* dstBuf
,,
int flags
)

Meta