]> gitweb.factorcode.org Git - factor.git/commitdiff
throw in image component-orders for some more opengl formats
authorJoe Groff <arcata@gmail.com>
Wed, 24 Jun 2009 01:01:53 +0000 (20:01 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 24 Jun 2009 01:01:53 +0000 (20:01 -0500)
basis/images/images.factor
basis/opengl/gl/gl.factor

index f74233c51526c9d60a05ca3106d36cf4996cbcc7..ecf3de26e8b01cdfaaaaeb76a216b90b85f79dcb 100755 (executable)
@@ -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 )
index fb3b10354b5f1fc579344813711effcc0b6bc543..382ff06dd4fcaff34d96d56ced7fea3ecc934e63 100644 (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