Fix circular dependencies between image_impl.h <-> image_iterator.h

This problem was introduced in d732f5b05f33ed1fce4c8b900a54f617bfb4c5ae

Now image_iterator.h and image_bits.h use forward declarations. And if
someone want to use the Image implementation, ImageBits, LockImageBits,
ImageIterators, or some function inside primitive_fast.h, they just have
to include image_impl.h file.
This commit is contained in:
David Capello 2015-06-12 13:56:18 -03:00
parent 0d09ca6f20
commit 9a6ac48bfa
26 changed files with 37 additions and 51 deletions

View File

@ -14,8 +14,7 @@
#include "app/cmd/clear_cel.h"
#include "app/document.h"
#include "doc/cel.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/layer.h"
#include "doc/mask.h"
#include "doc/primitives.h"

View File

@ -14,7 +14,6 @@
#include "doc/cel.h"
#include "doc/cels_range.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/remap.h"
#include "doc/sprite.h"

View File

@ -11,8 +11,7 @@
#include "base/exception.h"
#include "base/unique_ptr.h"
#include "doc/image_bits.h"
#include "doc/image_traits.h"
#include "doc/image_impl.h"
#include "doc/pixel_format.h"
#include "doc/site.h"
#include "filters/filter_indexed_data.h"

View File

@ -8,8 +8,8 @@
#include "app/modules/palettes.h"
#include "app/tools/shade_table.h"
#include "app/tools/shading_options.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/primitives_fast.h"
#include "doc/rgbmap.h"
#include "doc/sprite.h"
#include "filters/neighboring_pixels.h"

View File

@ -25,7 +25,7 @@
#include "doc/algorithm/polygon.h"
#include "doc/brush.h"
#include "doc/compressed_image.h"
#include "doc/image.h"
#include "doc/image_impl.h"
#include "doc/mask.h"
#include "fixmath/fixmath.h"

View File

@ -30,8 +30,7 @@
#include "app/ui_context.h"
#include "base/bind.h"
#include "base/scoped_value.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/sprite.h"
#include "gfx/border.h"

View File

@ -31,8 +31,7 @@
#include "doc/algo.h"
#include "doc/brush.h"
#include "doc/cel.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/layer.h"
#include "doc/mask_boundaries.h"
#include "doc/primitives.h"

View File

@ -12,9 +12,7 @@
#include "app/util/new_image_from_mask.h"
#include "app/document.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_traits.h"
#include "doc/image_impl.h"
#include "doc/mask.h"
#include "doc/site.h"

View File

@ -10,11 +10,10 @@
#include "doc/algorithm/resize_image.h"
#include "gfx/point.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/rgbmap.h"
#include "gfx/point.h"
namespace doc {
namespace algorithm {

View File

@ -13,8 +13,7 @@
#include "fixmath/fixmath.h"
#include "doc/blend.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/primitives.h"
#include "doc/primitives_fast.h"

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (c) 2001-2014 David Capello
// Copyright (c) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
@ -11,10 +11,8 @@
#include "base/unique_ptr.h"
#include "doc/algorithm/rotate.h"
#include "doc/blend.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/primitives.h"
#include "doc/primitives_fast.h"
namespace doc {
namespace algorithm {
@ -152,7 +150,7 @@ static void image_scale2x(Image* dst, const Image* src, int src_w, int src_h)
case IMAGE_BITMAP: image_scale2x_tpl<BitmapTraits>(dst, src, src_w, src_h); break;
}
}
void rotsprite_image(Image* bmp, Image* spr,
int x1, int y1, int x2, int y2,
int x3, int y3, int x4, int y4)

View File

@ -14,7 +14,6 @@
#include "doc/algo.h"
#include "doc/blend.h"
#include "doc/color_scales.h"
#include "doc/image.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/rgbmap.h"

View File

@ -18,7 +18,7 @@
#include "doc/frame_tag.h"
#include "doc/frame_tags.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/image_ref.h"
#include "doc/layer.h"
#include "doc/mask.h"

View File

@ -8,11 +8,12 @@
#define DOC_IMAGE_BITS_H_INCLUDED
#pragma once
#include "doc/image.h"
#include "doc/image_iterator.h"
namespace doc {
class Image;
template<typename ImageTraits> class ImageIterator;
template<typename ImageTraits> class ImageConstIterator;
template<typename ImageTraits>
class ImageBits {
public:
@ -144,7 +145,7 @@ namespace doc {
const gfx::Rect& bounds() const { return m_bits.bounds(); }
Image* image() { return m_bits.image(); }
private:
Bits m_bits;

View File

@ -14,10 +14,13 @@
#include "doc/blend.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_iterator.h"
#include "doc/palette.h"
namespace doc {
template<typename ImageTraits> class LockImageBits;
template<class Traits>
class ImageImpl : public Image {
private:

View File

@ -9,9 +9,6 @@
#pragma once
#include "doc/color.h"
#include "doc/image.h"
#include "doc/image_impl.h"
#include "doc/image_traits.h"
#include "doc/primitives_fast.h"
#include "gfx/point.h"
#include "gfx/rect.h"
@ -23,6 +20,8 @@
namespace doc {
class Image;
template<typename ImageTraits,
typename PointerType,
typename ReferenceType>

View File

@ -11,8 +11,7 @@
#include <gtest/gtest.h>
#include "base/unique_ptr.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/primitives.h"
using namespace base;

View File

@ -11,8 +11,7 @@
#include "doc/mask.h"
#include "base/memory.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include <cstdlib>
#include <cstring>

View File

@ -10,8 +10,7 @@
#include "doc/mask_boundaries.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
namespace doc {

View File

@ -13,7 +13,6 @@
#include "doc/algo.h"
#include "doc/blend.h"
#include "doc/brush.h"
#include "doc/image.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/rgbmap.h"

View File

@ -9,15 +9,16 @@
#pragma once
#include "doc/color.h"
#include "doc/image_impl.h"
namespace doc {
class Image;
template<typename ImageTraits> class ImageImpl;
template<class Traits>
inline typename Traits::address_t get_pixel_address_fast(const Image* image, int x, int y) {
ASSERT(x >= 0 && x < image->width());
ASSERT(y >= 0 && y < image->height());
return (((ImageImpl<Traits>*)image)->address(x, y));
}

View File

@ -16,7 +16,7 @@
#include "doc/cel.h"
#include "doc/cels_range.h"
#include "doc/frame_tag.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/layer.h"
#include "doc/palette.h"
#include "doc/primitives.h"

View File

@ -15,9 +15,8 @@
#include "filters/filter_indexed_data.h"
#include "filters/filter_manager.h"
#include "filters/neighboring_pixels.h"
#include "doc/image.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/primitives_fast.h"
#include "doc/rgbmap.h"
namespace filters {

View File

@ -12,14 +12,13 @@
#include "filters/median_filter.h"
#include "base/memory.h"
#include "doc/image_impl.h"
#include "doc/palette.h"
#include "doc/rgbmap.h"
#include "filters/filter_indexed_data.h"
#include "filters/filter_manager.h"
#include "filters/neighboring_pixels.h"
#include "filters/tiled_mode.h"
#include "doc/image.h"
#include "doc/palette.h"
#include "doc/primitives_fast.h"
#include "doc/rgbmap.h"
#include <algorithm>

View File

@ -11,8 +11,7 @@
#include "render/quantization.h"
#include "doc/blend.h"
#include "doc/image.h"
#include "doc/image_bits.h"
#include "doc/image_impl.h"
#include "doc/images_collector.h"
#include "doc/layer.h"
#include "doc/palette.h"
@ -25,8 +24,8 @@
#include <algorithm>
#include <limits>
#include <vector>
#include <map>
#include <vector>
namespace render {

View File

@ -12,6 +12,7 @@
#include "doc/doc.h"
#include "doc/handle_anidir.h"
#include "doc/image_impl.h"
#include "gfx/clip.h"
#include "gfx/region.h"