change the color_ts in a better class anc rename VectorType in Vector

This commit is contained in:
Edouard DUPIN 2012-08-14 16:11:17 +02:00
parent fa80d21d57
commit e2597ef315
10 changed files with 22 additions and 20 deletions

View File

@ -407,9 +407,9 @@ bool strnCmpNoCase(const char * input1, const char * input2, int32_t maxLen)
* @param[in] inputData Data C String with the xml definition * @param[in] inputData Data C String with the xml definition
* @return the parsed color * @return the parsed color
*/ */
color_ts svg::Base::ParseColor(const char *inputData) etk::Color svg::Base::ParseColor(const char *inputData)
{ {
color_ts localColor = etk::color::color_White;; etk::Color localColor = etk::color::white;
size_t len = strlen(inputData); size_t len = strlen(inputData);
@ -423,7 +423,7 @@ color_ts svg::Base::ParseColor(const char *inputData)
} }
SVG_ERROR(" pb in parsing the color : \"" << inputData << "\" ==> url(XXX) is not supported now ..."); SVG_ERROR(" pb in parsing the color : \"" << inputData << "\" ==> url(XXX) is not supported now ...");
} else { } else {
localColor = etk::color::Parse(inputData); localColor = inputData;
} }
SVG_VERBOSE("Parse color : \"" << inputData << "\" ==> " << localColor); SVG_VERBOSE("Parse color : \"" << inputData << "\" ==> " << localColor);
return localColor; return localColor;
@ -455,7 +455,7 @@ const char * svg::Base::SpacingDist(int32_t spacing)
/* /*
void svg::Base::AggCheckChange(agg::path_storage& path, etk::VectorType<agg::rgba8> &colors, etk::VectorType<uint32_t> &pathIdx, PaintState &curentPaintProp) void svg::Base::AggCheckChange(agg::path_storage& path, etk::Vector<agg::rgba8> &colors, etk::Vector<uint32_t> &pathIdx, PaintState &curentPaintProp)
{ {
if (curentPaintProp != m_paint) { if (curentPaintProp != m_paint) {
SVG_INFO("add path color = " << m_paint.fill); SVG_INFO("add path color = " << m_paint.fill);

View File

@ -26,7 +26,8 @@
#define __SVG_BASE_H__ #define __SVG_BASE_H__
#include <etk/Types.h> #include <etk/Types.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
#include <etk/Color.h>
#include <tinyXML/tinyxml.h> #include <tinyXML/tinyxml.h>
#include <parserSVG/Renderer.h> #include <parserSVG/Renderer.h>
@ -63,7 +64,7 @@ namespace svg
void ParsePosition(const TiXmlNode *node, Vector2D<float> &pos, Vector2D<float> &size); void ParsePosition(const TiXmlNode *node, Vector2D<float> &pos, Vector2D<float> &size);
float ParseLength(const char *dataInput); float ParseLength(const char *dataInput);
void ParsePaintAttr(const TiXmlNode *node); void ParsePaintAttr(const TiXmlNode *node);
color_ts ParseColor(const char *inputData); etk::Color ParseColor(const char *inputData);
}; };
}; };

View File

@ -26,14 +26,14 @@
#define __SVG_GROUP_H__ #define __SVG_GROUP_H__
#include <parserSVG/Base.h> #include <parserSVG/Base.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
namespace svg namespace svg
{ {
class Group : public svg::Base class Group : public svg::Base
{ {
private: private:
etk::VectorType<svg::Base *> m_subElementList; //!< group sub elements ... etk::Vector<svg::Base *> m_subElementList; //!< group sub elements ...
public: public:
Group(PaintState parentPaintState); Group(PaintState parentPaintState);
~Group(void); ~Group(void);

View File

@ -42,7 +42,7 @@ svg::Path::~Path(void)
// return the next char position ... (after 'X' or NULL) // return the next char position ... (after 'X' or NULL)
const char * extractCmd(const char * input, char& cmd, etk::VectorType<float>& outputList) const char * extractCmd(const char * input, char& cmd, etk::Vector<float>& outputList)
{ {
if (*input == '\0') { if (*input == '\0') {
return NULL; return NULL;
@ -95,7 +95,7 @@ bool svg::Path::Parse(TiXmlNode * node, agg::trans_affine& parentTrans, Vector2D
SVG_VERBOSE("Parse Path : \"" << elementXML << "\""); SVG_VERBOSE("Parse Path : \"" << elementXML << "\"");
char command; char command;
etk::VectorType<float> listDot; etk::Vector<float> listDot;
for( const char *sss=extractCmd(elementXML, command, listDot); for( const char *sss=extractCmd(elementXML, command, listDot);
NULL != sss; NULL != sss;

View File

@ -52,7 +52,7 @@ namespace svg
class Path : public svg::Base class Path : public svg::Base
{ {
private: private:
etk::VectorType<pathBasic_ts> m_listElement; etk::Vector<pathBasic_ts> m_listElement;
public: public:
Path(PaintState parentPaintState); Path(PaintState parentPaintState);
~Path(void); ~Path(void);

View File

@ -26,7 +26,7 @@
#define __SVG_POLYGON_H__ #define __SVG_POLYGON_H__
#include <parserSVG/Base.h> #include <parserSVG/Base.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
namespace svg namespace svg
{ {
@ -37,7 +37,7 @@ namespace svg
class Polygon : public svg::Base class Polygon : public svg::Base
{ {
private: private:
etk::VectorType<Vector2D<float> > m_listPoint; //!< list of all point of the polygone etk::Vector<Vector2D<float> > m_listPoint; //!< list of all point of the polygone
PolygonMode_te m_diplayMode; //!< polygone specific display mode PolygonMode_te m_diplayMode; //!< polygone specific display mode
public: public:
Polygon(PaintState parentPaintState); Polygon(PaintState parentPaintState);

View File

@ -26,14 +26,14 @@
#define __SVG_POLYLINE_H__ #define __SVG_POLYLINE_H__
#include <parserSVG/Base.h> #include <parserSVG/Base.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
namespace svg namespace svg
{ {
class Polyline : public svg::Base class Polyline : public svg::Base
{ {
private: private:
etk::VectorType<Vector2D<float> > m_listPoint; //!< list of all point of the polyline etk::Vector<Vector2D<float> > m_listPoint; //!< list of all point of the polyline
public: public:
Polyline(PaintState parentPaintState); Polyline(PaintState parentPaintState);
~Polyline(void); ~Polyline(void);

View File

@ -96,7 +96,7 @@ void svg::Renderer::WritePpm(etk::UString fileName)
if (NULL == m_buffer) { if (NULL == m_buffer) {
return; return;
} }
FILE* fd = fopen(fileName.Utf8Data(), "wb"); FILE* fd = fopen(fileName.c_str(), "wb");
if(NULL != fd) { if(NULL != fd) {
int32_t sizeX = m_size.x; int32_t sizeX = m_size.x;
int32_t sizeY = m_size.y; int32_t sizeY = m_size.y;

View File

@ -26,6 +26,7 @@
#define __SVG_RENDERER_H__ #define __SVG_RENDERER_H__
#include <etk/UString.h> #include <etk/UString.h>
#include <etk/Color.h>
#include <agg/agg_basics.h> #include <agg/agg_basics.h>
#include <agg/agg_rendering_buffer.h> #include <agg/agg_rendering_buffer.h>
@ -53,8 +54,8 @@ namespace svg
class PaintState { class PaintState {
public: public:
color_ts fill; etk::Color fill;
color_ts stroke; etk::Color stroke;
float strokeWidth; float strokeWidth;
bool flagEvenOdd; bool flagEvenOdd;
lineCap_te lineCap; lineCap_te lineCap;

View File

@ -26,7 +26,7 @@
#define __SVG_PARSER_H__ #define __SVG_PARSER_H__
#include <etk/File.h> #include <etk/File.h>
#include <etk/VectorType.h> #include <etk/Vector.h>
#include <parserSVG/Base.h> #include <parserSVG/Base.h>
namespace svg namespace svg
@ -38,7 +38,7 @@ namespace svg
bool m_loadOK; bool m_loadOK;
etk::UString m_version; etk::UString m_version;
etk::UString m_title; etk::UString m_title;
etk::VectorType<svg::Base *> m_subElementList; etk::Vector<svg::Base *> m_subElementList;
Vector2D<float> m_size; Vector2D<float> m_size;
svg::Renderer* m_renderedElement; svg::Renderer* m_renderedElement;