throw in image component-orders for some more opengl formats

db4
Joe Groff 2009-06-23 20:01:53 -05:00
parent 85acbf4abc
commit c051665efb
2 changed files with 21 additions and 3 deletions

View File

@ -4,7 +4,8 @@ USING: combinators kernel accessors sequences math arrays ;
IN: images
SINGLETONS:
L LA BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR
A L LA BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR
INTENSITY DEPTH R RG
ubyte-components ushort-components
half-components float-components
byte-integer-components ubyte-integer-components
@ -12,7 +13,8 @@ SINGLETONS:
int-integer-components uint-integer-components ;
UNION: component-order
L LA BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR ;
A L LA BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR
INTENSITY DEPTH R RG ;
UNION: component-type
ubyte-components ushort-components
@ -26,7 +28,7 @@ UNION: unnormalized-integer-components
short-integer-components ushort-integer-components
int-integer-components uint-integer-components ;
UNION: alpha-channel BGRA RGBA ABGR ARGB ;
UNION: alpha-channel BGRA RGBA ABGR ARGB LA A INTENSITY ;
TUPLE: image dim component-order component-type upside-down? bitmap ;
@ -56,6 +58,7 @@ DEFER: bytes-per-pixel
: component-count ( component-order -- n )
{
{ A [ 1 ] }
{ L [ 1 ] }
{ LA [ 2 ] }
{ BGR [ 3 ] }
@ -68,6 +71,10 @@ DEFER: bytes-per-pixel
{ XRGB [ 4 ] }
{ BGRX [ 4 ] }
{ XBGR [ 4 ] }
{ INTENSITY [ 1 ] }
{ DEPTH [ 1 ] }
{ R [ 1 ] }
{ RG [ 2 ] }
} case ;
: pixel@ ( x y image -- start end bitmap )

View File

@ -1906,6 +1906,17 @@ CONSTANT: GL_MIN_PROGRAM_TEXEL_OFFSET_EXT HEX: 8904
CONSTANT: GL_MAX_PROGRAM_TEXEL_OFFSET_EXT HEX: 8905
! GL_ARB_texture_rectangle
CONSTANT: GL_TEXTURE_RECTANGLE_ARB HEX: 84F5
CONSTANT: GL_TEXTURE_BINDING_RECTANGLE_ARB HEX: 84F6
CONSTANT: GL_PROXY_TEXTURE_RECTANGLE_ARB HEX: 84F7
CONSTANT: GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB HEX: 84F8
CONSTANT: GL_SAMPLER_2D_RECT_ARB HEX: 8B63
CONSTANT: GL_SAMPLER_2D_RECT_SHADOW_ARB HEX: 8B64
! GL_EXT_geometry_shader4