- Inherits from:
- Object
- Conforms to:
- DImage
- Declared in:
- DJPEGImage.h
Object
|
+---DJPEGImage
Class Description
The DJPEGImage class implements methods for reading and writing JPEG images.
- Last modified:
- 31-Oct-2007 (DJPEGImage.h)
Instance Variables
- private void *_jinfo
- the jpeg info
- private void *_jerr
- the jpeg error
- private unsigned _height
- the height of the image
- private unsigned _width
- the width of the image
- private unsigned _bpp
- the bytes per pixel
- private BOOL _reading
- reading or writing an image ?
- private BOOL _error
- is an error active ?
- commonly used methods
- - (DJPEGImage *) init
- Initialise a JPEG image object
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of a JPEG image (not implemented)
- Returns:
- the object
- Deconstructor
- - free
- Free the image object
- Returns:
- the object
- Image members
- - (unsigned) bytesPerPixel
- Return the bytes per pixel (3: RGB or 4: RGBA)
- Returns:
- the number of bytes
- - (unsigned) height
- Return the height of the image
- Returns:
- the height
- - (unsigned) images
- Return the number of images in the image (jpeg: always 1)
- Returns:
- the number of images
- - (unsigned) width
- Return the width of the image
- Returns:
- the width
- Image methods
- + (BOOL) isImage :(id <DDataReadable>) source
- Check if an image is an JPEG image
- Parameters:
- source - the source of the image
- Returns:
- is it ?
- - (BOOL) close
- Close the image object
- Returns:
- success
- - (BOOL) open :(id <DDataReadable>) source
- Open the JPEG image object for reading
- Parameters:
- source - the source with the image
- Returns:
- success
- - (BOOL) open :(id <DDataWritable>) destination :(unsigned) width :(unsigned) height :(int) quality
- Open the JPEG image object for writing (RGB = 3 bytesPerPixel, no alpha)
- Parameters:
- destination - the file for the image
width - the width of the image
height - the height of the image
quality - the quality [0..100]
- Returns:
- succes
- - (unsigned) readRow :(unsigned char *) data
- Get the next row of image data from the jpgeg file (format: RGB)
- Parameters:
- data - the image data for the next line (size = _width * _bpp)
- Returns:
- the number of pixels in the row (or 0 for error)
- - (BOOL) writeRow :(unsigned char *) data :(unsigned) width
- Set the next row of image data in the jpeg file (format: RGB)
- Parameters:
- data - the image data for the next line (size = _width * _bpp)
width - the number of pixels in the row
- Returns:
- success
generated 05-Nov-2007 by ObjcDoc 3.0.0