summaryrefslogtreecommitdiff
path: root/src/graphics/PixelFormat.h
blob: 54d94b7f201d8e93f8a714ce2208e9bc6c5622dd (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
//
//  libavg - Media Playback Engine. 
//  Copyright (C) 2003-2014 Ulrich von Zadow
//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of the GNU Lesser General Public
//  License as published by the Free Software Foundation; either
//  version 2 of the License, or (at your option) any later version.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
//  Current versions can be found at www.libavg.de
//

#ifndef _PixelFormat_H_
#define _PixelFormat_H_

#include "../api.h"
#include <string>
#include <vector>

namespace avg {

typedef enum {
    B5G6R5, B8G8R8, B8G8R8A8, B8G8R8X8, A8B8G8R8, X8B8G8R8,
    R5G6B5, R8G8B8, R8G8B8A8, R8G8B8X8, A8R8G8B8, X8R8G8B8,
    I8, I16,
    A8,
    YCbCr411,  
    YCbCr422,  
    YUYV422,   
    YCbCr420p, 
    YCbCrJ420p,
    YCbCrA420p,
    BAYER8,    
    BAYER8_RGGB,
    BAYER8_GBRG,
    BAYER8_GRBG,
    BAYER8_BGGR,
    R32G32B32A32F, // 32bit per channel float rgba
    I32F,
    NO_PIXELFORMAT
} PixelFormat;

AVG_API std::ostream& operator <<(std::ostream& os, PixelFormat pf);

std::string AVG_API getPixelFormatString(PixelFormat pf);
PixelFormat AVG_API stringToPixelFormat(const std::string& s);
std::vector<std::string> AVG_API getSupportedPixelFormats();
bool AVG_API pixelFormatIsColored(PixelFormat pf);
bool AVG_API pixelFormatIsBayer(PixelFormat pf);
bool AVG_API pixelFormatHasAlpha(PixelFormat pf);
bool AVG_API pixelFormatIsPlanar(PixelFormat pf);
bool AVG_API pixelFormatIsBlueFirst(PixelFormat pf);
unsigned AVG_API getNumPixelFormatPlanes(PixelFormat pf);
unsigned AVG_API getBytesPerPixel(PixelFormat pf);

}
#endif