From 3763ea29d0a3b3a7ba3cee8d7aad99561fe79361 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Wed, 7 Oct 2009 14:23:08 -0400 Subject: [PATCH] images.normalization: added documentation --- .../normalization/normalization-docs.factor | 29 +++++++++++++++++++ .../normalization/normalization-tests.factor | 3 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 extra/images/normalization/normalization-docs.factor diff --git a/extra/images/normalization/normalization-docs.factor b/extra/images/normalization/normalization-docs.factor new file mode 100644 index 0000000000..34c5d8fb44 --- /dev/null +++ b/extra/images/normalization/normalization-docs.factor @@ -0,0 +1,29 @@ +! Copyright (C) 2009 Keith Lazuka. +! See http://factorcode.org/license.txt for BSD license. +USING: help.markup help.syntax kernel images ; +IN: images.normalization + +HELP: normalize-image +{ $values + { "image" image } + { "image" image } +} +{ $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." } ; + +HELP: reorder-colors +{ $values + { "image" image } { "component-order" component-order } + { "image" image } +} +{ $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." } +{ $warning "The image's " { $snippet "component-type" } " will be changed to " { $snippet "ubyte-components" } " if it is not already in that format." } ; + +ARTICLE: "images.normalization" "Image normalization" +"The " { $vocab-link "images.normalization" } " vocab can be used to convert between " { $link image } " representations." +$nl +"You can normalize any image to RGBA with ubyte-components:" +{ $subsections normalize-image } +"Convert an image's pixel layout to match an arbitrary " { $link component-order } ":" +{ $subsections reorder-colors } ; + +ABOUT: "images.normalization" diff --git a/extra/images/normalization/normalization-tests.factor b/extra/images/normalization/normalization-tests.factor index f4e63c0d53..70bdf4fd32 100644 --- a/extra/images/normalization/normalization-tests.factor +++ b/extra/images/normalization/normalization-tests.factor @@ -1,4 +1,5 @@ -! BSD License. Copyright 2009 Keith Lazuka +! Copyright (C) 2009 Keith Lazuka. +! See http://factorcode.org/license.txt for BSD license. USING: images images.normalization images.normalization.private sequences tools.test ; IN: images.normalization.tests