Commit 45d13432 authored by Robert Sprowson's avatar Robert Sprowson

Add interactive help to ChangeFSI

Also
 * Trim out some redundant statements in FNdeducemode which look to have been used when JPEG was in the sprite output dialogue
 * Likewise, fix keyboard navigation in sprite output dialogue to not try to go via the (non existant) JPEG quality writeable
 * Add 'smoothing' to keyboard navigable writeables in processing dialogue
 * Bump up version number reported in Wimp_Initialise to allow interactive help messages on menus to be passed
 * Uncapitalise iconbar menu second words

Version 1.37. Tagged as 'ChangeFSI-1_37'
parent 6abbea87
......@@ -10,10 +10,10 @@ Psave:Save image
Iinfo:Info
Iscale:Scaling
Iproc:Processing
Ijpg:JPEG Output
Ispr:Sprite Output
Ijpg:JPEG output
Ispr:Sprite output
Ifast:Fast
Ichoice:Save Choices
Ichoice:Save choices
Iquit:Quit
# Common menus
PIredo:Reprocess
......@@ -27,3 +27,78 @@ BadJQ:Invalid JPEG quality in JPEG output dialogue box
BadMode:Invalid mode number in sprite output dialogue box
Proc:processed in %0 seconds
Unsaved:Image created from '%0' not saved
# Interactive help
Hinfo?/Hinfo??:This \w displays information about ChangeFSI.
Hpic?/Hpic??:\Toutput image from ChangeFSI.
Hsave0:Drag this icon to the directory in which you want to save the file, or drag it to the program into which you want to transfer the data.
Hsave1:This shows the filename for this data. If it is not a full pathname, drag the icon into a directory display.
Hsave2:\Ssave the data with the current filename. If it is not a full pathname, you must drag the icon to a directory first.
Hsave?/Hsave??:This \w allows you to save data in a file, or transfer it to another application.
Hsprite?/Hsprite??:This \w displays information on the output image produced.
Hjpeg1:\Screate colour JPEGs.
Hjpeg2:\Screate greyscale JPEGs.
Hjpeg5:Enter a quality directly in this box.|MValues in the range 0-100 are accepted and trade off file size with image quality.|MA value of 100 means 'do not compress'.|M
Hjpeg3:\Sdecrease the quality (smaller output file).
Hjpeg4:\Sincrease the quality (larger output file).
Hjpeg?/Hjpeg??:This \w sets the output JPEG type.
Hzoom?/Hzoom??:Either fill in the numerator and denominator, or click \s on the arrows, to use the given zoom factor.
Hrange?/Hrange??:This \w displays the range of pixel intensities used.
Hsrc?/Hsrc??:This \w displays information on the source image that was processed.
Hscale0:\Sdisable automatic pixel size correction for source pixels only.
Hscale18:\Sdisable all automatic pixel size correction.
Hscale19:\Sattempt to scale the image as requested but overall retain the picture aspect ratio.
Hscale1:\Sscale to fill the current screen size.
Hscale2:\Sperform no scaling.
Hscale3:\Shalve the height.
Hscale4:\Shalve the width.
Hscale5:\Shalve both the width and height.
Hscale9:\Suse a custom scaling factor.
Hscale10/Hscale12:The numerator is an initial scaling up of the source image.
Hscale11/Hscale13:The denominator is a subsequent scaling down of the source image.
Hscale6:\Senable rotation.
Hscale16:\Srotate clockwise 90 degrees.
Hscale17:\Srotate anti-clockwise 90 degrees.
Hscale7:\Sflip the image about its vertical edge.
Hscale8:\Sflip the image about its horizontal edge.
Hscale?/Hscale??:This \w sets up geometrical operations to perform on the source image.
Hproc0:\Sanalyse the source image and attempt to maximise the dynamic range used in the output.
Hproc1:\Sanalyse the source image and attempt to spread the intensities evenly in the output.
Hproc2:\Sturn off the error diffusion patterns used to trick the eye when not enough colours are available.
Hproc3:\Smake a negative.
Hproc4:\Sslightly lighten the output image.
Hproc5:\Sattempt to correct for black inked spots bigger than the given size.
Hproc6:\Sapply gamma correction for the display.
Hproc7:\Sdigitally sharpen the source image.
Hproc12:\Sdigitally soften the source image.
Hproc8:Enter a number in the range 0-128.|M0 means no correction, 128 is severe correction.
Hproc9:Enter a number for gamma.|MMonitors typically use a gamma factor of 2.2.
Hproc10:Enter a number in the range 8-31.|M8 means most sharp, 31 is slight sharpening.
Hproc11:Enter a number in the range 1 to 23.|M1 means most soft, 23 is slight softening.
Hproc?/Hproc??:This \w sets up special effects to perform on the source image.
Hout16:\Screate colour sprites.
Hout17:\Screate greyscale sprites.
Hout18:\Screate a sprite for the current desktop mode.
Hout24:\Screate a sprite for the a numbered mode.
Hout33:Enter a numbered Archimedes screen mode.
Hout3/Hout4/Hout5/Hout6/Hout7/Hout8:\Screate a sprite with the given number of colours, and square pixels.
Hout9/Hout10/Hout11/Hout12/Hout13/Hout14:\Screate a sprite with the given number of colours, and rectangular pixels.
Hout20:This is the equivalent mode number based on the current selection.
Hout15:\Screate a sprite using one of ChangeFSI's special colour matching options.
Hout19:Choose from one of four colour matching options, depending on the output colours selected.|Mc: 2 or 4 colours|Md: 2, 16 or 256 colours|Mt: 2, 16 or 256 colours|Mr: 4, 16 or 256 colours
Hout?/Hout??:This \w sets the output sprite type.
Himnu0:\Rsee information about ChangeFSI.
Himnu1:\Rset the scaling factors.
Himnu2:\Rset extra image processing steps.
Himnu3:\Schoose sprite output.|M\Rset the output sprite type.
Himnu4:\Schoose JPEG output.|M\Rset the output JPEG type.
Himnu5/Hpmnu5:\Sredo this image with the selected options.
Himnu5g:\Gno image has been processed yet.
Himnu6:\Sswitch to a low video mode while calculating.
Himnu6g:\Gthe computer is already configured to be fast.
Himnu7:\Ssave the current setup as the default.
Himnu8:\Squit ChangeFSI.
Hpmnu0:\Rsee information about the output image.
Hpmnu1:\Rsee information about the input image.
Hpmnu2:\Rsee information about the range used.
Hpmnu3:\Rset the zoom factors.
Hpmnu4:\Rsave this image to disc.
No preview for this file type
No preview for this file type
/* (1.36)
/* (1.37)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.36
#define Module_MajorVersion_CMHG 1.37
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Oct 2012
#define Module_Date_CMHG 28 Oct 2012
#define Module_MajorVersion "1.36"
#define Module_Version 136
#define Module_MajorVersion "1.37"
#define Module_Version 137
#define Module_MinorVersion ""
#define Module_Date "27 Oct 2012"
#define Module_Date "28 Oct 2012"
#define Module_ApplicationDate "27-Oct-12"
#define Module_ApplicationDate "28-Oct-12"
#define Module_ComponentName "ChangeFSI"
#define Module_ComponentPath "mixed/RiscOS/Sources/Apps/ChangeFSI"
#define Module_FullVersion "1.36"
#define Module_HelpVersion "1.36 (27 Oct 2012)"
#define Module_LibraryVersionInfo "1:36"
#define Module_FullVersion "1.37"
#define Module_HelpVersion "1.37 (28 Oct 2012)"
#define Module_LibraryVersionInfo "1:37"
TEXTLOAD "source.ChangeFSI"
TEXTLOAD "n.ChangeFSI"
CRUNCH %11101
SAVE "DataFiles.ChangeFSI"
QUIT
......@@ -39,9 +39,10 @@ IF task% THEN
DIM msgb% 16,msgf% S%
SYS"MessageTrans_OpenFile",msgb%,"<ChangeFSI$Dir>.Messages",msgf%
startfile%=RIGHT$(A$,6)<>"-wimp "
DIM taskid%4
DIM taskid% 4,taskmsg% 4
$taskid%="TASK"
SYS "Wimp_Initialise",200,!taskid%,FNmsg0("_TaskName") TO version%
!taskmsg%=0:REM All messages
SYS "Wimp_Initialise",310,!taskid%,FNmsg0("_TaskName"),taskmsg% TO version%
IF version%>=350 THEN
SYS "XOS_Memory",8+(2<<8) TO ,r1,r2;F%
IF F% AND 1 vramsize%=0 ELSE vramsize%=r1*r2
......@@ -86,6 +87,7 @@ IF task% THEN
sar%= FALSE
saved%= TRUE
isopen%= FALSE
lastm%= 0
z$= STRING$(12,CHR$13)
SYS "OS_Byte",161,&8C TO ,,f%
IF f% AND 1 THEN
......@@ -110,7 +112,7 @@ IF task% THEN
p%(0)=!(z%+88+8*32+20)
p%(1)=!(z%+88+9*32+20)
p%(2)=!(z%+88+10*32+20)
p%(3)=!(z%+88+12*32+20)
p%(3)=!(z%+88+11*32+20)
PROCdotemplate("Output")
SYS CreateW,,z% TO output%
admode%=!(z%+88+20*32+20)
......@@ -297,8 +299,8 @@ ELSE
REM Grab all the memory
ON ERROR ON ERROR OFF:OSCLI"Set ChangeFSI$ReturnCode "+REPORT$+" (code "+ STR$ERL+")":PROCremovearea:CLEAR:END=Q%:END
foo%=0
A%=FNChangeFSI(A$,-1,-1,0,-1,-1,foo%,TRUE)
REM Call program
A%=FNChangeFSI(A$,-1,-1,0,-1,-1,foo%,TRUE)
PROCremovearea
OSCLI"unset ChangeFSI$ReturnCode"
CLEAR
......@@ -410,10 +412,68 @@ DEF PROCreceive(q%)
SYS "XOS_ReadVarVal","ChangeFSI$Dir",paltemp%,256,0,3 TO ,,bootlen%
paltemp%?bootlen%=13
BPUT#q%!20,"Run "+$paltemp%
WHEN &502
REM Interactive help
PROCgethelp(q%!32,q%!36)
ENDCASE
ENDPROC
:
REM
DEF PROCgethelp(w%,i%)
IF i%<-1 THEN ENDPROC
CASE w% OF
WHENinfow%
$(q%+20)=FNmsg0("Hinfo"+STR$(i%))
WHENproc%
$(q%+20)=FNmsg0("Hproc"+STR$(i%))
WHENoutput%
$(q%+20)=FNmsg0("Hout"+STR$(i%))
WHENscalew%
$(q%+20)=FNmsg0("Hscale"+STR$(i%))
WHENsave%
$(q%+20)=FNmsg0("Hsave"+STR$(i%))
WHENsinfo%
$(q%+20)=FNmsg0("Hsprite"+STR$(i%))
WHENsrcinfo%
$(q%+20)=FNmsg0("Hsrc"+STR$(i%))
WHENraninfo%
$(q%+20)=FNmsg0("Hrange"+STR$(i%))
WHENzoom%
$(q%+20)=FNmsg0("Hzoom"+STR$(i%))
WHENjpego%
$(q%+20)=FNmsg0("Hjpeg"+STR$(i%))
WHENpic%
$(q%+20)=FNmsg0("Hpic"+STR$(i%))
WHEN-2
ENDPROC:REM Default from !Help used
OTHERWISE
IF i%<>-1 THEN
REM Must be a menu then
SYS "Wimp_GetMenuState",1,q%+20,w%,i%
IF lastm%=101 THEN
REM The iconbar menu
LOCAL grey$
IF (q%!20=6) AND vram% THEN grey$="g"
IF (q%!20=5) AND (F$="" OR F$="SpriteFile" OR F$="JPEGImage") THEN grey$="g"
$(q%+20)=FNmsg0("Himnu"+STR$(q%!20)+grey$)
ELSE
IF lastm%=pic% THEN
REM The picture menu
$(q%+20)=FNmsg0("Hpmnu"+STR$(q%!20))
ELSE
REM Yikes, some menu we didn't open
ENDPROC
ENDIF
ENDIF
ENDIF
ENDCASE
q%!0=((20+LEN($(q%+20))+1)+3)ANDNOT3
q%!12=q%!8
q%!16=&503:REM Message_HelpReply
SYS "Wimp_SendMessage",17,q%,q%!4
ENDPROC
:
REM
DEF PROCcallFSI
IF FNcheckvalues <> 0 THEN ENDPROC
A$=FNdeducemode
......@@ -573,6 +633,7 @@ DEF PROCfinishandquit
PROCremovearea
SYS "Wimp_CloseDown"
SYS "XMessageTrans_CloseFile",msgb%
END
ENDPROC
:
REM
......@@ -613,33 +674,27 @@ DEF PROCkey(handle%,icon%,key%)
WHEN save%
IF key%=13 PROCsavesprite:ENDPROC
WHEN output%
IF icon%=34 AND FNgeticonstate(output%, 24) THEN $admode% = $oldmode%:!q%=output%:q%!4=20:q%!8=0:q%!12=0:SYS SetI,,q%
IF icon%=33 AND FNgeticonstate(output%, 24) THEN $admode% = $oldmode%:!q%=output%:q%!4=20:q%!8=0:q%!12=0:SYS SetI,,q%
PROCshowscaletofit
IF key%=13 SYS CrMenu,,-1:ENDPROC
IF key%=&18e THEN
CASE icon% OF
WHEN 19
icon%=34
icon%=33
key%=oldmode%
WHEN 34
icon%=22
key%=adjpegq%
WHEN 22
WHEN 33
icon%=19
key%=adspcl%
ENDCASE
ENDIF
IF key%=&18f THEN
CASE icon% OF
WHEN 22
icon%=34
key%=oldmode%
WHEN 34
WHEN 33
icon%=19
key%=adspcl%
WHEN 19
icon%=22
key%=adjpegq%
icon%=33
key%=oldmode%
ENDCASE
ENDIF
IF key%>1024 SYS &400d2,output%,icon%,,,-1,LEN $key%:ENDPROC
......@@ -647,12 +702,12 @@ DEF PROCkey(handle%,icon%,key%)
CASE key% OF
WHEN &18e,13
icon%+=1
IF icon%>10 icon%=8:IF key%=13 SYS CrMenu,,-1:ENDPROC
IF icon%>11 icon%=8:IF key%=13 SYS CrMenu,,-1:ENDPROC
SYS &400d2,proc%,icon%,,,-1,LEN $p%(icon%-8)
ENDPROC
WHEN &18f
icon%-=1
IF icon%<8 icon%=10
IF icon%<8 icon%=11
SYS &400d2,proc%,icon%,,,-1,LEN $p%(icon%-8)
ENDPROC
ENDCASE
......@@ -705,6 +760,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
imenu$=imenu$+FNmsg0("Ispr")+">output%:dest%,"+FNmsg0("Ijpg")+">jpego%:1-dest%,"+FNmsg0("PIredo")+","
imenu$=imenu$+FNmsg0("Ifast")+":fast%AND1,"+FNmsg0("Ichoice")+","+FNmsg0("Iquit")
moved%= FALSE
REM Button 'menu'
IF b% AND 2 THEN
CASE handle% OF
WHEN pic%
......@@ -714,6 +770,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
ENDCASE
rmenuhandle%=handle%
ENDIF
REM Button 'select'
IF b% AND 4 THEN
CASE handle% OF
WHEN zoom%
......@@ -729,6 +786,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
ENDCASE
ENDCASE
ENDIF
REM Button 'adjust'
IF b% AND 1 THEN
CASE handle% OF
WHEN zoom%
......@@ -744,6 +802,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
ENDCASE
ENDCASE
ENDIF
REM Button 'adjust' or 'select'
IF b% AND 5 THEN
CASE handle% OF
WHEN output%
......@@ -905,8 +964,8 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
q%!12=1<<21
SYS SetI,,q%
PROCkillcurrent(FNdeducemode)
SYS Caretpos%,output%,34,,,-1,LEN ($oldmode%)
WHEN 34
SYS Caretpos%,output%,33,,,-1,LEN ($oldmode%)
WHEN 33
IF moved% SYS Caretpos%,output%,q%!4,q%!8,q%!12,q%!16,q%!20
WHEN 19
IF moved% SYS Caretpos%,output%,q%!4,q%!8,q%!12,q%!16,q%!20
......@@ -1030,6 +1089,7 @@ DEF PROCdomenu(handle%,menu$,menutitle$)
UNTIL item$=""
menuptr%!-24=(menuptr%!-24) OR &80
IF handle%=101 SYS CrMenu,,buffer%,mousex%-64,96+9*44 ELSE SYS CrMenu,,buffer%,mousex%-64,mousey%
lastm%=handle%:REM Record last menu opened for interactive help
ENDPROC
:
REM
......@@ -1269,29 +1329,24 @@ ENDPROC
REM
DEF FNdeducemode
LOCAL m,x,y
IF FNgeticonstate(output%,21) THEN
IF FNgeticonstate(output%,17) THEN ="JPEG8" ELSE ="JPEG24"
IF FNgeticonstate(output%,18) THEN
REM Use current screen mode
SYS &35,-1,9 TO ,,m:REM log2bpp
IF m>3 THEN
SYS &35,-1,4 TO ,,x:REM xeigen
SYS &35,-1,5 TO ,,y:REM yeigen
x=180/(2^x)
y=180/(2^y)
="S"+ STR$(2^m)+","+ STR$x+","+ STR$y
ELSE
= STR$MODE
ENDIF
ELSE
IF FNgeticonstate(output%,18) THEN
SYS &6,135 TO ,,m
REM OS_Byte 135 to read current screen mode
REM SYS&35,-1,9 TO,,m:IFm>3 THEN
SYS &35,-1,9 TO ,,m
IF m>3 THEN
SYS &35,-1,4 TO ,,x
SYS &35,-1,5 TO ,,y
x=180/(2^x)
y=180/(2^y)
="S"+ STR$(2^m)+","+ STR$x+","+ STR$y
ELSE
= STR$MODE
ENDIF
IF FNgeticonstate(output%,24) THEN
REM Use the number from the writeable icon
=$oldmode%
ELSE
IF FNgeticonstate(output%,24) THEN
=$oldmode%
ELSE
=$admode%
ENDIF
=$admode%
ENDIF
ENDIF
:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment