1// Aseprite Document Library
2// Copyright (c) 2019 Igara Studio S.A.
3// Copyright (c) 2001-2016 David Capello
4//
5// This file is released under the terms of the MIT license.
6// Read LICENSE.txt for more information.
7
8#ifndef DOC_ALGORITHM_SHRINK_BOUNDS_H_INCLUDED
9#define DOC_ALGORITHM_SHRINK_BOUNDS_H_INCLUDED
10#pragma once
11
12#include "gfx/fwd.h"
13#include "doc/algorithm/flip_type.h"
14#include "doc/color.h"
15
16namespace doc {
17 class Cel;
18 class Image;
19 class Layer;
20
21 namespace algorithm {
22
23 // The layer is used in case the image is a tilemap and we need its tileset.
24 bool shrink_bounds(const Image* image,
25 const color_t refpixel,
26 const Layer* layer,
27 const gfx::Rect& startBounds,
28 gfx::Rect& bounds);
29
30 bool shrink_bounds(const Image* image,
31 const color_t refpixel,
32 const Layer* layer,
33 gfx::Rect& bounds);
34
35 bool shrink_cel_bounds(const Cel* cel,
36 const color_t refpixel,
37 gfx::Rect& bounds);
38
39 bool shrink_bounds2(const Image* a,
40 const Image* b,
41 const gfx::Rect& startBounds,
42 gfx::Rect& bounds);
43
44 } // algorithm
45} // doc
46
47#endif
48