aseprite/src/raster/layer.h

89 lines
2.7 KiB
C
Raw Normal View History

2007-11-16 18:25:45 +00:00
/* ASE - Allegro Sprite Editor
* Copyright (C) 2001-2005, 2007 David A. 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
*/
#ifndef RASTER_LAYER_H
#define RASTER_LAYER_H
#include "jinete/base.h"
#include "raster/gfxobj.h"
struct Frame;
struct Image;
struct Stock;
typedef struct Layer Layer;
struct Layer
2007-09-18 23:57:02 +00:00
{
GfxObj gfxobj;
char name[256]; /* layer name */
GfxObj *parent; /* parent object */
unsigned readable : 1;
unsigned writable : 1;
2007-09-18 23:57:02 +00:00
/* for GFXOBJ_LAYER_IMAGE */
int imgtype; /* image type */
int blend_mode; /* constant blend mode */
struct Stock *stock; /* stock to get images */
JList frames; /* list of frames */
/* for GFXOBJ_LAYER_SET */
JList layers;
/* XXX */
/* struct Font *font; */
/* char *text; */
/* struct Prop *pos_x; */
/* struct Prop *pos_y; */
/* struct Prop *opacity; */
/* int blend_mode; */
};
Layer *layer_new(int imgtype);
Layer *layer_set_new(void);
2007-09-18 23:57:02 +00:00
/* Layer *layer_new_text (const char *text); */
Layer *layer_new_copy(const Layer *layer);
Layer *layer_new_with_image(int imgtype, int x, int y, int w, int h, int frpos);
void layer_free(Layer *layer);
2007-09-18 23:57:02 +00:00
int layer_is_image(const Layer *layer);
int layer_is_set(const Layer *layer);
2007-09-18 23:57:02 +00:00
Layer *layer_get_prev(Layer *layer);
Layer *layer_get_next(Layer *layer);
2007-09-18 23:57:02 +00:00
void layer_set_name(Layer *layer, const char *name);
void layer_set_blend_mode(Layer *layer, int blend_mode);
void layer_set_parent(Layer *layer, GfxObj *gfxobj);
2007-09-18 23:57:02 +00:00
/* for LAYER_IMAGE */
void layer_add_frame(Layer *layer, struct Frame *frame);
void layer_remove_frame(Layer *layer, struct Frame *frame);
struct Frame *layer_get_frame(Layer *layer, int frpos);
2007-09-18 23:57:02 +00:00
/* for LAYER_SET */
void layer_add_layer(Layer *set, Layer *layer);
void layer_remove_layer(Layer *set, Layer *layer);
void layer_move_layer(Layer *set, Layer *layer, Layer *after);
void layer_render(Layer *layer, struct Image *image, int x, int y, int frpos);
Layer *layer_flatten(Layer *layer, int imgtype,
int x, int y, int w, int h, int frmin, int frmax);
#endif /* RASTER_LAYER_H */