Change ReplaceColorFilter color fields from int to color_t

This commit is contained in:
David Capello 2019-03-11 12:01:28 -03:00
parent e4117d05c5
commit be067452de
2 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2001-2016 David Capello
//
// This program is distributed under the terms of
@ -23,15 +24,16 @@ using namespace doc;
ReplaceColorFilter::ReplaceColorFilter()
{
m_from = m_to = m_tolerance = 0;
m_from = m_to = 0;
m_tolerance = 0;
}
void ReplaceColorFilter::setFrom(int from)
void ReplaceColorFilter::setFrom(const color_t from)
{
m_from = from;
}
void ReplaceColorFilter::setTo(int to)
void ReplaceColorFilter::setTo(const color_t to)
{
m_to = to;
}

View File

@ -1,4 +1,5 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
// Copyright (C) 2001-2015 David Capello
//
// This program is distributed under the terms of
@ -8,6 +9,7 @@
#define FILTERS_REPLACE_COLOR_FILTER_H_INCLUDED
#pragma once
#include "doc/color.h"
#include "filters/filter.h"
namespace filters {
@ -16,12 +18,12 @@ namespace filters {
public:
ReplaceColorFilter();
void setFrom(int from);
void setTo(int to);
void setFrom(const doc::color_t from);
void setTo(const doc::color_t to);
void setTolerance(int tolerance);
int getFrom() const { return m_from; }
int getTo() const { return m_to; }
doc::color_t getFrom() const { return m_from; }
doc::color_t getTo() const { return m_to; }
int getTolerance() const { return m_tolerance; }
// Filter implementation
@ -31,8 +33,8 @@ namespace filters {
void applyToIndexed(FilterManager* filterMgr);
private:
int m_from;
int m_to;
doc::color_t m_from;
doc::color_t m_to;
int m_tolerance;
};