nr-filter-component-transfer.cpp revision 354e9a1515ed6d7957de6b135670bfb538468351
/*
* feComponentTransfer filter primitive renderer
*
* Authors:
* Felipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>
* Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <math.h>
#include "display/cairo-templates.h"
#include "display/cairo-utils.h"
#include "display/nr-filter-component-transfer.h"
#include "display/nr-filter-slot.h"
namespace Inkscape {
namespace Filters {
{
}
return new FilterComponentTransfer();
}
{}
struct ComponentTransfer {
{}
protected:
};
template <bool alpha>
struct ComponentTransferTable;
template <>
{
}
}
}
private:
};
template <>
struct ComponentTransferTable<true> {
{
}
}
}
private:
};
template <bool alpha>
struct ComponentTransferDiscrete;
template <>
{
}
}
}
private:
};
template <>
struct ComponentTransferDiscrete<true> {
{
}
}
}
private:
};
template <bool alpha>
struct ComponentTransferLinear;
template <>
{}
if (alpha == 0) return 0;
// TODO: this can probably be reduced to something simpler
}
private:
};
template <>
struct ComponentTransferLinear<true> {
{}
}
private:
};
template <bool alpha>
struct ComponentTransferGamma;
template <>
{}
if (alpha == 0) return 0;
}
private:
double _amplitude;
double _exponent;
double _offset;
};
template <>
struct ComponentTransferGamma<true> {
{}
alpha /= 255.0;
}
private:
double _amplitude;
double _exponent;
double _offset;
};
{
//cairo_surface_t *outtemp = ink_cairo_surface_create_identical(out);
// parameters: R = 0, G = 1, B = 2, A = 3
// Cairo: R = 2, G = 1, B = 0, A = 3
for (unsigned i = 0; i < 3; ++i) {
switch (type[i]) {
break;
break;
break;
break;
default:
break;
}
//ink_cairo_surface_blit(out, outtemp);
}
// fast paths for alpha channel
switch (type[3]) {
break;
break;
break;
break;
default:
break;
}
//cairo_surface_destroy(outtemp);
}
{
return true;
}
{
}
} /* namespace Filters */
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :