- Inherits from:
- Object
- Conforms to:
- DImage
- Declared in:
- DPNGImage.h
Object
|
+---DPNGImage
Class Description
The DPNGImage class implements methods for reading and writing PNG images.
- Last modified:
- 31-Oct-2007 (DPNGImage.h)
Instance Variables
- private void *_png
- the png pointer
- private void *_info
- the png info pointer
- private unsigned _height
- the height of the image
- private unsigned _width
- the width of the image
- private unsigned _bpp
- the bytes per pixel
- private unsigned _images
- the number of images in the image
- private int _bbc
- the bits per color
- private int _colorType
- the color type
- private int _interlaceType
- the interlace type
- private BOOL _reading
- reading or writing an image ?
- private BOOL _error
- is an error active ?
- commonly used methods
- - (DPNGImage *) init
- Initialise a PNG image object
- Returns:
- the object
- Copy related methods
- - shallowCopy
- Do a shallow copy of a PNG 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 (interlacing, always 1)
- Returns:
- the 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 PNG 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 PNG image object for reading
- Parameters:
- source - the source with the image
- Returns:
- success
- - (BOOL) open :(id <DDataWritable>) destination :(unsigned) width :(unsigned) height :(unsigned) bytesPerPixel
- Open the PNG image object for writing
- Parameters:
- destination - the file for the image
width - the width of the image
height - the height of the image
bytesPerPixel - the number of bytes per pixel (3 for RGB or 4 for RGBA)
- Returns:
- succes
- - (unsigned) readRow :(unsigned char *) data
- Get the next row of image data from the file (format: RGB... or RGBA...)
- 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 png file (format: RGB.. or RGBA..)
- 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