pnm mod.pad

From DavinciWiki
Jump to: navigation, search


Description

Adds a border to the specified data.

Located in "pnm_mod" module.

Arguments and Return Values

Inputs: a Val (byte or other), pad color and pad size

Outputs: a Val that has a pad of specified color and size

Usage

Syntax: pnm_mod.pad(data = VAL , color = BOOL, left = INT, bottom = INT, top = INT, bottom = INT)

data:     any davinci array (most likely a byte image array)
color:    0 for black, 1 for white (Default is 0)
left:     pixels on the left side to pad by (Default is 0)
right:    pixels on  the right side to pad by (Default is 0)
top:      pixels on  the top side to pad by (Default is 0)
bottom:   pixels on  the bottom side to pad by (Default is 0)

Examples

dv> a=read("http://davinci.asu.edu/images/d/df/llama_face.jpg")
Downloading.done.
.............................................
/tmp/dv_7970/QkWBv0: bip JPEG image: 640x530x3, 8 bits
640x530x3 array of byte, bip format [1,017,600 bytes]

dv> b=pnm_mod.pad(a,0,70,30,150,20)
740x700x3 array of byte, bip format [1,554,000 bytes]

dv> display(a)
Writing /tmp/dv_7970/DD3fDO: 640x530x3 PNG file.
dv>  display(b)
Writing /tmp/dv_7970/XAStFa: 740x700x3 PNG  file.

Images

llama face.jpg llama face pad.jpg

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Recent Core Changes

Modified On: 02-26-2010

Personal tools