aseprite/src/doc/algorithm/resize_image.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
C
Raw Normal View History

// Aseprite Document Library
// Copyright (c) 2019-2025 Igara Studio S.A.
// Copyright (c) 2001-2018 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_ALGORITHM_RESIZE_IMAGE_H_INCLUDED
#define DOC_ALGORITHM_RESIZE_IMAGE_H_INCLUDED
2014-03-30 06:40:17 +08:00
#pragma once
#include "doc/color.h"
#include "gfx/fwd.h"
namespace doc {
class Image;
class Palette;
class RgbMap;
2024-12-17 01:52:19 +08:00
namespace algorithm {
2024-12-17 01:52:19 +08:00
enum ResizeMethod {
RESIZE_METHOD_NEAREST_NEIGHBOR,
RESIZE_METHOD_BILINEAR,
RESIZE_METHOD_ROTSPRITE,
};
2024-12-17 01:52:19 +08:00
// Resizes the source image "src" to the destination image "dst".
//
// Warning: If you are using the RESIZE_METHOD_BILINEAR, the "src"
// image will be first filtered with the
// fixup_image_transparent_colors() function, which modifies the
// transparent pixels of the "src" image.
void resize_image(Image* src,
Image* dst,
const ResizeMethod method,
const Palette* palette,
const RgbMap* rgbmap,
const color_t maskColor);
2024-12-17 01:52:19 +08:00
// It does not modify the image to the human eye, but internally
// tries to fixup all colors that are completely transparent
// (alpha = 0) with the average of its 4-neighbors. Useful if you
// want to use resize_image() with images that contains
// transparent pixels.
void fixup_image_transparent_colors(Image* image);
2024-12-17 01:52:19 +08:00
} // namespace algorithm
} // namespace doc
#endif