Skip to content

Instantly share code, notes, and snippets.

View Teaonly's full-sized avatar
🎯
Focusing

Zhou Chang Teaonly

🎯
Focusing
View GitHub Profile
@Teaonly
Teaonly / printerSimu
Created March 31, 2014 02:15
A text printer simulation
function [outImage] = simu( imgfile )
txtImage = rgb2gray( imread( imgfile ));
[height width] = size(txtImage);
outImage = ones(height, width);
for y=1:2:height
for x=1:2:width
if ( txtImage(y,x) == 0)
outImage = addPoint(outImage, y, x);