24#include <com/sun/star/graphic/GraphicType.hpp>
25#include <com/sun/star/graphic/XGraphicTransformer.hpp>
57 aAny <<= uno::Reference< graphic::XGraphic >(
this );
59 aAny <<= uno::Reference< awt::XBitmap >(
this );
61 aAny <<= uno::Reference< graphic::XGraphicTransformer >(
this);
81 return "com.sun.star.comp.graphic.Graphic";
92 const uno::Sequence< OUString > aNew {
"com.sun.star.graphic.Graphic" };
93 sal_Int32 nOldCount = aRet.getLength();
95 aRet.realloc( nOldCount + aNew.getLength() );
97 std::copy(aNew.begin(), aNew.end(), std::next(aRet.getArray(), nOldCount));
113 return css::uno::Sequence<sal_Int8>();
118 sal_Int8 cRet = graphic::GraphicType::EMPTY;
123 : graphic::GraphicType::VECTOR;
140 return awt::Size(aVclSize.
Width(), aVclSize.
Height());
152 return css::uno::Sequence<sal_Int8>(
static_cast<sal_Int8 const *
>(aMemoryStream.
GetData()), aMemoryStream.
Tell());
156 return uno::Sequence<sal_Int8>();
169 return css::uno::Sequence<sal_Int8>(
static_cast<sal_Int8 const *
>(aMemoryStream.
GetData()), aMemoryStream.
Tell() );
173 return uno::Sequence<sal_Int8>();
179 const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nColorFrom,
sal_Int8 nTolerance, sal_Int32 nColorTo,
sal_Int8 nAlphaTo )
187 Color aColorFrom(aBmpColorFrom);
188 Color aColorTo(aBmpColorTo);
201 aBitmapEx.
Replace(aColorFrom, aColorTo, nTolerance);
206 if ((nAlphaTo == 0) || (nAlphaTo == sal::static_int_cast< sal_Int8 >(0xff)))
210 aBitmap.
Replace(aColorFrom, aColorTo, nTolerance);
215 aBitmapEx.
Replace(aColorFrom, aColorTo, nTolerance);
226 const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nColorOne, sal_Int32 nColorTwo )
246 const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nBrightness, sal_Int32 nContrast,
sal_Bool mso )
252 aBitmapEx.
Adjust(nBrightness, nContrast, 0, 0, 0, 0,
false, mso);
sal_uInt8 GetIndex() const
const AlphaMask & GetAlphaMask() const
void ChangeColorAlpha(sal_uInt8 cIndexFrom, sal_Int8 nAlphaTo)
Bitmap GetBitmap(Color aTransparentReplaceColor) const
void Replace(const Color &rSearchColor, const Color &rReplaceColor)
Replace all pixel having the search color with the specified color.
bool Adjust(short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma=1.0, bool bInvert=false, bool msoBrightness=false)
Change various global color characteristics.
static bool Filter(BitmapEx &rBmpEx, BitmapFilter const &rFilter)
bool Replace(const AlphaMask &rAlpha, const Color &rMergeColor)
Merge bitmap with given background color according to specified alpha mask.
AlphaMask CreateAlphaMask(const Color &rTransColor) const
Create on-off alpha mask from bitmap.
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
OUString getOriginURL() const
GraphicType GetType() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void setOriginURL(OUString const &rOriginURL)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
virtual void SAL_CALL release() noexcept override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
void init(const ::Graphic &rGraphic)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::awt::Size SAL_CALL getSize() override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ::sal_Int8 SAL_CALL getType() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual ~Graphic() noexcept override
void init(const ::Graphic &rGraphic)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getMaskDIB() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL applyBrightnessContrast(const css::uno::Reference< css::graphic::XGraphic > &rxGraphic, sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso) override
virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getDIB() override
virtual void SAL_CALL release() noexcept override
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL colorChange(const css::uno::Reference< css::graphic::XGraphic > &rGraphic, sal_Int32 nColorFrom, sal_Int8 nTolerance, sal_Int32 nColorTo, sal_Int8 nAlphaTo) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL applyDuotone(const css::uno::Reference< css::graphic::XGraphic > &rGraphic, sal_Int32 nColorOne, sal_Int32 nColorTwo) override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)