*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> old-compression/clCompressImage (3d)              
Title
Content
Arch
Section
 

Contents


clCompressImage(3dm)					  clCompressImage(3dm)


NAME    [Toc]    [Back]

     clCompressImage, clDecompressImage	- Compress/Decompress a	single image

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/cl.h>

     int clCompressImage(int scheme, int width,	int height,
	 int format, float compressionRatio, void *frameBuffer,
	 int *compressedBufferSizePtr, void *compressedBuffer)
     int clDecompressImage(int scheme, int width, int height,
	 int format, int compressedBufferSize,
	 void *compressedBuffer, void *frameBuffer)

ARGUMENTS    [Toc]    [Back]

     scheme    The compression/decompression scheme to use.

     width     The width of the	image.

     height    The height of the image.

     format    The format of the original image	to (de)compress	:
	       CL_FORMAT_BGR, CL_FORMAT_XBGR, CL_FORMAT_ABGR,
	       CL_FORMAT_BGR332, CL_FORMAT_GRAYSCALE, CL_FORMAT_YCbCr,
	       CL_FORMAT_YCbCr422, or CL_FORMAT_YCbCr422DC.

     compressionRatio
	       The target compression ratio. The actual	compression ratio
	       depends on this value and the particular	codec.	A value	of 0.0
	       indicates the default should be used.

     frameBuffer
	       A pointer to the	frame buffer.

     compressedBufferSizePtr
	       A pointer to the	size of	the compressed data buffer in bytes.
	       The value pointed to is overwritten by clCompressImage to
	       return the actual size of the compressed	data.

     compressedBufferSize
	       The size	of the compressed data in bytes.

     compressedBuffer
	       A pointer to the	compressed data	buffer.

DESCRIPTION    [Toc]    [Back]

     clCompressImage compresses	the image in frameBuffer and stores the	result
     in	compressedBuffer and the resulting size	in compressedBufferSizePtr.

     clDecompressImage decompresses the	data in	compressedBuffer of size
     compressedBufferSize and stores the resulting image in frameBuffer.

     The values	of the state parameters	used with the other compression



									Page 1






clCompressImage(3dm)					  clCompressImage(3dm)



     library calls have	no effect on these routines, however their default
     values do.	width, height, format, and compressionRatio are	interpreted in
     the same manner as	the corresponding state	parameters, but	are given as
     direct parameters so that they may	be specified in	the same call.

RETURNS    [Toc]    [Back]

     Each function returns SUCCESS, or a negative error	code on	failure.


EXAMPLE    [Toc]    [Back]

	  /* Compress and decompress a 320 by 240 XBGR image with JPEG */
	  int frameIndex, compressedBufferSize,	maxCompressedBufferSize;
	  int *compressedBuffer, frameBuffer[320][240];

	  /* malloc a big enough buffer	*/
	  maxCompressedBufferSize = 320	* 240 *	CL_BytesPerPixel(CL_FORMAT_XBGR)
				    + clQueryMaxHeaderSize(CL_JPEG_SOFTWARE);
	  compressedBuffer = (int *)malloc(maxCompressedBufferSize);

	  /* Compress and decompress it	*/
	  clCompressImage(CL_JPEG_SOFTWARE, 320, 240, CL_FORMAT_XBGR, 15.0,
	      frameBuffer, &compressedBufferSize, compressedBuffer);
	  clDecompressImage(CL_JPEG_SOFTWARE, 320, 240,	CL_FORMAT_XBGR,
	      compressedBufferSize, compressedBuffer, frameBuffer);

SEE ALSO    [Toc]    [Back]

      
      
     CLintro(3dm)


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
packf Tru64 compress a folder into a single file (only available within the message handling system, mh)
clOpenDecompressor IRIX Decompress a video or audio stream
aifcdecompress IRIX decompress the audio data in an AIFF-C file
XmUninstallImage IRIX A pixmap caching function that removes an image from the image cache
stl_image Tru64 setld software subset image data files (*.image)
XmUninstallImage HP-UX A pixmap caching function that removes an image from the image cache
XmInstallImage HP-UX A pixmap caching function that adds an image to the image cache
XmUninstallImage Tru64 A pixmap caching function that removes an image from the image cache
dmicsrc IRIX manipulate image converter context src image format
findphoto IRIX manipulate the image data stored in a photo image.
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service