Add a screenshot command.
This commit is contained in:
parent
aff20e9557
commit
1094c3aba9
3 changed files with 26 additions and 3 deletions
|
@ -14,6 +14,9 @@ OUTPUT=DOOM.joinpath("fabricate")
|
|||
|
||||
DEFAULT_IWAD=IWADS.joinpath("DOOM2.WAD")
|
||||
|
||||
THUMB_WIDTH=1280
|
||||
THUMB_HEIGHT=720
|
||||
|
||||
def DsdaPreamble(wad, mapstr):
|
||||
args = []
|
||||
pwadpath = PWADS.joinpath(wad)
|
||||
|
@ -54,8 +57,11 @@ def DemoInPath(wad, mapstr):
|
|||
def DemoOutPath(wad, mapstr):
|
||||
return DEMOS.joinpath(wad).joinpath(DemoName(wad, mapstr))
|
||||
|
||||
def VideoPath(wad, mapstr):
|
||||
return OUTPUT.joinpath(wad).joinpath("{}_map{}.mp4".format(wad, mapstr))
|
||||
|
||||
def DemoName(wad, mapstr):
|
||||
return "{}_map{}.lmp".format(wad, mapstr)
|
||||
|
||||
def BaseThumbPath(wad, mapstr):
|
||||
return OUTPUT.joinpath(wad).joinpath("{}_map{}_base.png".format(wad, mapstr))
|
||||
|
||||
def VideoPath(wad, mapstr):
|
||||
return OUTPUT.joinpath(wad).joinpath("{}_map{}.mp4".format(wad, mapstr))
|
||||
|
|
16
dcc/ss.py
Normal file
16
dcc/ss.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import dcc.config
|
||||
import dcc.doom_base
|
||||
import wand.image
|
||||
|
||||
class SS(dcc.doom_base.WadMap):
|
||||
def get_parser(self, prog_name):
|
||||
parser = super().get_parser(prog_name)
|
||||
parser.add_argument("-g", "--gravity", default="center")
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
with wand.image.Image(width=THUMB_WIDTH, height=THUMB_HEIGHT, pseudo="x:") as img:
|
||||
img.reset_coords()
|
||||
img.crop(width=THUMB_WIDTH,height=THUMB_HEIGHT,gravity="center")
|
||||
img.reset_coords()
|
||||
img.save(filename=dcc.config.BaseThumbPath(parsed_args.wad, parsed_args.map))
|
1
setup.py
1
setup.py
|
@ -26,6 +26,7 @@ setup(
|
|||
'fabricate = dcc.fabricate:Fabricate',
|
||||
'put = dcc.put:Put',
|
||||
'pb = dcc.pb:PB',
|
||||
'ss = dcc.ss:SS',
|
||||
],
|
||||
},
|
||||
zip_safe=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue