Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------------------------------------------*/
- /*----------------------------------------------------------------------------*/
- /*-----------------Simplistic PPM format I/O library--------------------------*/
- /*-----------------for educational purposes-----------------------------------*/
- /*----------------------------------------------------------------------------*/
- /*----------------------------------------------------------------------------*/
- /*-----(C) Andreas Wasserbauer------------------------------------------------*/
- /*----------------------------------------------------------------------------*/
- #ifndef _simpleppm_
- #define _simpleppm_
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- typedef struct {
- unsigned char *data;
- unsigned int width, height;
- unsigned int maxcol;
- }PPM;
- typedef struct TResolution
- {
- uint16_t xRes;
- uint16_t yRes;
- } TRes;
- typedef struct Pixel
- {
- uint8_t uRed;
- uint8_t uGreen;
- uint8_t uBlue;
- } TPixel;
- unsigned int const cDescriptionSize = 100;
- struct TFrameContainer
- {
- int8_t iFilmDescription[cDescriptionSize];
- TRes tResolution; // resolution of the video file
- uint32_t uFrames; // amount of all frames
- uint8_t uFPS;
- uint8_t uCodecId; // 0xAA
- TPixel * pData;
- uint16_t uHeaderCS; // checksum for the header
- };
- int PPM_load(PPM* ppm, char* filename);
- int PPM_save(PPM* ppm, char* filename);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment