Added icon for MSE in packages window;

Added resample(image,width,height), instead of always passing in images

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@806 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-12-30 23:48:26 +00:00
parent 17965eea73
commit 5fc06663b1
14 changed files with 145 additions and 83 deletions
+19
View File
@@ -125,6 +125,15 @@ void resample_pass(const Image& img_in, Image& img_out, int offset_in, int offse
void resample(const Image& img_in, Image& img_out) {
resample_and_clip(img_in, img_out, wxRect(0, 0, img_in.GetWidth(), img_in.GetHeight()));
}
Image resample(const Image& img_in, int width, int height) {
if (img_in.GetWidth() == width && img_in.GetHeight() == height) {
return img_in; // already the right size
} else {
Image img_out(width,height,false);
resample(img_in, img_out);
return img_out;
}
}
void resample_and_clip(const Image& img_in, Image& img_out, wxRect rect) {
// mask to alpha
@@ -171,6 +180,16 @@ void resample_preserve_aspect(const Image& img_in, Image& img_out) {
resample_pass(img_temp, img_out, 0, offset_out, img_in.GetHeight(), img_temp.GetWidth(), rheight, img_out.GetWidth(), rwidth, 1, 1);
}
Image resample_preserve_aspect(const Image& img_in, int width, int height) {
if (img_in.GetWidth() == width && img_in.GetHeight() == height) {
return img_in; // already the right size
} else {
Image img_out(width,height,false);
resample_preserve_aspect(img_in, img_out);
return img_out;
}
}
// ----------------------------------------------------------------------------- : Sharpening
void sharp_downsample(const Image& img_in, Image& img_out, int amount);