summaryrefslogtreecommitdiff
path: root/common/quicktime_win32/CVImageBuffer.h
blob: 67224a181feeec8f0860cd35310c65c4e5ba6336 (plain) (blame)
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
 *  CVImageBuffer.h
 *  CoreVideo
 *
 *  Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
 *
 */
 
 /*! @header CVImageBuffer.h
	@copyright 2004 Apple Computer, Inc. All rights reserved.
	@availability Mac OS X 10.4 or later
    @discussion CVImageBufferRef types are abstract and define various attachments and convenience
		calls for retreiving image related bits of data.
		   
*/

#if !defined(__COREVIDEO_CVIMAGEBUFFER_H__)
#define __COREVIDEO_CVIMAGEBUFFER_H__ 1

#include <TargetConditionals.h>

#if TARGET_OS_MAC
#include <ApplicationServices/ApplicationServices.h>
#include <QuartzCore/CVBuffer.h>
#else
#pragma warning (disable: 4068)		// ignore unknown pragmas
#include <CVBuffer.h>
#include <CGGeometry.h>
#endif

#if defined(__cplusplus)
extern "C" {
#endif

#pragma mark CVImageBufferRef attachment keys

#if TARGET_OS_MAC
CV_EXPORT const CFStringRef kCVImageBufferCGColorSpaceKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CGColorSpaceRef

CV_EXPORT const CFStringRef kCVImageBufferCleanApertureKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFDictionary containing the following four keys
CV_EXPORT const CFStringRef	kCVImageBufferCleanApertureWidthKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;			// CFNumber
CV_EXPORT const CFStringRef	kCVImageBufferCleanApertureHeightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;			// CFNumber
CV_EXPORT const CFStringRef	kCVImageBufferCleanApertureHorizontalOffsetKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFNumber
CV_EXPORT const CFStringRef	kCVImageBufferCleanApertureVerticalOffsetKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFNumber
CV_EXPORT const CFStringRef kCVImageBufferPreferredCleanApertureKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;			// CFDictionary containing same keys as kCVImageBufferCleanApertureKey

CV_EXPORT const CFStringRef kCVImageBufferFieldCountKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFNumber
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFString with one of the following four values
CV_EXPORT const CFStringRef	kCVImageBufferFieldDetailTemporalTopFirst AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFString
CV_EXPORT const CFStringRef	kCVImageBufferFieldDetailTemporalBottomFirst AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFString
CV_EXPORT const CFStringRef	kCVImageBufferFieldDetailSpatialFirstLineEarly AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFString
CV_EXPORT const CFStringRef	kCVImageBufferFieldDetailSpatialFirstLineLate AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFString

CV_EXPORT const CFStringRef kCVImageBufferPixelAspectRatioKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFDictionary with the following two keys
CV_EXPORT const CFStringRef	kCVImageBufferPixelAspectRatioHorizontalSpacingKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;	// CFNumber
CV_EXPORT const CFStringRef	kCVImageBufferPixelAspectRatioVerticalSpacingKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;	// CFNumber

CV_EXPORT const CFStringRef kCVImageBufferDisplayDimensionsKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFDictionary with the following two keys
CV_EXPORT const CFStringRef	kCVImageBufferDisplayWidthKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFNumber
CV_EXPORT const CFStringRef	kCVImageBufferDisplayHeightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFNumber

CV_EXPORT const CFStringRef kCVImageBufferGammaLevelKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFNumber describing the gamma level
CV_EXPORT const CFStringRef kCVImageBufferYCbCrMatrixKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;				// CFString describing the color matrix for YCbCr->RGB. This key can be one of the following values:
CV_EXPORT const CFStringRef	kCVImageBufferYCbCrMatrix_ITU_R_709_2 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;			// CFString
CV_EXPORT const CFStringRef	kCVImageBufferYCbCrMatrix_ITU_R_601_4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;			// CFString
CV_EXPORT const CFStringRef	kCVImageBufferYCbCrMatrix_SMPTE_240M_1995 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;		// CFString

#else
#define kCVImageBufferCGColorSpaceKey			CFSTR("CGColorSpace")

#define kCVImageBufferCleanApertureKey			CFSTR("CVCleanAperture")
#define kCVImageBufferCleanApertureWidthKey		    CFSTR("Width")
#define kCVImageBufferCleanApertureHeightKey		    CFSTR("Height")
#define kCVImageBufferCleanApertureHorizontalOffsetKey	    CFSTR("HorizontalOffset")
#define kCVImageBufferCleanApertureVerticalOffsetKey	    CFSTR("VerticalOffset")
#define kCVImageBufferPreferredCleanApertureKey		CFSTR("CVPreferredCleanAperture")

#define kCVImageBufferFieldCountKey			CFSTR("CVFieldCount")
#define kCVImageBufferFieldDetailKey			CFSTR("CVFieldDetail")
#define kCVImageBufferFieldDetailTemporalTopFirst	    CFSTR("TemporalTopFirst")
#define kCVImageBufferFieldDetailTemporalBottomFirst	    CFSTR("TemporalBottomFirst")
#define kCVImageBufferFieldDetailSpatialFirstLineEarly	    CFSTR("SpatialFirstLineEarly")
#define kCVImageBufferFieldDetailSpatialFirstLineLate	    CFSTR("SpatialFirstLineLate")

#define kCVImageBufferPixelAspectRatioKey		CFSTR("CVPixelAspectRatio")
#define kCVImageBufferPixelAspectRatioHorizontalSpacingKey	CFSTR("HorizontalSpacing")
#define kCVImageBufferPixelAspectRatioVerticalSpacingKey	CFSTR("VerticalSpacing")

#define kCVImageBufferDisplayDimensionsKey		CFSTR("CVDisplayDimensions")
#define kCVImageBufferDisplayWidthKey			    CFSTR("Width")
#define kCVImageBufferDisplayHeightKey			    CFSTR("Height")


#define kCVImageBufferGammaLevelKey			CFSTR("CVImageBufferGammaLevel")
#define kCVImageBufferYCbCrMatrixKey			CFSTR("CVImageBufferYCbCrMatrix")
#define kCVImageBufferYCbCrMatrix_ITU_R_709_2			CFSTR("CVImageBufferYCbCrMatrix_ITU_R_709_2")
#define kCVImageBufferYCbCrMatrix_ITU_R_601_4			CFSTR("CVImageBufferYCbCrMatrix_ITU_R_601_4")
#define kCVImageBufferYCbCrMatrix_SMPTE_240M_1995		CFSTR("CVImageBufferYCbCrMatrix_SMPTE_240M_1995")

#endif

#pragma mark CVImageBufferRef

/*!
    @typedef	CVImageBufferRef
    @abstract   Base type for all CoreVideo image buffers

*/
typedef CVBufferRef CVImageBufferRef;

/*!
    @function   CVImageBufferGetEncodedSize
    @abstract   Returns the full encoded dimensions of a CVImageBuffer.  For example, for an NTSC DV frame this would be 720x480
    @discussion Note: When creating a CIImage from a CVImageBuffer, this is the call you should use for retrieving the image size.
    @param      imageBuffer A CVImageBuffer that you wish to retrieve the encoded size from.
    @result     A CGSize returning the full encoded size of the buffer
		Returns zero size if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGSize CVImageBufferGetEncodedSize(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;

/*!
    @function   CVImageBufferGetDisplaySize
    @abstract   Returns the nominal output display size (in square pixels) of a CVImageBuffer.  
                For example, for an NTSC DV frame this would be 640x480
    @param      imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
    @result     A CGSize returning the nominal display size of the buffer
		Returns zero size if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGSize CVImageBufferGetDisplaySize(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;

/*!
    @function   CVImageBufferGetCleanRect
    @abstract   Returns the source rectangle of a CVImageBuffer that represents the clean aperture
		of the buffer in encoded pixels.    For example, an NTSC DV frame would return a CGRect with an
		origin of 8,0 and a size of 704,480.		
		Note that the origin of this rect always the lower left	corner.   This is the same coordinate system as
		used by CoreImage.
    @param      imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
    @result     A CGSize returning the nominal display size of the buffer
		Returns zero rect if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGRect CVImageBufferGetCleanRect(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;

#if TARGET_OS_MAC
/*!
    @function   CVImageBufferGetColorSpace
    @abstract   Returns the color space of a CVImageBuffer.
    @param      imageBuffer A CVImageBuffer that you wish to retrieve the color space from.
    @result     A CGColorSpaceRef representing the color space of the buffer.
		Returns NULL if called with a non-CVImageBufferRef type or NULL.
*/
CV_EXPORT CGColorSpaceRef CVImageBufferGetColorSpace(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
#endif

#if defined(__cplusplus)
}
#endif

#endif