Inkscape
Vector Graphics Editor
|
#include <transform.h>
Public Member Functions | |
Transform (cmsHTRANSFORM handle, bool global=false) | |
~Transform () | |
Transform (Transform const &)=delete | |
Transform & | operator= (Transform const &)=delete |
cmsHTRANSFORM | getHandle () const |
void | do_transform (unsigned char *inBuf, unsigned char *outBuf, unsigned size) const |
Wrap lcms2 cmsDoTransform to transform the pixel buffer's color channels. | |
void | do_transform (cairo_surface_t *in, cairo_surface_t *out) const |
Apply the CMS transform to the cairo surface and paint it into the output surface. | |
void | do_transform (Cairo::RefPtr< Cairo::ImageSurface > &in, Cairo::RefPtr< Cairo::ImageSurface > &out) const |
Apply the CMS transform to the cairomm surface and paint it into the output surface. | |
bool | do_transform (std::vector< double > &io) const |
Apply the CMS transform to a single Color object's data. | |
void | set_gamut_warn (std::vector< double > const &input) |
Set the gamut alarm code for this cms transform (and only this one). | |
bool | check_gamut (std::vector< double > const &input) const |
Return true if the input color is outside of the gamut if it was transformed using this cms transform. | |
Static Public Member Functions | |
static std::shared_ptr< Transform > const | create (cmsHTRANSFORM handle, bool global=false) |
Construct a color transform object from the lcms2 object. | |
static std::shared_ptr< Transform > const | create_for_cairo (std::shared_ptr< Profile > const &from, std::shared_ptr< Profile > const &to, std::shared_ptr< Profile > const &proof=nullptr, RenderingIntent proof_intent=RenderingIntent::AUTO, bool with_gamut_warn=false) |
Construct a transformation suitable for display conversion in a cairo buffer. | |
static std::shared_ptr< Transform > const | create_for_cms (std::shared_ptr< Profile > const &from, std::shared_ptr< Profile > const &to, RenderingIntent intent) |
Construct a transformation suitable for Space::CMS transformations using the given rendering intent. | |
static std::shared_ptr< Transform > const | create_for_cms_checker (std::shared_ptr< Profile > const &from, std::shared_ptr< Profile > const &to) |
Construct a transformation suitable for gamut checking Space::CMS colors. | |
Public Attributes | |
unsigned int | _channels_in |
unsigned int | _channels_out |
Static Private Member Functions | |
static unsigned int | lcms_intent (RenderingIntent intent, unsigned int &flags) |
Get the lcms2 intent enum from the inkscape intent enum. | |
Private Attributes | |
cmsHTRANSFORM | _handle |
cmsContext | _context |
Definition at line 22 of file transform.h.
|
inline |
Definition at line 36 of file transform.h.
References _handle.
|
inline |
Definition at line 44 of file transform.h.
|
delete |
bool Inkscape::Colors::CMS::Transform::check_gamut | ( | std::vector< double > const & | input | ) | const |
Return true if the input color is outside of the gamut if it was transformed using this cms transform.
Definition at line 222 of file transform.cpp.
References _handle.
|
static |
Construct a color transform object from the lcms2 object.
Definition at line 26 of file transform.cpp.
|
static |
Construct a transformation suitable for display conversion in a cairo buffer.
Definition at line 38 of file transform.cpp.
References create, and lcms_intent().
Referenced by Inkscape::Colors::CMS::System::getDisplayTransform().
|
static |
Construct a transformation suitable for Space::CMS transformations using the given rendering intent.
Definition at line 66 of file transform.cpp.
References create, and lcms_intent().
Referenced by Inkscape::Colors::Space::AnySpace::profileToProfile().
|
static |
Construct a transformation suitable for gamut checking Space::CMS colors.
Definition at line 86 of file transform.cpp.
References create.
Referenced by Inkscape::Colors::Space::AnySpace::outOfGamut().
void Inkscape::Colors::CMS::Transform::do_transform | ( | Cairo::RefPtr< Cairo::ImageSurface > & | in, |
Cairo::RefPtr< Cairo::ImageSurface > & | out | ||
) | const |
Apply the CMS transform to the cairomm surface and paint it into the output surface.
Definition at line 184 of file transform.cpp.
References do_transform().
void Inkscape::Colors::CMS::Transform::do_transform | ( | cairo_surface_t * | in, |
cairo_surface_t * | out | ||
) | const |
Apply the CMS transform to the cairo surface and paint it into the output surface.
Definition at line 153 of file transform.cpp.
References do_transform(), height, stride, and width.
bool Inkscape::Colors::CMS::Transform::do_transform | ( | std::vector< double > & | io | ) | const |
Apply the CMS transform to a single Color object's data.
Definition at line 196 of file transform.cpp.
References _channels_in, _channels_out, and _handle.
void Inkscape::Colors::CMS::Transform::do_transform | ( | unsigned char * | inBuf, |
unsigned char * | outBuf, | ||
unsigned | size | ||
) | const |
Wrap lcms2 cmsDoTransform to transform the pixel buffer's color channels.
Definition at line 137 of file transform.cpp.
References _handle, and Inkscape::size.
Referenced by do_transform(), and do_transform().
|
inline |
Definition at line 53 of file transform.h.
References _handle.
|
staticprivate |
Get the lcms2 intent enum from the inkscape intent enum.
@args intent - The Inkscape RenderingIntent enum
Definition at line 244 of file transform.cpp.
References Inkscape::Colors::ABSOLUTE_COLORIMETRIC, Inkscape::Colors::AUTO, Inkscape::Colors::PERCEPTUAL, Inkscape::Colors::RELATIVE_COLORIMETRIC, Inkscape::Colors::RELATIVE_COLORIMETRIC_NOBPC, Inkscape::Colors::SATURATION, and Inkscape::Colors::UNKNOWN.
Referenced by create_for_cairo(), and create_for_cms().
void Inkscape::Colors::CMS::Transform::set_gamut_warn | ( | std::vector< double > const & | input | ) |
Set the gamut alarm code for this cms transform (and only this one).
NOTE: If the transform doesn't have a context because it was created for cms color transforms instead of cairo transforms, this won't do anything.
Definition at line 118 of file transform.cpp.
References _channels_in, and _context.
unsigned int Inkscape::Colors::CMS::Transform::_channels_in |
Definition at line 70 of file transform.h.
Referenced by do_transform(), and set_gamut_warn().
unsigned int Inkscape::Colors::CMS::Transform::_channels_out |
Definition at line 71 of file transform.h.
Referenced by do_transform().
|
private |
Definition at line 65 of file transform.h.
Referenced by set_gamut_warn(), and ~Transform().
|
private |
Definition at line 64 of file transform.h.
Referenced by check_gamut(), do_transform(), do_transform(), getHandle(), Transform(), and ~Transform().