Viewing contents of file '../idllib/uit/pro/checkerboard.pro'
pro checkerboard,x,width
;+
; NAME:
; CHECKERBOARD
; PURPOSE:
; To create a checkerboard array (alternating bytes 0 and 255)
; One use of CHECKERBOARD is to study resolution and distortion
; on the TV display
; CALLING SEQUENCE:
; checkerboard,x,[width]
; OPTIONAL INPUTS:
; width - size of (square) output array. If not supplied, then
; a 512 x 512 array will be output
; OUTPUTS:
; x - byte array containing alternating values
; REVISON HISTORY:
; written by B. Pfarr and W. Landsman 4/87
;-
if n_params(0) eq 0 then begin
print,string(7B),'CALLING SEQUENCE- checkerboard,x,[width]'
return
endif
if n_params(0) lt 2 then width = 512 ;Default is 512 x 512 output array
q=indgen(width) mod 2 ;Row of alternating values
x = (byte(q#q))*255b
x = shift(x,1,1) or x
return
end