OPTION BASE 0 FILE GETNAME F$, "BMP,JPG,GIFファイル|*.BMP;*.JPG;*.GIF" IF F$="" THEN STOP CALL PICTURELOAD(F$,XSIZE,YSIZE) DIM M(XSIZE,YSIZE),F(-5 TO 5,-5 TO 5) ASK PIXEL ARRAY(0,0) M DO READ A$ IF A$ = "" THEN EXIT DO LET EFT = EFT + 1 PRINT "NO."; EFT; A$ READ N FOR J=1 TO N*N+2 READ A NEXT J LOOP PRINT PRINT "NUMBER (1 - ";STR$(EFT);")="; INPUT PROMPT "":EFT RESTORE FOR K = 1 TO EFT READ A$ READ N !' Nは奇数 FOR J=-(N-1)/2 TO (N-1)/2 FOR I=-(N-1)/2 TO (N-1)/2 READ F(I,J) NEXT I NEXT J READ DIV,ADD NEXT K FOR Y=0 TO YSIZE-1 FOR X=0 TO XSIZE-1 LET R=0 LET G=0 LET B=0 FOR J=-(N-1)/2 TO (N-1)/2 FOR I=-(N-1)/2 TO (N-1)/2 IF X+I>=0 AND X+I<=XSIZE-1 AND Y+J>=0 AND Y+J<=YSIZE-1 THEN CALL RGB(M(X+I,Y+J),RR,GG,BB) LET R=R+F(I,J)*RR LET G=G+F(I,J)*GG LET B=B+F(I,J)*BB END IF NEXT I NEXT J LET B=INT(B/DIV)+ADD LET G=INT(G/DIV)+ADD LET R=INT(R/DIV)+ADD LET R=MIN(255,MAX(0,R)) LET G=MIN(255,MAX(0,G)) LET B=MIN(255,MAX(0,B)) CALL PSET(X,Y,R,G,B) NEXT X NEXT Y DATA エッジ DATA 3 DATA 0, 0, 0 DATA 1, 0,-1 DATA 0, 0, 0 DATA 1, 0 DATA エッジ2 DATA 3 DATA 1, 0,-1 DATA 2, 0,-2 DATA 1, 0,-1 DATA 1, 0 DATA エッジ3 DATA 3 DATA -2,-2,-1 DATA -2,-1,-1 DATA -1,-1,-1 DATA 1, 0 DATA ぼかし DATA 3 DATA 1, 1, 1 DATA 1, 1, 1 DATA 1, 1, 1 DATA 9, 0 DATA ぼかし2 DATA 5 DATA 1, 1, 1, 1, 1 DATA 1, 1, 1, 1, 1 DATA 1, 1, 1, 1, 1 DATA 1, 1, 1, 1, 1 DATA 1, 1, 1, 1, 1 DATA 25, 0 DATA シャープ DATA 3 DATA 0,-1, 0 DATA -1, 5,-1 DATA 0,-1, 0 DATA 1, 0 DATA シャープ2 DATA 3 DATA 1,-2, 1 DATA -2, 5,-2 DATA 1,-2, 1 DATA 1, 0 DATA レリーフ DATA 3 DATA 1, 1, 0 DATA 1,-3, 0 DATA 0, 0, 0 DATA 1,176 DATA エンボス DATA 3 DATA 0, 0, 1 DATA 0, 0, 0 DATA -1, 0, 0 DATA 1,128 DATA 明 DATA 3 DATA 0, 0, 0 DATA 0, 1, 0 DATA 0, 0, 0 DATA 1,16 DATA 暗 DATA 3 DATA 0, 0, 0 DATA 0, 1, 0 DATA 0, 0, 0 DATA 1,-16 DATA 反転 DATA 3 DATA 0, 0, 0 DATA 0,-1, 0 DATA 0, 0, 0 DATA 1,255 DATA "" END
EXTERNAL SUB RGB(X,R,G,B) LET B=MOD(INT(X/65536),256) LET G=MOD(INT(X/256),256) LET R=MOD(X,256) END SUB
EXTERNAL SUB PSET(X,Y,R,G,B) SET COLOR COLORINDEX(R/255,G/255,B/255) PLOT POINTS: X , Y END SUB
EXTERNAL SUB PICTURELOAD(N$,XSIZE,YSIZE) CLEAR SET COLOR MODE "NATIVE" SET POINT STYLE 1 GLOAD N$ LET XSIZE=PIXELX(1) LET YSIZE=PIXELY(1) SET BITMAP SIZE XSIZE,YSIZE SET WINDOW 0,XSIZE-1,YSIZE-1,0 END SUB
|