hawxgamer

Untitled

Oct 4th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. /*----------------------------------------------------------------------------*/
  2. /*----------------------------------------------------------------------------*/
  3. /*-----------------Simplistic PPM format I/O library--------------------------*/
  4. /*-----------------for educational purposes-----------------------------------*/
  5. /*----------------------------------------------------------------------------*/
  6. /*----------------------------------------------------------------------------*/
  7. /*-----(C) Andreas Wasserbauer------------------------------------------------*/
  8. /*----------------------------------------------------------------------------*/
  9.  
  10.  
  11. #ifndef _simpleppm_
  12. #define _simpleppm_
  13.  
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <string.h>
  17. #include <ctype.h>
  18.  
  19. typedef struct {
  20. unsigned char *data;
  21. unsigned int width, height;
  22. unsigned int maxcol;
  23. }PPM;
  24.  
  25.  
  26. typedef struct TResolution
  27. {
  28. uint16_t xRes;
  29. uint16_t yRes;
  30. } TRes;
  31.  
  32. typedef struct Pixel
  33. {
  34. uint8_t uRed;
  35. uint8_t uGreen;
  36. uint8_t uBlue;
  37. } TPixel;
  38.  
  39. unsigned int const cDescriptionSize = 100;
  40.  
  41. struct TFrameContainer
  42. {
  43. int8_t iFilmDescription[cDescriptionSize];
  44. TRes tResolution; // resolution of the video file
  45. uint32_t uFrames; // amount of all frames
  46. uint8_t uFPS;
  47. uint8_t uCodecId; // 0xAA
  48. TPixel * pData;
  49. uint16_t uHeaderCS; // checksum for the header
  50.  
  51.  
  52.  
  53. };
  54.  
  55. int PPM_load(PPM* ppm, char* filename);
  56. int PPM_save(PPM* ppm, char* filename);
  57.  
  58. #endif
Advertisement
Add Comment
Please, Sign In to add comment