struct Image_ColorRGB
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorRGB32
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorRGBA
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorBGR
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorBGR32
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorBGRA
{
+ //! Component type.
+ typedef Standard_Byte ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorRGBF
{
+ //! Component type.
+ typedef Standard_ShortReal ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorBGRF
{
+ //! Component type.
+ typedef Standard_ShortReal ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorRGBAF
{
+ //! Component type.
+ typedef Standard_ShortReal ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
struct Image_ColorBGRAF
{
+ //! Component type.
+ typedef Standard_ShortReal ComponentType_t;
+
//! Returns the number of components.
static Standard_Integer Length()
{
template<typename ColorType_t>
inline ColorType_t Image_ColorSumm3 (const ColorType_t& theA, const ColorType_t& theB)
{
- ColorType_t aRes = {{theA.v[0] + theB.v[0],
- theA.v[1] + theB.v[1],
- theA.v[2] + theB.v[2]}};
+ ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] + theB.v[0]),
+ typename ColorType_t::ComponentType_t (theA.v[1] + theB.v[1]),
+ typename ColorType_t::ComponentType_t (theA.v[2] + theB.v[2])}};
return aRes;
}
template<typename ColorType_t>
inline ColorType_t Image_ColorSumm4 (const ColorType_t& theA, const ColorType_t& theB)
{
- ColorType_t aRes = {{theA.v[0] + theB.v[0],
- theA.v[1] + theB.v[1],
- theA.v[2] + theB.v[2],
- theA.v[3] + theB.v[3]}};
+ ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] + theB.v[0]),
+ typename ColorType_t::ComponentType_t (theA.v[1] + theB.v[1]),
+ typename ColorType_t::ComponentType_t (theA.v[2] + theB.v[2]),
+ typename ColorType_t::ComponentType_t (theA.v[3] + theB.v[3])}};
return aRes;
}
template<typename ColorType_t>
inline ColorType_t Image_ColorSub3 (const ColorType_t& theA, const ColorType_t& theB)
{
- ColorType_t aRes = {{theA.v[0] - theB.v[0],
- theA.v[1] - theB.v[1],
- theA.v[2] - theB.v[2]}};
+ ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] - theB.v[0]),
+ typename ColorType_t::ComponentType_t (theA.v[1] - theB.v[1]),
+ typename ColorType_t::ComponentType_t (theA.v[2] - theB.v[2])}};
return aRes;
}
template<typename ColorType_t>
inline ColorType_t Image_ColorSub4 (const ColorType_t& theA, const ColorType_t& theB)
{
- ColorType_t aRes = {{theA.v[0] - theB.v[0],
- theA.v[1] - theB.v[1],
- theA.v[2] - theB.v[2],
- theA.v[3] - theB.v[3]}};
+ ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] - theB.v[0]),
+ typename ColorType_t::ComponentType_t (theA.v[1] - theB.v[1]),
+ typename ColorType_t::ComponentType_t (theA.v[2] - theB.v[2]),
+ typename ColorType_t::ComponentType_t (theA.v[3] - theB.v[3])}};
return aRes;
}