summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/util/render/yuvPicture.h
blob: 1995b4739a7d5844f691b27a2f467a30ce19acaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
  describes a picture in yuv format
  Copyright (C) 2000 Martin Vogt

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */



#ifndef __YUVPICTURE_H
#define __YUVPICTURE_H


extern "C" {
#include <stdio.h>
#include <string.h>
}

#include "../timeStamp.h"

#define PICTURE_NO_TYPE     -1

#define PICTURE_YUVMODE_CR_CB   1
#define PICTURE_YUVMODE_CB_CR   2
#define PICTURE_RGB             3
#define PICTURE_RGB_FLIPPED     4
#define PICTURE_YUVMODE_YUY2    5
#define PICTURE_YUVMODE_UYVY    6

class YUVPicture {

  unsigned char* imagePtr;               /* Pointer to complete yuv image */

  unsigned char* luminance;              /* Luminance plane.   */
  unsigned char* Cr;                     /* Cr plane.          */
  unsigned char* Cb;                     /* Cb plane.          */


  int width;
  int height;

  float picPerSec;
  int lumLength;
  int colorLength;
  int imageSize;

  TimeStamp* startTimeStamp;
  TimeStamp* waitTime;
  TimeStamp* earlyTime;

  int mpegType;
  int instance;
  int imageType;

  unsigned char* image_mode;            /* start Pointer to complete image */
  unsigned char* luminance_mode;         /* Luminace plane.          */
  unsigned char* Cr_mode;                /* Cr plane.          */
  unsigned char* Cb_mode;                /* Cb plane.          */

 public:
  YUVPicture(int width,int height);
  ~YUVPicture();
 
  //
  //  For YUV Images
  //
  inline unsigned char* getLuminancePtr() {return luminance_mode;}
  inline unsigned char* getCrPtr() {return Cr_mode;}
  inline unsigned char* getCbPtr() {return Cb_mode;}

  // general
  inline unsigned char* getImagePtr() {return imagePtr;}

  // use these to swap the image Types
  inline int getImageType()           { return imageType; }
  void setImageType(int mode);


  int getHeight();
  int getWidth();

  int getLumLength();
  int getColorLength();
  int getImageSize();

  void setPicturePerSecond(float val);
  float getPicturePerSecond();


  void setStartTimeStamp(TimeStamp* timeStamp);
  TimeStamp* getStartTimeStamp();

  void setWaitTime(TimeStamp* waitTime);
  TimeStamp* getWaitTime();

  void setEarlyTime(TimeStamp* earlyTime);
  TimeStamp* getEarlyTime();

  void setMpegPictureType(int type);
  int getMpegPictureType();


  void print(const char* title);
};
#endif