]> gitweb.factorcode.org Git - factor.git/blob - basis/images/normalization/normalization-docs.factor
39e2fee7691e5d9d9127435deaecbb8dfccd8070
[factor.git] / basis / images / normalization / normalization-docs.factor
1 ! Copyright (C) 2009 Keith Lazuka.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel images ;
4 IN: images.normalization
5
6 HELP: normalize-image
7 { $values
8     { "image" image }
9     { "image'" image }
10 }
11 { $description "Converts the image to RGBA with ubyte-components. If the image is upside-down, it will be flipped right side up such that the 1st byte in the bitmap slot's byte array corresponds to the first color component of the pixel in the upper-left corner of the image." } ;
12
13 HELP: reorder-components
14 { $values
15     { "image" image } { "component-order" component-order }
16     { "image'" image }
17 }
18 { $description "Convert the bitmap in " { $snippet "image" } " such that the pixel sample layout corresponds to " { $snippet "component-order" } ". If the destination layout cannot find a corresponding value from the source layout, the value " { $snippet "255" } " will be substituted for that byte." }
19 { $warning "The image's " { $snippet "component-type" } " will be changed to " { $snippet "ubyte-components" } " if it is not already in that format."
20 $nl
21 "You cannot use this word to reorder " { $link DEPTH } ", " { $link DEPTH-STENCIL } " or " { $link INTENSITY } " component orders." } ;
22
23 ARTICLE: "images.normalization" "Image normalization"
24 "The " { $vocab-link "images.normalization" } " vocab can be used to convert between " { $link image } " representations."
25 $nl
26 "You can normalize any image to a RGBA with ubyte-components representation:"
27 { $subsections normalize-image }
28 "Convert an image's pixel layout to match an arbitrary " { $link component-order } ":"
29 { $subsections reorder-components } ;
30
31 ABOUT: "images.normalization"