Calculating image size (bytes)
Posted: 2007-06-14T09:15:10-07:00
Using the MagickWand API I'm attempting to calculate the decompressed size of an image defined by:
height * width * bits per pixel
I can query the height and width straightforwardly, but I'm not sure about bits per pixel.
MagickGetImageDepth() looked like a reasonable candidate but reading the code it seems to visit every pixel in the image, whereas I'd have expected the number of channels & channel sizes to be defined by the format (i.e. known independently of the image data), so I'm not sure this is what I want.
Scanning down the API I can't see any other likely candidate functions.
Can anyone point me at the function I need?
height * width * bits per pixel
I can query the height and width straightforwardly, but I'm not sure about bits per pixel.
MagickGetImageDepth() looked like a reasonable candidate but reading the code it seems to visit every pixel in the image, whereas I'd have expected the number of channels & channel sizes to be defined by the format (i.e. known independently of the image data), so I'm not sure this is what I want.
Scanning down the API I can't see any other likely candidate functions.
Can anyone point me at the function I need?