mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Adds for previous commit
This commit is contained in:
@ -16,14 +16,6 @@
|
||||
#ifndef AGG_SPAN_GRADIENT_INCLUDED
|
||||
#define AGG_SPAN_GRADIENT_INCLUDED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../../graphics/structures.h"
|
||||
#include "agg_math.h"
|
||||
#include "agg_array.h"
|
||||
#include "agg_trans_affine.h"
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include "./test_grads/custom_gradients.h"
|
||||
namespace agg
|
||||
{
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
#include <algorithm>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
#include "../../../graphics/AggPlusEnums.h"
|
||||
#include "../../../graphics/structures.h"
|
||||
#include <cmath>
|
||||
#include "agg_math.h"
|
||||
#include "agg_array.h"
|
||||
#include "agg_trans_affine.h"
|
||||
|
||||
#ifndef M_1_PI
|
||||
#define M_1_PI 0.318309886183790671538
|
||||
#endif
|
||||
|
||||
@ -43,49 +43,49 @@ class IGrObject
|
||||
protected:
|
||||
|
||||
#ifdef __APPLE__
|
||||
volatile int32_t m_lRef;
|
||||
volatile int32_t m_lRef;
|
||||
#else
|
||||
ULONG m_lRef;
|
||||
ULONG m_lRef;
|
||||
#endif
|
||||
|
||||
public:
|
||||
IGrObject()
|
||||
{
|
||||
m_lRef = 1;
|
||||
}
|
||||
IGrObject()
|
||||
{
|
||||
m_lRef = 1;
|
||||
}
|
||||
|
||||
virtual ~IGrObject()
|
||||
{
|
||||
}
|
||||
virtual ~IGrObject()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
virtual ULONG AddRef()
|
||||
{
|
||||
OSAtomicIncrement32(&m_lRef);
|
||||
return (ULONG)m_lRef;
|
||||
}
|
||||
virtual ULONG Release()
|
||||
{
|
||||
int32_t ret = OSAtomicDecrement32(&m_lRef);
|
||||
if (0 == m_lRef)
|
||||
delete this;
|
||||
virtual ULONG AddRef()
|
||||
{
|
||||
OSAtomicIncrement32(&m_lRef);
|
||||
return (ULONG)m_lRef;
|
||||
}
|
||||
virtual ULONG Release()
|
||||
{
|
||||
int32_t ret = OSAtomicDecrement32(&m_lRef);
|
||||
if (0 == m_lRef)
|
||||
delete this;
|
||||
|
||||
return (ULONG)ret;
|
||||
}
|
||||
return (ULONG)ret;
|
||||
}
|
||||
#else
|
||||
virtual ULONG AddRef()
|
||||
{
|
||||
++m_lRef;
|
||||
return m_lRef;
|
||||
}
|
||||
virtual ULONG AddRef()
|
||||
{
|
||||
++m_lRef;
|
||||
return m_lRef;
|
||||
}
|
||||
|
||||
virtual ULONG Release()
|
||||
{
|
||||
ULONG ret = --m_lRef;
|
||||
if (0 == m_lRef)
|
||||
delete this;
|
||||
return ret;
|
||||
}
|
||||
virtual ULONG Release()
|
||||
{
|
||||
ULONG ret = --m_lRef;
|
||||
if (0 == m_lRef)
|
||||
delete this;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@ -17,12 +17,21 @@ namespace Aggplus
|
||||
m_internal->Clear();
|
||||
}
|
||||
|
||||
Status CAlphaMask::CrateImageBuffer(UINT unWidth, UINT unHeight)
|
||||
StatusAlphaMask CAlphaMask::GetStatus() const
|
||||
{
|
||||
return m_internal->GetStatus();
|
||||
}
|
||||
AMaskDataType CAlphaMask::GetDataType() const
|
||||
{
|
||||
return m_internal->GetDataType();
|
||||
}
|
||||
|
||||
Status CAlphaMask::CreateImageBuffer(UINT unWidth, UINT unHeight)
|
||||
{
|
||||
return m_internal->Create(unWidth, unHeight, ImageBuffer);
|
||||
}
|
||||
|
||||
Status CAlphaMask::CrateAlphaBuffer(UINT unWidth, UINT unHeight)
|
||||
Status CAlphaMask::CreateAlphaBuffer(UINT unWidth, UINT unHeight)
|
||||
{
|
||||
return m_internal->Create(unWidth, unHeight, AlphaBuffer);
|
||||
}
|
||||
|
||||
@ -8,17 +8,33 @@
|
||||
|
||||
namespace Aggplus
|
||||
{
|
||||
enum StatusAlphaMask
|
||||
{
|
||||
EmptyAlphaMask,
|
||||
GenerationAlphaMask,
|
||||
ApplyingAlphaMask
|
||||
};
|
||||
|
||||
enum AMaskDataType
|
||||
{
|
||||
ImageBuffer,
|
||||
AlphaBuffer
|
||||
};
|
||||
|
||||
class CAlphaMask_private;
|
||||
class GRAPHICS_DECL CAlphaMask : public IGrObject
|
||||
{
|
||||
public:
|
||||
CAlphaMask();
|
||||
~CAlphaMask();
|
||||
virtual ~CAlphaMask();
|
||||
|
||||
StatusAlphaMask GetStatus() const;
|
||||
AMaskDataType GetDataType() const;
|
||||
|
||||
void Clear();
|
||||
|
||||
Status CrateImageBuffer(UINT unWidth, UINT unHeight);
|
||||
Status CrateAlphaBuffer(UINT unWidth, UINT unHeight);
|
||||
Status CreateImageBuffer(UINT unWidth, UINT unHeight);
|
||||
Status CreateAlphaBuffer(UINT unWidth, UINT unHeight);
|
||||
|
||||
Status LoadFromAlphaBuffer(BYTE* pBuffer, UINT unWidth, UINT unHeight, bool bExternalBuffer = true);
|
||||
Status LoadFromImageBuffer(BYTE* pBuffer, UINT unWidth, UINT unHeight, bool bExternalBuffer = true);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#include <string>
|
||||
#include "aggplustypes.h"
|
||||
#include "../common/IGrObject.h"
|
||||
#include "./AlphaMask.h"
|
||||
|
||||
#include "../agg-2.4/include/agg_alpha_mask_u8.h"
|
||||
#include "../agg-2.4/include/agg_renderer_base.h"
|
||||
@ -13,19 +13,6 @@
|
||||
|
||||
namespace Aggplus
|
||||
{
|
||||
enum StatusAlphaMask
|
||||
{
|
||||
EmptyAlphaMask,
|
||||
GenerationAlphaMask,
|
||||
ApplyingAlphaMask
|
||||
};
|
||||
|
||||
enum AMaskDataType
|
||||
{
|
||||
ImageBuffer,
|
||||
AlphaBuffer
|
||||
} ;
|
||||
|
||||
template <class PixelFormat, class AlphaMask>
|
||||
struct TAlphaMaskData
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user