Add resize_image script function

This commit is contained in:
GenevensiS
2024-10-03 17:51:49 +02:00
parent 6b0d311dc9
commit fa15206ba5
4 changed files with 38 additions and 1 deletions
+13
View File
@@ -304,6 +304,19 @@ bool EnlargeImage::operator == (const GeneratedImage& that) const {
&& border_size == that2->border_size;
}
// ----------------------------------------------------------------------------- : ResizeImage
Image ResizeImage::generate(const Options& opt) const {
Image img = image->generate(opt);
return resample(img, width, height);
}
bool ResizeImage::operator == (const GeneratedImage& that) const {
const ResizeImage* that2 = dynamic_cast<const ResizeImage*>(&that);
return that2 && *image == *that2->image
&& width == that2->width
&& height == that2->height;
}
// ----------------------------------------------------------------------------- : CropImage
Image CropImage::generate(const Options& opt) const {