Merge branch 'master' of git://factorcode.org/git/factor
commit
938d459b5c
|
@ -27,7 +27,7 @@ HELP: hidden-form-field
|
||||||
{ $example
|
{ $example
|
||||||
"USING: furnace.utilities io ;"
|
"USING: furnace.utilities io ;"
|
||||||
"\"bar\" \"foo\" hidden-form-field nl"
|
"\"bar\" \"foo\" hidden-form-field nl"
|
||||||
"<input type='hidden' name='foo' value='bar'/>"
|
"<input type=\"hidden\" name=\"foo\" value=\"bar\"/>"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
|
@ -261,7 +261,7 @@ $nl
|
||||||
ARTICLE: "html.templates.chloe.extend.components.example" "An example of a custom Chloe component"
|
ARTICLE: "html.templates.chloe.extend.components.example" "An example of a custom Chloe component"
|
||||||
"As an example, let's develop a custom Chloe component which renders an image stored in a form value. Since the component does not require any configuration, we can define a singleton class:"
|
"As an example, let's develop a custom Chloe component which renders an image stored in a form value. Since the component does not require any configuration, we can define a singleton class:"
|
||||||
{ $code "SINGLETON: image" }
|
{ $code "SINGLETON: image" }
|
||||||
"Now we define a method on the " { $link render* } " generic word which renders the image using " { $vocab-link "xml.literals" } ":"
|
"Now we define a method on the " { $link render* } " generic word which renders the image using " { $link { "xml.syntax" "literals" } } ":"
|
||||||
{ $code "M: image render* 2drop [XML <img src=<-> /> XML] ;" }
|
{ $code "M: image render* 2drop [XML <img src=<-> /> XML] ;" }
|
||||||
"Finally, we can define a Chloe component:"
|
"Finally, we can define a Chloe component:"
|
||||||
{ $code "COMPONENT: image" }
|
{ $code "COMPONENT: image" }
|
||||||
|
|
|
@ -107,7 +107,7 @@ $nl
|
||||||
|
|
||||||
{ { { $snippet "\"help\"" } ", " { $snippet "\"help-loc\"" } ", " { $snippet "\"help-parent\"" } } { "Where word help is stored - " { $link "writing-help" } } }
|
{ { { $snippet "\"help\"" } ", " { $snippet "\"help-loc\"" } ", " { $snippet "\"help-parent\"" } } { "Where word help is stored - " { $link "writing-help" } } }
|
||||||
|
|
||||||
{ { $snippet "\"infer\"" } { $link "compiler-transforms" } }
|
{ { $snippet "\"infer\"" } { $link "macros" } }
|
||||||
|
|
||||||
{ { { $snippet "\"inferred-effect\"" } } { $link "inference" } }
|
{ { { $snippet "\"inferred-effect\"" } } { $link "inference" } }
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ SYMBOL: commands
|
||||||
{ nop rot -rot swap spin swapd } amb-execute ;
|
{ nop rot -rot swap spin swapd } amb-execute ;
|
||||||
: makes-24? ( a b c d -- ? )
|
: makes-24? ( a b c d -- ? )
|
||||||
[
|
[
|
||||||
2 [ some-rots do-something ] times
|
some-rots do-something
|
||||||
|
some-rots do-something
|
||||||
maybe-swap do-something
|
maybe-swap do-something
|
||||||
24 =
|
24 =
|
||||||
]
|
]
|
||||||
|
|
|
@ -8,6 +8,9 @@ IN: graphics.bitmap.tests
|
||||||
: test-bitmap24 ( -- path )
|
: test-bitmap24 ( -- path )
|
||||||
"resource:extra/graphics/bitmap/test-images/thiswayup24.bmp" ;
|
"resource:extra/graphics/bitmap/test-images/thiswayup24.bmp" ;
|
||||||
|
|
||||||
|
: test-bitmap16 ( -- path )
|
||||||
|
"resource:extra/graphics/bitmap/test-images/rgb16bit.bmp" ;
|
||||||
|
|
||||||
: test-bitmap8 ( -- path )
|
: test-bitmap8 ( -- path )
|
||||||
"resource:extra/graphics/bitmap/test-images/rgb8bit.bmp" ;
|
"resource:extra/graphics/bitmap/test-images/rgb8bit.bmp" ;
|
||||||
|
|
||||||
|
|
|
@ -39,20 +39,18 @@ MACRO: (nbits>bitmap) ( bits -- )
|
||||||
[ rgb-quads>> 4 <sliced-groups> [ 3 head-slice ] map ]
|
[ rgb-quads>> 4 <sliced-groups> [ 3 head-slice ] map ]
|
||||||
[ color-index>> >array ] bi [ swap nth ] with map concat ;
|
[ color-index>> >array ] bi [ swap nth ] with map concat ;
|
||||||
|
|
||||||
: 4bit>array ( bitmap -- array )
|
ERROR: bmp-not-supported n ;
|
||||||
[ rgb-quads>> 4 <sliced-groups> [ 3 head-slice ] map ]
|
|
||||||
[ color-index>> >array ] bi [ swap nth ] with map concat ;
|
|
||||||
|
|
||||||
: raw-bitmap>array ( bitmap -- array )
|
: raw-bitmap>array ( bitmap -- array )
|
||||||
dup bit-count>>
|
dup bit-count>>
|
||||||
{
|
{
|
||||||
{ 32 [ color-index>> ] }
|
{ 32 [ color-index>> ] }
|
||||||
{ 24 [ color-index>> ] }
|
{ 24 [ color-index>> ] }
|
||||||
{ 16 [ "16bit" throw ] }
|
{ 16 [ bmp-not-supported ] }
|
||||||
{ 8 [ 8bit>array ] }
|
{ 8 [ 8bit>array ] }
|
||||||
{ 4 [ 4bit>array ] }
|
{ 4 [ bmp-not-supported ] }
|
||||||
{ 2 [ "2bit" throw ] }
|
{ 2 [ bmp-not-supported ] }
|
||||||
{ 1 [ "1bit" throw ] }
|
{ 1 [ bmp-not-supported ] }
|
||||||
} case >byte-array ;
|
} case >byte-array ;
|
||||||
|
|
||||||
ERROR: bitmap-magic ;
|
ERROR: bitmap-magic ;
|
||||||
|
|
Loading…
Reference in New Issue