Hi VDX, can I request a feature update.
I like to be able to use -ve width and height as in crop, but not quite so keen on being forced to only use -ve values,
so how bout making +ve width and height possible in your loc string thing ?
Below should do it in both your InpaintLoc(), and InpaintDelogo() functions.
InpaintLoc() mod in
BLUE
Code:
a = int(value(leftstr(loc,posvirg1-1)))
b = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
c = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
d = int(value(rightstr(loc,long-posvirg3)))
c = (c > 0 ) ? a+c-x: c # Added, convert +ve width to -ve width
d = (d > 0 ) ? b+d-y: d # Added, convert +ve height to -ve height
hightlight = blankclip(width=x-a+c,height=y-b+d,color=$96ff2d).converttoRGB32 # EDIT: This depends upon -ve crop values, may do elsewhere in script too.
InpaintDelogo() mod in
BLUE
Code:
a = int(value(leftstr(loc,posvirg1-1)))
b = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
c = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
d = int(value(rightstr(loc,long-posvirg3)))
c = (c > 0 ) ? a+c-x: c # Added, convert +ve width to -ve width
d = (d > 0 ) ? b+d-y: d # Added, convert +ve height to -ve height
inYV12 = clp.Crop(a,b,c,d).ConvertToYV12
inRGB24 = clp.Crop(a,b,c,d).ConvertToRGB24
inRGB32 = clp.Crop(a,b,c,d).ConvertToRGB32
Instead of converting -ve values to +ve values, I've converted +ve values to your -ve style values, just in case your logic depends upon -ve crop values.
Thankyou in advance.
EDIT:
I now see that you updated since the version script I was using,
Here mod for InpaintLoc() my mod in
BLUE, you addition in v1.12 in
DarkOrchid [ do similar for InpaintDelogo() ]
Code:
a = int(value(leftstr(loc,posvirg1-1)))
b = int(value(leftstr(rightstr(loc,long-posvirg1),posvirg2-posvirg1-1)))
c = int(value(leftstr(rightstr(loc,long-posvirg2),posvirg3-posvirg2-1)))
d = int(value(rightstr(loc,long-posvirg3)))
c = (c > 0 ) ? a+c-x: c # Added, convert +ve width to -ve width
d = (d > 0 ) ? b+d-y: d # Added, convert +ve height to -ve height
Assert (c <= 0 && d <= 0,"""Incorrect "Loc".""")
Assert (a >= 0 && b >= 0,"""Incorrect "Loc".""")
Assert (a%2 == 0 && b%2 == 0 && c%2 == 0 && d%2 == 0,"""Use even numbers for "Loc".""")
hightlight = blankclip(width=x-a+c,height=y-b+d,color=$96ff2d).converttoRGB32