SDL_image 1.2.3: IMG_isPNM

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 3.2.2 IMG_isPNM

`int IMG_isPNM(SDL_RWops *src)`

src

If the PNM format is supported, then the image data is tested to see if it is readable as a PNM, otherwise it returns false (Zero).

Returns: 1 if the image is a PNM and the PNM format support is compiled into SDL_image. 0 is returned otherwise.

    // Test sample.pnm to see if it is a PNM
    SDL_RWops *rwop;
    rwop=SDL_RWFromFile("sample.pnm", "rb");
    if(IMG_isPNM(rwop))
    	printf("sample.pnm is a PNM file.\n");
    else
    	printf("sample.pnm is not a PNM file, or PNM support is not available.\n");

See Also:
3.1.3 IMG_LoadTyped_RW

This document was generated on June, 12 2003 using texi2html