2007-11-16 18:25:45 +00:00
|
|
|
/* ASE - Allegro Sprite Editor
|
2009-01-24 00:41:01 +00:00
|
|
|
* Copyright (C) 2001-2009 David Capello
|
2007-09-18 23:57:02 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2009-08-17 21:38:00 +00:00
|
|
|
#ifndef RASTER_MASK_H_INCLUDED
|
|
|
|
#define RASTER_MASK_H_INCLUDED
|
2007-09-18 23:57:02 +00:00
|
|
|
|
|
|
|
#include "raster/gfxobj.h"
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
class Image;
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
class Mask : public GfxObj
|
2007-09-18 23:57:02 +00:00
|
|
|
{
|
2008-10-01 01:27:51 +00:00
|
|
|
public:
|
2007-09-18 23:57:02 +00:00
|
|
|
char *name; /* mask name */
|
|
|
|
int x, y, w, h; /* region bounds */
|
2008-10-01 01:27:51 +00:00
|
|
|
Image* bitmap; /* bitmapped image mask */
|
|
|
|
|
|
|
|
Mask();
|
|
|
|
Mask(const Mask& mask);
|
|
|
|
virtual ~Mask();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initialize();
|
2007-09-18 23:57:02 +00:00
|
|
|
};
|
|
|
|
|
2008-10-01 01:27:51 +00:00
|
|
|
Mask* mask_new();
|
|
|
|
Mask* mask_new_copy(const Mask* mask);
|
|
|
|
void mask_free(Mask* mask);
|
|
|
|
|
|
|
|
int mask_is_empty(Mask* mask);
|
|
|
|
void mask_set_name(Mask* mask, const char *name);
|
|
|
|
|
|
|
|
void mask_copy(Mask* mask_dst, const Mask* mask_src);
|
|
|
|
void mask_move(Mask* mask, int x, int y);
|
|
|
|
void mask_none(Mask* mask);
|
|
|
|
void mask_invert(Mask* mask);
|
|
|
|
void mask_replace(Mask* mask, int x, int y, int w, int h);
|
|
|
|
void mask_union(Mask* mask, int x, int y, int w, int h);
|
|
|
|
void mask_subtract(Mask* mask, int x, int y, int w, int h);
|
|
|
|
void mask_intersect(Mask* mask, int x, int y, int w, int h);
|
|
|
|
|
|
|
|
void mask_merge(Mask* dst, const Mask* src);
|
|
|
|
void mask_by_color(Mask* mask, const Image* image, int color, int fuzziness);
|
|
|
|
void mask_crop(Mask* mask, const Image* image);
|
2007-09-18 23:57:02 +00:00
|
|
|
|
2009-08-17 21:38:00 +00:00
|
|
|
#endif
|