Permalink
Browse files

Merge "raster" namespace into "doc" library

  • Loading branch information...
dacap committed Oct 21, 2014
1 parent d796256 commit 63995c6f0a4cf07692b3a53627680715e91896d1
Showing 395 changed files with 2,591 additions and 3,535 deletions.
View
@@ -28,7 +28,6 @@ set(aseprite_libraries
cfg-lib
css-lib
doc-lib
raster-lib
scripting-lib
undo-lib
filters-lib
@@ -206,7 +205,6 @@ add_subdirectory(filters)
add_subdirectory(fixmath)
add_subdirectory(gen)
add_subdirectory(gfx)
add_subdirectory(raster)
add_subdirectory(scripting)
add_subdirectory(she)
add_subdirectory(ui)
@@ -322,8 +320,7 @@ endfunction()
find_tests(base base-lib ${sys_libs})
find_tests(gfx gfx-lib base-lib ${sys_libs})
find_tests(raster raster-lib gfx-lib base-lib ${libs3rdparty} ${sys_libs})
find_tests(doc doc-lib raster-lib gfx-lib base-lib ${libs3rdparty} ${sys_libs})
find_tests(doc doc-lib gfx-lib base-lib ${libs3rdparty} ${sys_libs})
find_tests(css css-lib gfx-lib base-lib ${libs3rdparty} ${sys_libs})
find_tests(ui ui-lib she gfx-lib base-lib ${libs3rdparty} ${sys_libs})
find_tests(app/file ${all_libs})
View
@@ -23,16 +23,15 @@ because they don't depend on any other component.
## Level 1
* [cfg](cfg/) (base): Library to load/save .ini files.
* [doc](doc/) (base, gfx): Document model library.
* [gen](gen/) (base): Helper utility to generate C++ files from different XMLs.
* [net](net/) (base): Networking library to send HTTP requests.
* [raster](raster/) (base, gfx): Library to handle graphics entities like sprites, images, frames.
* [she](she/) (base, gfx, allegro): A wrapper for the Allegro library.
* [webserver](webserver/) (base): HTTP web server (based on [mongoose](https://github.com/valenok/mongoose))
## Level 2
* [doc](doc/) (raster, base, gfx): Document model library.
* [filters](filters/) (base, gfx, raster): FX for raster images.
* [filters](filters/) (base, doc, gfx): Effects for images.
* [ui](ui/) (base, gfx, she): Portable UI library (buttons, windows, text fields, etc.)
* [updater](updater/) (base, net): Component to check for updates.
@@ -42,7 +41,7 @@ because they don't depend on any other component.
## Level 4
* [app](app/) (allegro, base, doc, filters, gfx, iff, raster, scripting, she, ui, undo, updater, webserver)
* [app](app/) (allegro, base, doc, filters, gfx, iff, scripting, she, ui, undo, updater, webserver)
## Level 5
View
@@ -67,10 +67,10 @@
#include "base/path.h"
#include "base/unique_ptr.h"
#include "doc/document_observer.h"
#include "raster/image.h"
#include "raster/layer.h"
#include "raster/palette.h"
#include "raster/sprite.h"
#include "doc/image.h"
#include "doc/layer.h"
#include "doc/palette.h"
#include "doc/sprite.h"
#include "scripting/engine.h"
#include "she/display.h"
#include "she/error.h"
View
@@ -24,7 +24,7 @@
#include "base/string.h"
#include "base/system_console.h"
#include "base/unique_ptr.h"
#include "raster/pixel_format.h"
#include "doc/pixel_format.h"
#include <string>
#include <vector>
@@ -35,7 +35,7 @@ namespace ui {
class Window;
}
namespace raster {
namespace doc {
class Layer;
}
@@ -53,7 +53,7 @@ namespace app {
class ToolBox;
}
using namespace raster;
using namespace doc;
class App {
public:
View
@@ -26,9 +26,9 @@
#include "app/modules/palettes.h"
#include "gfx/hsv.h"
#include "gfx/rgb.h"
#include "raster/image.h"
#include "raster/palette.h"
#include "raster/primitives.h"
#include "doc/image.h"
#include "doc/palette.h"
#include "doc/primitives.h"
#include <cstdlib>
#include <iomanip>
@@ -116,7 +116,7 @@ Color Color::fromImage(PixelFormat pixelFormat, color_t c)
Color Color::fromImageGetPixel(Image *image, int x, int y)
{
if ((x >= 0) && (y >= 0) && (x < image->width()) && (y < image->height()))
return Color::fromImage(image->pixelFormat(), raster::get_pixel(image, x, y));
return Color::fromImage(image->pixelFormat(), doc::get_pixel(image, x, y));
else
return Color::fromMask();
}
View
@@ -20,19 +20,19 @@
#define APP_COLOR_H_INCLUDED
#pragma once
#include "raster/color.h"
#include "raster/pixel_format.h"
#include "doc/color.h"
#include "doc/pixel_format.h"
#include <string>
namespace raster {
namespace doc {
class Image;
class Layer;
}
namespace app {
using namespace raster;
using namespace doc;
class Color {
public:
View
@@ -24,9 +24,9 @@
#include "app/document_location.h"
#include "gfx/point.h"
#include "raster/image.h"
#include "raster/primitives.h"
#include "raster/sprite.h"
#include "doc/image.h"
#include "doc/primitives.h"
#include "doc/sprite.h"
namespace app {
@@ -48,18 +48,18 @@ void ColorPicker::pickColor(const DocumentLocation& location, int x, int y, Mode
}
else { // Pick from the current layer
int u, v;
raster::Image* image = location.image(&u, &v, NULL);
doc::Image* image = location.image(&u, &v, NULL);
gfx::Point pt(x-u, y-v);
if (image && image->bounds().contains(pt)) {
raster::color_t imageColor = get_pixel(image, pt.x, pt.y);
doc::color_t imageColor = get_pixel(image, pt.x, pt.y);
switch (image->pixelFormat()) {
case IMAGE_RGB:
m_alpha = raster::rgba_geta(imageColor);
m_alpha = doc::rgba_geta(imageColor);
break;
case IMAGE_GRAYSCALE:
m_alpha = raster::graya_geta(imageColor);
m_alpha = doc::graya_geta(imageColor);
break;
}
View
@@ -20,10 +20,10 @@
#define APP_COLOR_TARGET_H_INCLUDED
#pragma once
#include "raster/color.h"
#include "raster/layer.h"
#include "raster/pixel_format.h"
#include "raster/sprite.h"
#include "doc/color.h"
#include "doc/layer.h"
#include "doc/pixel_format.h"
#include "doc/sprite.h"
namespace app {
@@ -35,13 +35,13 @@ namespace app {
TransparentLayer
};
ColorTarget(LayerType layerType, raster::PixelFormat pixelFormat, raster::color_t maskColor) :
ColorTarget(LayerType layerType, doc::PixelFormat pixelFormat, doc::color_t maskColor) :
m_layerType(layerType),
m_pixelFormat(pixelFormat),
m_maskColor(maskColor) {
}
ColorTarget(raster::Layer* layer) :
ColorTarget(doc::Layer* layer) :
m_layerType(layer->isBackground() ? BackgroundLayer: TransparentLayer),
m_pixelFormat(layer->sprite()->pixelFormat()),
m_maskColor(layer->sprite()->transparentColor()) {
@@ -50,13 +50,13 @@ namespace app {
bool isBackground() const { return m_layerType == BackgroundLayer; }
bool isTransparent() const { return m_layerType == TransparentLayer; }
LayerType layerType() const { return m_layerType; }
raster::PixelFormat pixelFormat() const { return m_pixelFormat; }
raster::color_t maskColor() const { return m_maskColor; }
doc::PixelFormat pixelFormat() const { return m_pixelFormat; }
doc::color_t maskColor() const { return m_maskColor; }
private:
LayerType m_layerType;
raster::PixelFormat m_pixelFormat;
raster::color_t m_maskColor;
doc::PixelFormat m_pixelFormat;
doc::color_t m_maskColor;
};
} // namespace app
View
@@ -25,10 +25,10 @@
#include "app/modules/palettes.h"
#include "gfx/hsv.h"
#include "gfx/rgb.h"
#include "raster/image.h"
#include "raster/layer.h"
#include "raster/palette.h"
#include "raster/sprite.h"
#include "doc/image.h"
#include "doc/layer.h"
#include "doc/palette.h"
#include "doc/sprite.h"
namespace app {
@@ -90,19 +90,19 @@ gfx::Color color_utils::color_for_ui(const app::Color& color)
return c;
}
raster::color_t color_utils::color_for_image(const app::Color& color, PixelFormat format)
doc::color_t color_utils::color_for_image(const app::Color& color, PixelFormat format)
{
if (color.getType() == app::Color::MaskType)
return 0;
raster::color_t c = -1;
doc::color_t c = -1;
switch (format) {
case IMAGE_RGB:
c = raster::rgba(color.getRed(), color.getGreen(), color.getBlue(), 255);
c = doc::rgba(color.getRed(), color.getGreen(), color.getBlue(), 255);
break;
case IMAGE_GRAYSCALE:
c = raster::graya(color.getGray(), 255);
c = doc::graya(color.getGray(), 255);
break;
case IMAGE_INDEXED:
c = color.getIndex();
@@ -112,24 +112,24 @@ raster::color_t color_utils::color_for_image(const app::Color& color, PixelForma
return c;
}
raster::color_t color_utils::color_for_layer(const app::Color& color, Layer* layer)
doc::color_t color_utils::color_for_layer(const app::Color& color, Layer* layer)
{
return color_for_target(color, ColorTarget(layer));
}
raster::color_t color_utils::color_for_target(const app::Color& color, const ColorTarget& colorTarget)
doc::color_t color_utils::color_for_target(const app::Color& color, const ColorTarget& colorTarget)
{
if (color.getType() == app::Color::MaskType)
return colorTarget.maskColor();
raster::color_t c = -1;
doc::color_t c = -1;
switch (colorTarget.pixelFormat()) {
case IMAGE_RGB:
c = raster::rgba(color.getRed(), color.getGreen(), color.getBlue(), 255);
c = doc::rgba(color.getRed(), color.getGreen(), color.getBlue(), 255);
break;
case IMAGE_GRAYSCALE:
c = raster::graya(color.getGray(), 255);
c = doc::graya(color.getGray(), 255);
break;
case IMAGE_INDEXED:
if (color.getType() == app::Color::IndexType) {
View
@@ -23,10 +23,10 @@
#include "app/color.h"
#include "app/color_target.h"
#include "gfx/color.h"
#include "raster/color.h"
#include "raster/pixel_format.h"
#include "doc/color.h"
#include "doc/pixel_format.h"
namespace raster {
namespace doc {
class Layer;
}
@@ -37,9 +37,9 @@ namespace app {
gfx::Color blackandwhite_neg(gfx::Color color);
gfx::Color color_for_ui(const app::Color& color);
raster::color_t color_for_image(const app::Color& color, raster::PixelFormat format);
raster::color_t color_for_layer(const app::Color& color, raster::Layer* layer);
raster::color_t color_for_target(const app::Color& color, const ColorTarget& colorTarget);
doc::color_t color_for_image(const app::Color& color, doc::PixelFormat format);
doc::color_t color_for_layer(const app::Color& color, doc::Layer* layer);
doc::color_t color_for_target(const app::Color& color, const ColorTarget& colorTarget);
} // namespace color_utils
} // namespace app
@@ -28,8 +28,8 @@
#include "app/settings/settings.h"
#include "app/ui/color_bar.h"
#include "app/undo_transaction.h"
#include "raster/layer.h"
#include "raster/sprite.h"
#include "doc/layer.h"
#include "doc/sprite.h"
namespace app {
@@ -36,9 +36,9 @@
#include "app/undo_transaction.h"
#include "base/bind.h"
#include "base/unique_ptr.h"
#include "raster/image.h"
#include "raster/mask.h"
#include "raster/sprite.h"
#include "doc/image.h"
#include "doc/mask.h"
#include "doc/sprite.h"
#include "ui/ui.h"
#include "generated_canvas_size.h"
@@ -29,11 +29,11 @@
#include "app/modules/gui.h"
#include "app/undo_transaction.h"
#include "base/mem_utils.h"
#include "raster/cel.h"
#include "raster/image.h"
#include "raster/layer.h"
#include "raster/sprite.h"
#include "raster/stock.h"
#include "doc/cel.h"
#include "doc/image.h"
#include "doc/layer.h"
#include "doc/sprite.h"
#include "doc/stock.h"
#include "ui/ui.h"
namespace app {
@@ -28,9 +28,9 @@
#include "app/modules/gui.h"
#include "app/modules/palettes.h"
#include "app/undo_transaction.h"
#include "raster/dithering_method.h"
#include "raster/image.h"
#include "raster/sprite.h"
#include "doc/dithering_method.h"
#include "doc/image.h"
#include "doc/sprite.h"
namespace app {
@@ -31,8 +31,8 @@
#include "app/ui/main_window.h"
#include "app/ui/timeline.h"
#include "app/undo_transaction.h"
#include "raster/layer.h"
#include "raster/mask.h"
#include "doc/layer.h"
#include "doc/mask.h"
#include "undo/undo_history.h"
namespace app {
Oops, something went wrong.

0 comments on commit 63995c6

Please sign in to comment.