Update of /cvsroot/artoolkit/artoolkit/include/AR
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32267
Modified Files:
config.h.in ar.h gsub_lite.h
Log Message:
Move pixel format from gsub_lite into global namespace.
Index: ar.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/ar.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ar.h 23 Aug 2005 18:20:40 -0000 1.6
--- ar.h 5 Apr 2006 05:48:43 -0000 1.7
***************
*** 55,62 ****
* \brief allocation macro function
*
! * allocate S element of type T.
* \param V returned allocated area pointer
* \param T type of element
! * \param S number of element
*/
#define arMalloc(V,T,S) \
--- 55,62 ----
* \brief allocation macro function
*
! * allocate S elements of type T.
* \param V returned allocated area pointer
* \param T type of element
! * \param S number of elements
*/
#define arMalloc(V,T,S) \
***************
*** 72,75 ****
--- 72,125 ----
typedef unsigned int ARUint32;
+ /** \typedef AR_PIXEL_FORMAT
+ \brief ARToolKit pixel-format specifiers.
+
+ ARToolKit functions can accept pixel data in a variety of formats.
+ This enumerations provides a set of constants you can use to request
+ data in a particular pixel format from an ARToolKit function that
+ returns data to you, or to specify that data you are providing to an
+ ARToolKit function is in a particular pixel format.
+
+ \var AR_PIXEL_FORMAT_RGB
+ Each pixel is represented by 24 bits. Eight bits per each Red, Green,
+ and Blue component. This is the native 24 bit format for the Mac platform.
+ \var AR_PIXEL_FORMAT_BGR
+ Each pixel is represented by 24 bits. Eight bits per each Blue, Red, and
+ Green component. This is the native 24 bit format for the Win32 platform.
+ \var AR_PIXEL_FORMAT_RGBA
+ Each pixel is represented by 32 bits. Eight bits per each Red, Green,
+ Blue, and Alpha component.
+ \var AR_PIXEL_FORMAT_BGRA
+ Each pixel is represented by 32 bits. Eight bits per each Blue, Green,
+ Red, and Alpha component. This is the native 32 bit format for the Win32
+ platform.
+ \var AR_PIXEL_FORMAT_ABGR
+ Each pixel is represented by 32 bits. Eight bits per each Alpha, Blue,
+ Green, and Red component. This is the native 32 bit format for the SGI
+ platform.
+ \var AR_PIXEL_FORMAT_ARGB
+ Each pixel is represented by 32 bits. Eight bits per each Alpha, Red,
+ Green, and Blue component. This is the native 32 bit format for the Mac
+ platform.
+ \var AR_PIXEL_FORMAT_2vuy
+ 8-bit 4:2:2 Component Y'CbCr format. Each 16 bit pixel is represented
+ by an unsigned eight bit luminance component and two unsigned eight bit
+ chroma components. Each pair of pixels shares a common set of chroma
+ values. The components are ordered in memory; Cb, Y0, Cr, Y1. The
+ luminance components have a range of [16, 235], while the chroma value
+ has a range of [16, 240]. This is consistent with the CCIR601 spec.
+ This format is fairly prevalent on both Mac and Win32 platforms.
+ '2vuy' is the Apple QuickTime four-character code for this pixel format.
+ The equivalent Microsoft fourCC is 'UYVY'.
+ \var AR_PIXEL_FORMAT_yuvs
+ 8-bit 4:2:2 Component Y'CbCr format. Identical to the AR_PIXEL_FORMAT_2vuy except
+ each 16 bit word has been byte swapped. This results in a component
+ ordering of; Y0, Cb, Y1, Cr.
+ This is most prevalent yuv 4:2:2 format on both Mac and Win32 platforms.
+ 'yuvs' is the Apple QuickTime four-character code for this pixel format.
+ The equivalent Microsoft fourCC is 'YUY2'.
+ */
+ typedef int AR_PIXEL_FORMAT;
+
/** \struct ARMarkerInfo
* \brief main structure for detected marker.
Index: config.h.in
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/config.h.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** config.h.in 2 Dec 2004 07:27:17 -0000 1.3
--- config.h.in 5 Apr 2006 05:48:43 -0000 1.4
***************
*** 2,5 ****
--- 2,16 ----
#define AR_CONFIG_H
+ #define AR_PIXEL_FORMAT_RGB 1
+ #define AR_PIXEL_FORMAT_BGR 2
+ #define AR_PIXEL_FORMAT_RGBA 3
+ #define AR_PIXEL_FORMAT_BGRA 4
+ #define AR_PIXEL_FORMAT_ABGR 5
+ #define AR_PIXEL_FORMAT_ARGB 7
+ #define AR_PIXEL_FORMAT_2vuy 8
+ #define AR_PIXEL_FORMAT_UYVY AR_PIXEL_FORMAT_2vuy
+ #define AR_PIXEL_FORMAT_yuvs 9
+ #define AR_PIXEL_FORMAT_YUY2 AR_PIXEL_FORMAT_yuvs
+
/*------------------------------------------------------------*/
/* */
***************
*** 17,34 ****
# ifdef AR_INPUT_V4L
# ifdef USE_EYETOY
! # define AR_PIX_FORMAT_RGB
# else
! # define AR_PIX_FORMAT_BGR
# endif
- # undef AR_PIX_FORMAT_BGRA
# endif
# ifdef AR_INPUT_DV
! # define AR_PIX_FORMAT_RGB
! # undef AR_PIX_FORMAT_BGRA
# endif
# ifdef AR_INPUT_1394CAM
! # define AR_PIX_FORMAT_RGB
# endif
--- 28,43 ----
# ifdef AR_INPUT_V4L
# ifdef USE_EYETOY
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_RGB
# else
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_BGR
# endif
# endif
# ifdef AR_INPUT_DV
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_RGB
# endif
# ifdef AR_INPUT_1394CAM
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_RGB
# endif
***************
*** 44,48 ****
# define AR_BIG_ENDIAN
# undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_ABGR
#endif
--- 53,57 ----
# define AR_BIG_ENDIAN
# undef AR_LITTLE_ENDIAN
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_ABGR
#endif
***************
*** 53,57 ****
# undef AR_BIG_ENDIAN
# define AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_BGRA
#endif
--- 62,66 ----
# undef AR_BIG_ENDIAN
# define AR_LITTLE_ENDIAN
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_BGRA
#endif
***************
*** 60,66 ****
/*------------------------------------------------------------*/
#ifdef __APPLE__
! # define AR_BIG_ENDIAN
! # undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_2vuy
#endif
--- 69,80 ----
/*------------------------------------------------------------*/
#ifdef __APPLE__
! # if defined(__BIG_ENDIAN__) // Check architecture endianess using gcc's macro.
! # define AR_BIG_ENDIAN // Most Significant Byte has greatest address in memory (ppc).
! # undef AR_LITTLE_ENDIAN
! # elif defined (__LITTLE_ENDIAN__)
! # undef AR_BIG_ENDIAN // Least significant Byte has least address in memory (i386).
! # define AR_LITTLE_ENDIAN
! # endif
! # define AR_PIXEL_FORMAT_DEFAULT AR_PIXEL_FORMAT_2vuy
#endif
***************
*** 167,178 ****
! #if defined(AR_PIX_FORMAT_ABGR) || defined(AR_PIX_FORMAT_BGRA) || defined(AR_PIX_FORMAT_RGBA) || defined(AR_PIX_FORMAT_ARGB)
! # define AR_PIX_SIZE 4
! #elif defined(AR_PIX_FORMAT_BGR) || defined(AR_PIX_FORMAT_RGB)
! # define AR_PIX_SIZE 3
! #elif defined(AR_PIX_FORMAT_2vuy) || defined(AR_PIX_FORMAT_yuvs)
! # define AR_PIX_SIZE 2
#else
! # error Unknown pixel format defined in config.h.
#endif
--- 181,192 ----
! #if (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_ABGR) || (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_BGRA) || (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_RGBA) || (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_ARGB)
! # define AR_PIX_SIZE_DEFAULT 4
! #elif (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_BGR) || (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_RGB)
! # define AR_PIX_SIZE_DEFAULT 3
! #elif (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_2vuy) || (AR_PIXEL_FORMAT_DEFAULT == AR_PIXEL_FORMAT_yuvs)
! # define AR_PIX_SIZE_DEFAULT 2
#else
! # error Unknown default pixel format defined in config.h.
#endif
Index: gsub_lite.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/gsub_lite.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** gsub_lite.h 21 Sep 2005 23:49:26 -0000 1.6
--- gsub_lite.h 5 Apr 2006 05:48:43 -0000 1.7
***************
*** 18,21 ****
--- 18,22 ----
* 2.7.8 2005-07-29 PRL Added distortion compensation enabling/disabling.
* 2.7.9 2005-08-15 PRL Added complete support for runtime selection of pixel format and rectangle/power-of-2 textures.
+ * 2.8.0 2006-04-04 PRL Move pixel format constants into toolkit global namespace (in config.h).
*
*/
***************
*** 171,235 ****
typedef struct _ARGL_CONTEXT_SETTINGS *ARGL_CONTEXT_SETTINGS_REF;
- /*!
- @typedef ARGL_PIX_FORMAT
- @abstract ARToolKit pixel-format specifiers.
- @discussion
- ARToolKit functions can accept pixel data in a variety of formats.
- This enumerations provides a set of constants you can use to request
- data in a particular pixel format from an ARToolKit function that
- returns data to you, or to specify that data you are providing to an
- ARToolKit function is in a particular pixel format.
- @constant ARGL_PIX_FORMAT_RGBA
- Each pixel is represented by 32 bits. Eight bits per each Red, Green,
- Blue, and Alpha component.
- @constant ARGL_PIX_FORMAT_ABGR
- Each pixel is represented by 32 bits. Eight bits per each Alpha, Blue,
- Green, and Red component. This is the native 32 bit format for the SGI
- platform.
- @constant ARGL_PIX_FORMAT_BGRA
- Each pixel is represented by 32 bits. Eight bits per each Blue, Green,
- Red, and Alpha component. This is the native 32 bit format for the Win32
- platform.
- @constant ARGL_PIX_FORMAT_ARGB
- Each pixel is represented by 32 bits. Eight bits per each Alpha, Red,
- Green, and Blue component. This is the native 32 bit format for the Mac
- platform.
- @constant ARGL_PIX_FORMAT_RGB
- Each pixel is represented by 24 bits. Eight bits per each Red, Green,
- and Blue component. This is the native 24 bit format for the Mac platform.
- @constant ARGL_PIX_FORMAT_BGR
- Each pixel is represented by 24 bits. Eight bits per each Blue, Red, and
- Green component. This is the native 24 bit format for the Win32 platform.
- @constant ARGL_PIX_FORMAT_2vuy
- 8-bit 4:2:2 Component Y'CbCr format. Each 16 bit pixel is represented
- by an unsigned eight bit luminance component and two unsigned eight bit
- chroma components. Each pair of pixels shares a common set of chroma
- values. The components are ordered in memory; Cb, Y0, Cr, Y1. The
- luminance components have a range of [16, 235], while the chroma value
- has a range of [16, 240]. This is consistent with the CCIR601 spec.
- This format is fairly prevalent on both Mac and Win32 platforms.
- '2vuy' is the Apple QuickTime four-character code for this pixel format.
- The equivalent Microsoft fourCC is 'UYVY'.
- @constant ARGL_PIX_FORMAT_yuvs
- 8-bit 4:2:2 Component Y'CbCr format. Identical to the ARGL_PIX_FORMAT_2vuy except
- each 16 bit word has been byte swapped. This results in a component
- ordering of; Y0, Cb, Y1, Cr.
- This is most prevalent yuv 4:2:2 format on both Mac and Win32 platforms.
- 'yuvs' is the Apple QuickTime four-character code for this pixel format.
- The equivalent Microsoft fourCC is 'YUY2'.
- */
- typedef enum {
- ARGL_PIX_FORMAT_RGBA = 1,
- ARGL_PIX_FORMAT_ABGR = 2,
- ARGL_PIX_FORMAT_BGRA = 3,
- ARGL_PIX_FORMAT_ARGB = 4,
- ARGL_PIX_FORMAT_RGB = 5,
- ARGL_PIX_FORMAT_BGR = 6,
- ARGL_PIX_FORMAT_2vuy = 7,
- ARGL_PIX_FORMAT_UYVY = ARGL_PIX_FORMAT_2vuy,
- ARGL_PIX_FORMAT_yuvs = 8,
- ARGL_PIX_FORMAT_YUY2 = ARGL_PIX_FORMAT_yuvs,
- } ARGL_PIX_FORMAT;
-
// ============================================================================
// Public globals.
--- 172,175 ----
***************
*** 512,517 ****
gsub_lite the format the pixels being passed to arglDispImage*() functions
are in. This setting applies only to the context passed in parameter
! contextSettings. The default format is determined by which of the possible
! AR_PIXEL_FORMAT_xxxx symbols was defined at the time the library was built.
Usually, image data is passed in directly from images generated by ARVideo,
and so you should ensure that ARVideo is generating pixels of the same format.
--- 452,457 ----
gsub_lite the format the pixels being passed to arglDispImage*() functions
are in. This setting applies only to the context passed in parameter
! contextSettings. The default format is determined by
! the value of AR_PIXEL_FORMAT_DEFAULT at the time the library was built.
Usually, image data is passed in directly from images generated by ARVideo,
and so you should ensure that ARVideo is generating pixels of the same format.
***************
*** 523,527 ****
@availability First appeared in ARToolKit 2.71.
*/
! int arglPixelFormatSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARGL_PIX_FORMAT format);
/*!
--- 463,467 ----
@availability First appeared in ARToolKit 2.71.
*/
! int arglPixelFormatSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT format);
/*!
***************
*** 530,535 ****
@discussion This function enquires as to the current format of pixel data being
expected by the arglDispImage*() functions. The default format is determined by
! which of the possible AR_PIXEL_FORMAT_xxxx symbols was defined at the time the
! library was built.
@param contextSettings A reference to ARGL's settings for the current OpenGL
context, as returned by arglSetupForCurrentContext() for this context.
--- 470,474 ----
@discussion This function enquires as to the current format of pixel data being
expected by the arglDispImage*() functions. The default format is determined by
! the value of AR_PIXEL_FORMAT_DEFAULT at the time the library was built.
@param contextSettings A reference to ARGL's settings for the current OpenGL
context, as returned by arglSetupForCurrentContext() for this context.
***************
*** 540,544 ****
@availability First appeared in ARToolKit 2.71.
*/
! int arglPixelFormatGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARGL_PIX_FORMAT *format, int *size);
#ifdef __cplusplus
--- 479,483 ----
@availability First appeared in ARToolKit 2.71.
*/
! int arglPixelFormatGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT *format, int *size);
#ifdef __cplusplus
|