diff --git a/src/core/Color.h b/src/core/Color.h index 419173c..4141138 100644 --- a/src/core/Color.h +++ b/src/core/Color.h @@ -3,11 +3,6 @@ class Color { - unsigned mR; - unsigned mG; - unsigned mB; - double mAlpha; - public: Color(unsigned r, unsigned g, unsigned b, double a = 1.0); @@ -19,6 +14,12 @@ public: unsigned GetG() const; unsigned GetB() const; double GetAlpha() const; + +private: + unsigned mR{0}; + unsigned mG{0}; + unsigned mB{0}; + double mAlpha{0.0}; }; using ColorPtr = std::shared_ptr; diff --git a/src/geometry/AbstractGeometricItem.h b/src/geometry/AbstractGeometricItem.h new file mode 100644 index 0000000..3178acb --- /dev/null +++ b/src/geometry/AbstractGeometricItem.h @@ -0,0 +1,13 @@ +#pragma once + +class Rectangle; +class Grid; + +class AbstractGeometricItem +{ +public: + + Rectangle GetBounds() const = 0; + + void Sample(Grid* grid) const = 0; +}; diff --git a/src/geometry/CMakeLists.txt b/src/geometry/CMakeLists.txt index 59e92a8..7a509da 100644 --- a/src/geometry/CMakeLists.txt +++ b/src/geometry/CMakeLists.txt @@ -1,7 +1,21 @@ list(APPEND geometry_LIB_INCLUDES + AbstractGeometricItem.h + Circle.h + Circle.cpp + DiscretePoint.h DiscretePoint.cpp + Grid.h + Grid.cpp + Line.h + Line.cpp + Path.h + Path.cpp + Point.h Point.cpp - Rectangle.cpp) + Rectangle.h + Rectangle.cpp + Triangle.h + Triangle.cpp) # add the library diff --git a/src/geometry/Circle.cpp b/src/geometry/Circle.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Circle.h b/src/geometry/Circle.h new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/DiscretePoint.h b/src/geometry/DiscretePoint.h index b0b6d0e..06c8399 100644 --- a/src/geometry/DiscretePoint.h +++ b/src/geometry/DiscretePoint.h @@ -4,20 +4,20 @@ class DiscretePoint { - unsigned mX; - unsigned mY; + unsigned mX; + unsigned mY; public: - DiscretePoint(unsigned x, unsigned y); + DiscretePoint(unsigned x, unsigned y); - ~DiscretePoint(); + ~DiscretePoint(); - std::shared_ptr Create(unsigned x, unsigned y); + std::shared_ptr Create(unsigned x, unsigned y); - unsigned GetX() const; + unsigned GetX() const; - unsigned GetY() const; + unsigned GetY() const; }; using Pixel = DiscretePoint; diff --git a/src/geometry/Grid.cpp b/src/geometry/Grid.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Grid.h b/src/geometry/Grid.h new file mode 100644 index 0000000..70038ea --- /dev/null +++ b/src/geometry/Grid.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Rectangle.h" +#include + +class Grid +{ +public: + + Grid(const Rectangle& bounds) + : mBounds(bounds) + { + mValues = std::vector(mNumX*mNumY, 0.0); + } + + Rectangle GetBounds() const + { + return mBounds; + } + + double GetXSpacing() const + { + return mBounds.GetWidth()/double(mNumX); + } + + double GetYSpacing() const + { + return mBounds.GetHeight()/double(mNumY); + } + + std::vector GetValues() const + { + return mValues; + } + + void ResetBounds(const Rectangle& bounds) + { + mBounds = bounds; + mValues = std::vector(mNumX*mNumY, 0.0); + } + + void SetValues(const std::vector& indices, double value) + { + for (auto index : indices) + { + mValues[index] = value; + } + } + + +private: + Rectangle mBounds; + std::vector mValues; + unsigned mNumX{5}; + unsigned mNumY{5}; +}; diff --git a/src/geometry/Line.cpp b/src/geometry/Line.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Line.h b/src/geometry/Line.h new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Path.cpp b/src/geometry/Path.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Path.h b/src/geometry/Path.h new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Point.h b/src/geometry/Point.h index d22051e..8eaf359 100644 --- a/src/geometry/Point.h +++ b/src/geometry/Point.h @@ -1,19 +1,47 @@ #pragma once #include +#include class Point { - double mX; - double mY; - public: - Point(double x, double y); + Point(double x, double y); - ~Point(); + ~Point(); - std::shared_ptr Create(double x, double y); + std::shared_ptr Create(double x, double y); + + double GetX() const + { + return mX; + } + + double GetY() const + { + return mY; + } + + double GetDistance(const Point& point) const + { + return std::sqrt(mX*point.GetX() + mY*point.GetY()); + } + + double GetDeltaX(const Point& point) const + { + return point.GetX() - mX; + } + + double GetDeltaY(const Point& point) const + { + return point.GetY() - mY; + } + +private: + + double mX; + double mY; }; using PointPtr = std::shared_ptr; diff --git a/src/geometry/Rectangle.h b/src/geometry/Rectangle.h index 11c121f..b204361 100644 --- a/src/geometry/Rectangle.h +++ b/src/geometry/Rectangle.h @@ -1,7 +1,40 @@ #pragma once +#include "AbstractGeometricItem.h" +#include "Point.h" -class Rectangle +class Rectangle : public AbstractGeometricItem { +public: + Rectangle(const Point& bottomLeft, const Point& topRight) + : mBottomLeft(bottomLeft), + mTopRight(topRight) + { + + } + + Rectangle GetBounds() const override + { + return Rectangle(mBottomLeft, mTopRight); + } + + void Sample(Grid* grid) const override + { + + } + + double GetHeight() const + { + return mBottomLeft.GetDeltaY(mTopRight); + } + + double GetWidth() const + { + return mBottomLeft.GetDeltaX(mTopRight); + } + +private: + Point mBottomLeft; + Point mTopRight; }; diff --git a/src/geometry/Triangle.cpp b/src/geometry/Triangle.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/geometry/Triangle.h b/src/geometry/Triangle.h new file mode 100644 index 0000000..e69de29 diff --git a/src/graphics/CMakeLists.txt b/src/graphics/CMakeLists.txt index d15d319..732061c 100644 --- a/src/graphics/CMakeLists.txt +++ b/src/graphics/CMakeLists.txt @@ -4,33 +4,7 @@ set(platform_HEADERS "") set(platform_LIBS "") if (UNIX) -find_package(PkgConfig) -PKG_CHECK_MODULES(PC_CAIRO cairo) -FIND_PATH(CAIRO_INCLUDE_DIRS - NAMES cairo.h - HINTS ${PC_CAIRO_INCLUDEDIR} - ${PC_CAIRO_INCLUDE_DIRS} - PATH_SUFFIXES cairo -) - -FIND_LIBRARY(CAIRO_LIBRARIES - NAMES cairo - HINTS ${PC_CAIRO_LIBDIR} - ${PC_CAIRO_LIBRARY_DIRS} -) -list(APPEND platform_LIB_INCLUDES - cairo/CairoInterface.cpp - cairo/CairoDrawingSurface.cpp - cairo/CairoDrawingContext.cpp -) -list(APPEND platform_INCLUDE_DIRS - ${CAIRO_INCLUDE_DIRS} -) -list(APPEND platform_HEADERS - cairo/CairoInterface.h -) -list(APPEND platform_LIBS - ${CAIRO_LIBRARIES} +list(APPEND platform_LIBSs GL ) else() @@ -43,6 +17,7 @@ list(APPEND graphics_LIB_INCLUDES DrawingContext.cpp DrawingManager.cpp DrawingSurface.cpp + Rasterizer.cpp opengl/OpenGlInterface.cpp ${platform_LIB_INCLUDES} ) @@ -50,6 +25,7 @@ list(APPEND graphics_LIB_INCLUDES list(APPEND graphics_HEADERS opengl/OpenGlInterface.h ${platform_HEADERS} + Rasterizer.h INativeDrawingSurface.h INativeDrawingContext.h) diff --git a/src/graphics/DrawingContext.cpp b/src/graphics/DrawingContext.cpp index 11fc990..8bc60e3 100644 --- a/src/graphics/DrawingContext.cpp +++ b/src/graphics/DrawingContext.cpp @@ -1,6 +1,7 @@ #include "DrawingContext.h" #include "INativeDrawingContext.h" +#include "AbstractGeometricItem.h" std::unique_ptr DrawingContext::Create() { @@ -16,3 +17,18 @@ INativeDrawingContext* DrawingContext::GetNativeContext() { return mNativeDrawingContext.get(); } + +void DrawingContext::AddDrawable(AbstractGeometricItemPtr item) +{ + mItems.push_back(std::move(item)); +} + +unsigned DrawingContext::GetNumItems() const +{ + return mItems.size(); +} + +AbstractGeometricItem* DrawingContext::GetDrawable(unsigned idx) const +{ + return mItems[idx].get(); +} diff --git a/src/graphics/DrawingContext.h b/src/graphics/DrawingContext.h index ecc411a..545e517 100644 --- a/src/graphics/DrawingContext.h +++ b/src/graphics/DrawingContext.h @@ -1,8 +1,11 @@ #pragma once #include +#include class INativeDrawingContext; +class AbstractGeometricItem; +using AbstractGeometricItemPtr = std::unique_ptr; class DrawingContext { @@ -15,8 +18,15 @@ public: INativeDrawingContext* GetNativeContext(); + unsigned GetNumItems() const; + + void AddDrawable(AbstractGeometricItemPtr item); + + AbstractGeometricItem* GetDrawable(unsigned idx) const; + private: + std::vector > mItems; std::unique_ptr mNativeDrawingContext; }; diff --git a/src/graphics/DrawingManager.cpp b/src/graphics/DrawingManager.cpp index 2528153..604b79f 100644 --- a/src/graphics/DrawingManager.cpp +++ b/src/graphics/DrawingManager.cpp @@ -3,15 +3,12 @@ #include "INativeDrawingContext.h" #include "DrawingSurface.h" #include "DrawingContext.h" -#ifdef __linux__ -#include "CairoInterface.h" -#endif +#include "Rasterizer.h" DrawingManager::DrawingManager() + : mRasterizer(std::make_unique()) { -#ifdef __linux__ - mCairoInterface = CairoInterface::Create(); -#endif + } std::unique_ptr DrawingManager::Create() @@ -23,23 +20,11 @@ void DrawingManager::InitalizeSurface(unsigned width, unsigned height) { mDrawingSurface = DrawingSurface::Create(); mDrawingSurface->SetSize(width, height); -#ifdef __linux__ - if (mCairoInterface) - { - mCairoInterface->InitializeSurface(mDrawingSurface.get()); - } -#endif } void DrawingManager::InitializeContext() { mDrawingContext = DrawingContext::Create(); -#ifdef __linux__ - if (mCairoInterface && mDrawingSurface) - { - mCairoInterface->InitializeContext(mDrawingContext.get(), mDrawingSurface.get()); - } -#endif } void DrawingManager::AddText(TextElement* text) @@ -53,20 +38,9 @@ void DrawingManager::AddText(TextElement* text) { return; } -#ifdef __linux__ - if (mCairoInterface) - { - mCairoInterface->AddText(text, mDrawingContext.get()); - } -#endif } void DrawingManager::RenderToFile(const std::string& path) { -#ifdef __linux__ - if (mDrawingSurface && mCairoInterface) - { - mCairoInterface->RenderToFile(mDrawingSurface.get(), path); - } -#endif + } diff --git a/src/graphics/DrawingManager.h b/src/graphics/DrawingManager.h index d4b2e9e..66eb27e 100644 --- a/src/graphics/DrawingManager.h +++ b/src/graphics/DrawingManager.h @@ -4,9 +4,6 @@ #include #include "INativeDrawingContext.h" #include "INativeDrawingSurface.h" -#ifdef __linux__ -#include "CairoInterface.h" -#endif class TextElement; @@ -15,6 +12,8 @@ using DrawingSurfacePtr = std::unique_ptr; class DrawingContext; using DrawingContextPtr = std::unique_ptr; +class Rasterizer; + class DrawingManager { public: @@ -26,11 +25,9 @@ public: void RenderToFile(const std::string& path); private: + std::unique_ptr mRasterizer; DrawingSurfacePtr mDrawingSurface {nullptr}; DrawingContextPtr mDrawingContext {nullptr}; -#ifdef __linux__ - CairoInterfacePtr mCairoInterface {nullptr}; -#endif }; using DrawingManagerPtr = std::unique_ptr; diff --git a/src/graphics/DrawingSurface.cpp b/src/graphics/DrawingSurface.cpp index 3f1e254..128595b 100644 --- a/src/graphics/DrawingSurface.cpp +++ b/src/graphics/DrawingSurface.cpp @@ -38,3 +38,8 @@ unsigned DrawingSurface::GetHeight() const { return mHeight; } + +void DrawingSurface::Paint(Grid* grid) +{ + mImageBuffer = std::make_unique(); +} diff --git a/src/graphics/DrawingSurface.h b/src/graphics/DrawingSurface.h index ea08136..d971b3b 100644 --- a/src/graphics/DrawingSurface.h +++ b/src/graphics/DrawingSurface.h @@ -4,6 +4,9 @@ #include "INativeDrawingSurface.h" +class Grid; +class Image; + class DrawingSurface { public: @@ -21,9 +24,14 @@ public: unsigned GetHeight() const; + void Paint(Grid* grid); + + Image* GetAsImage() const; + private: unsigned mWidth = 0; unsigned mHeight = 0; + std::unique_ptr mImageBuffer; std::unique_ptr mNativeDrawingSurface; }; diff --git a/src/graphics/Rasterizer.cpp b/src/graphics/Rasterizer.cpp new file mode 100644 index 0000000..c5b1b5e --- /dev/null +++ b/src/graphics/Rasterizer.cpp @@ -0,0 +1,25 @@ +#include "Rasterizer.h" + +#include "DrawingSurface.h" +#include "DrawingContext.h" +#include "Grid.h" + +Rasterizer::Rasterizer() + : mGrid(std::make_unique(Rectangle(Point(0, 0), Point(100, 100)))) +{ + +} + +void Rasterizer::Paint(DrawingSurface* surface, DrawingContext* context) +{ + const auto width = surface->GetWidth(); + const auto height = surface->GetHeight(); + mGrid->ResetBounds(Rectangle(Point(0, 0), Point(width, height))); + + for (unsigned idx=0; idx< context->GetNumItems(); idx++) + { + context->GetDrawable(idx)->Sample(mGrid.get()); + } + + surface->Paint(mGrid.get()); +} diff --git a/src/graphics/Rasterizer.h b/src/graphics/Rasterizer.h new file mode 100644 index 0000000..5ccf861 --- /dev/null +++ b/src/graphics/Rasterizer.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +class DrawingSurface; +class DrawingContext; +class Grid; + +class Rasterizer +{ +public: + Rasterizer(); + + void Paint(DrawingSurface* surface, DrawingContext* context); + +private: + std::unique_ptr mGrid; +}; diff --git a/src/graphics/cairo/CairoDrawingContext.cpp b/src/graphics/cairo/CairoDrawingContext.cpp deleted file mode 100644 index fa2cca4..0000000 --- a/src/graphics/cairo/CairoDrawingContext.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "CairoDrawingContext.h" - - cairo_t* CairoDrawingContext::GetNativeContext() - { - return mNativeContext; - } - - CairoDrawingContext::CairoDrawingContext(cairo_t* context) - : mNativeContext(context) - { - - } - -CairoDrawingContext::~CairoDrawingContext() - { - DestroyNativeContext(); - } - -std::unique_ptr CairoDrawingContext::Create(cairo_t* context) - { - return std::make_unique(context); - } - - void CairoDrawingContext::DestroyNativeContext() - { - if (mNativeContext) - { - cairo_destroy (mNativeContext); - mNativeContext = nullptr; - } - } diff --git a/src/graphics/cairo/CairoDrawingContext.h b/src/graphics/cairo/CairoDrawingContext.h deleted file mode 100644 index 6286a5c..0000000 --- a/src/graphics/cairo/CairoDrawingContext.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "INativeDrawingContext.h" - -#include -#include - -class CairoDrawingContext : public INativeDrawingContext -{ -public: - - CairoDrawingContext(cairo_t* context); - - virtual ~CairoDrawingContext(); - - static std::unique_ptr Create(cairo_t* context); - - cairo_t* GetNativeContext(); - - void DestroyNativeContext(); - -private: - cairo_t* mNativeContext; -}; - -using CairoDrawingContextPtr = std::unique_ptr; - diff --git a/src/graphics/cairo/CairoDrawingSurface.cpp b/src/graphics/cairo/CairoDrawingSurface.cpp deleted file mode 100644 index 28f31e0..0000000 --- a/src/graphics/cairo/CairoDrawingSurface.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "CairoDrawingSurface.h" - -CairoDrawingSurface::CairoDrawingSurface(cairo_surface_t* surface) - : mNativeSurface(surface) -{ - -} - -CairoDrawingSurface::~CairoDrawingSurface() -{ - DestroyNativeSurface(); -} - -std::unique_ptr CairoDrawingSurface::Create(cairo_surface_t* surface) -{ - return std::make_unique(surface); -} - -cairo_surface_t* CairoDrawingSurface::GetNativeSurface() -{ - return mNativeSurface; -} - -void CairoDrawingSurface::DestroyNativeSurface() -{ - if (mNativeSurface) - { - cairo_surface_destroy (mNativeSurface); - mNativeSurface = nullptr; - } -} diff --git a/src/graphics/cairo/CairoDrawingSurface.h b/src/graphics/cairo/CairoDrawingSurface.h deleted file mode 100644 index c6cfa79..0000000 --- a/src/graphics/cairo/CairoDrawingSurface.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include "INativeDrawingSurface.h" - -#include - -#include - -class CairoDrawingSurface : public INativeDrawingSurface -{ -public: - - CairoDrawingSurface(cairo_surface_t* surface); - - virtual ~CairoDrawingSurface(); - - static std::unique_ptr Create(cairo_surface_t* surface); - - cairo_surface_t* GetNativeSurface(); - - void DestroyNativeSurface() override; - -private: - cairo_surface_t* mNativeSurface; -}; - -using CairoDrawingSurfacePtr = std::unique_ptr; diff --git a/src/graphics/cairo/CairoInterface.cpp b/src/graphics/cairo/CairoInterface.cpp deleted file mode 100644 index 344f96d..0000000 --- a/src/graphics/cairo/CairoInterface.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "CairoInterface.h" - -#include "DrawingSurface.h" -#include "DrawingContext.h" -#include "CairoDrawingSurface.h" -#include "CairoDrawingContext.h" -#include "TextElement.h" - -#include - - -std::unique_ptr CairoInterface::Create() -{ - return std::make_unique(); -} - -void CairoInterface::InitializeSurface(DrawingSurface* surface) -{ - auto native_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - surface->GetWidth(), surface->GetHeight()); - - auto cairo_surface = CairoDrawingSurface::Create(native_surface); - surface->SetNativeSurface(std::move(cairo_surface)); -} - -void CairoInterface::InitializeContext(DrawingContext* context, DrawingSurface* surface) -{ - auto cairo_surface = dynamic_cast(surface->GetNativeSurface()); - auto native_context = cairo_create(cairo_surface->GetNativeSurface()); - - auto cairo_context = CairoDrawingContext::Create(native_context); - context->SetNativeContext(std::move(cairo_context)); -} - -void CairoInterface::RenderToFile(DrawingSurface* surface, const std::string& path) -{ - auto cairo_surface = dynamic_cast(surface->GetNativeSurface()); - cairo_surface_write_to_png (cairo_surface->GetNativeSurface(), path.c_str()); -} - -void CairoInterface::AddText(TextElement* text, DrawingContext* context) -{ - auto cairo_context = dynamic_cast(context->GetNativeContext()); - auto native_context = cairo_context->GetNativeContext(); - - cairo_select_font_face (native_context, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); - cairo_set_font_size (native_context, 32.0); - cairo_set_source_rgb (native_context, 0.0, 0.0, 1.0); - cairo_move_to(native_context, 10.0, 50.0); - cairo_show_text(native_context, text->GetContent().c_str()); -} diff --git a/src/graphics/cairo/CairoInterface.h b/src/graphics/cairo/CairoInterface.h deleted file mode 100644 index 96b8374..0000000 --- a/src/graphics/cairo/CairoInterface.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include - -class DrawingSurface; -class DrawingContext; -class TextElement; - -class CairoInterface -{ -public: - CairoInterface() = default; - - static std::unique_ptr Create(); - - void InitializeSurface(DrawingSurface* surface); - - void InitializeContext(DrawingContext* context, DrawingSurface* surface); - - void AddText(TextElement* text, DrawingContext* context); - - void RenderToFile(DrawingSurface* surface, const std::string& path); -}; - -using CairoInterfacePtr = std::unique_ptr; diff --git a/src/image/CMakeLists.txt b/src/image/CMakeLists.txt index d9b9bd4..f138c91 100644 --- a/src/image/CMakeLists.txt +++ b/src/image/CMakeLists.txt @@ -16,6 +16,6 @@ target_include_directories(image PUBLIC set_target_properties( image PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) find_package(PNG REQUIRED) -target_link_libraries( image PUBLIC PNG::PNG) +target_link_libraries( image PUBLIC PNG::PNG core) set_property(TARGET image PROPERTY FOLDER src) \ No newline at end of file diff --git a/src/image/Image.cpp b/src/image/Image.cpp index 68a821d..ed84269 100644 --- a/src/image/Image.cpp +++ b/src/image/Image.cpp @@ -7,6 +7,23 @@ Image::Image(unsigned width, unsigned height) } +void Image::Initialize() +{ + mData = std::vector(GetBytesPerRow()*mHeight, 0); +} + +void Image::SetPixelValue(unsigned idx, unsigned jdx, const Color& color) +{ + if (mData.empty()) + { + Initialize(); + } + + mData[jdx*GetBytesPerRow() + idx*3] = static_cast(color.GetR()); + mData[jdx*GetBytesPerRow() + idx*3 + 1] = static_cast(color.GetG()); + mData[jdx*GetBytesPerRow() + idx*3 + 2] = static_cast(color.GetB()); +} + std::unique_ptr Image::Create(unsigned width, unsigned height) { return std::make_unique(width, height); diff --git a/src/image/Image.h b/src/image/Image.h index a19241f..20ed550 100644 --- a/src/image/Image.h +++ b/src/image/Image.h @@ -1,5 +1,7 @@ #pragma once +#include "Color.h" + #include #include @@ -16,6 +18,9 @@ public: unsigned GetHeight() const; unsigned GetBitDepth() const; unsigned GetNumChannels() const; + + void SetPixelValue(unsigned idx, unsigned jdx, const Color& color); + unsigned char GetByte(unsigned idx, unsigned jdx) const; void SetData(const std::vector& data); @@ -25,6 +30,8 @@ public: void SetNumChannels(unsigned numChannels); private: + void Initialize(); + unsigned mWidth{1}; unsigned mHeight{1}; unsigned mBitDepth{8}; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 2c5ae47..c8f4a82 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,7 @@ list(APPEND TestFiles audio/TestMidiReader.cpp database/TestDatabase.cpp graphics/TestOpenGlRendering.cpp + graphics/TestRasterizer.cpp ipc/TestDbus.cpp image/TestPngWriter.cpp publishing/TestPdfWriter.cpp @@ -24,6 +25,7 @@ list(APPEND TestNames TestMidiReader TestDatabase TestOpenGlRendering + TestRasterizer TestDbus TestPngWriter TestPdfWriter diff --git a/test/audio/TestAudioWriter.cpp b/test/audio/TestAudioWriter.cpp index 9907db5..42a8dc5 100644 --- a/test/audio/TestAudioWriter.cpp +++ b/test/audio/TestAudioWriter.cpp @@ -51,7 +51,7 @@ int main() #endif std::cout << "into entry point" << std::endl; TestCaseRunner runner; - //runner.AddTestCase("TestWriteNav", std::make_unique()); + runner.AddTestCase("TestWriteNav", std::make_unique()); runner.AddTestCase("TestAudioRender", std::make_unique()); const auto testsPassed = runner.Run(); diff --git a/test/graphics/TestRasterizer.cpp b/test/graphics/TestRasterizer.cpp new file mode 100644 index 0000000..47fd776 --- /dev/null +++ b/test/graphics/TestRasterizer.cpp @@ -0,0 +1,9 @@ +#include "Image.h" +#include "PngWriter.h" +#include "DrawingManager.h" + +int main() +{ + DrawingManager manager; + return 0; +}