1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0023725: C++11 compatibility issues in Image_Color.hxx

Fixed warning emited by g++ 4.7.2
This commit is contained in:
kgv 2013-01-26 22:48:12 +04:00 committed by kgv
parent aec37c1569
commit 9786a9af2b

View File

@ -26,6 +26,9 @@
struct Image_ColorRGB struct Image_ColorRGB
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -62,6 +65,9 @@ public:
struct Image_ColorRGB32 struct Image_ColorRGB32
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -102,6 +108,9 @@ public:
struct Image_ColorRGBA struct Image_ColorRGBA
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -142,6 +151,9 @@ public:
struct Image_ColorBGR struct Image_ColorBGR
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -176,6 +188,9 @@ public:
struct Image_ColorBGR32 struct Image_ColorBGR32
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -216,6 +231,9 @@ public:
struct Image_ColorBGRA struct Image_ColorBGRA
{ {
//! Component type.
typedef Standard_Byte ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -256,6 +274,9 @@ public:
struct Image_ColorRGBF struct Image_ColorRGBF
{ {
//! Component type.
typedef Standard_ShortReal ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -290,6 +311,9 @@ public:
struct Image_ColorBGRF struct Image_ColorBGRF
{ {
//! Component type.
typedef Standard_ShortReal ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -324,6 +348,9 @@ public:
struct Image_ColorRGBAF struct Image_ColorRGBAF
{ {
//! Component type.
typedef Standard_ShortReal ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -364,6 +391,9 @@ public:
struct Image_ColorBGRAF struct Image_ColorBGRAF
{ {
//! Component type.
typedef Standard_ShortReal ComponentType_t;
//! Returns the number of components. //! Returns the number of components.
static Standard_Integer Length() static Standard_Integer Length()
{ {
@ -404,9 +434,9 @@ public:
template<typename ColorType_t> template<typename ColorType_t>
inline ColorType_t Image_ColorSumm3 (const ColorType_t& theA, const ColorType_t& theB) inline ColorType_t Image_ColorSumm3 (const ColorType_t& theA, const ColorType_t& theB)
{ {
ColorType_t aRes = {{theA.v[0] + theB.v[0], ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] + theB.v[0]),
theA.v[1] + theB.v[1], typename ColorType_t::ComponentType_t (theA.v[1] + theB.v[1]),
theA.v[2] + theB.v[2]}}; typename ColorType_t::ComponentType_t (theA.v[2] + theB.v[2])}};
return aRes; return aRes;
} }
@ -433,10 +463,10 @@ inline Image_ColorBGRF operator+ (const Image_ColorBGRF& theA, const Image_Color
template<typename ColorType_t> template<typename ColorType_t>
inline ColorType_t Image_ColorSumm4 (const ColorType_t& theA, const ColorType_t& theB) inline ColorType_t Image_ColorSumm4 (const ColorType_t& theA, const ColorType_t& theB)
{ {
ColorType_t aRes = {{theA.v[0] + theB.v[0], ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] + theB.v[0]),
theA.v[1] + theB.v[1], typename ColorType_t::ComponentType_t (theA.v[1] + theB.v[1]),
theA.v[2] + theB.v[2], typename ColorType_t::ComponentType_t (theA.v[2] + theB.v[2]),
theA.v[3] + theB.v[3]}}; typename ColorType_t::ComponentType_t (theA.v[3] + theB.v[3])}};
return aRes; return aRes;
} }
@ -474,9 +504,9 @@ inline Image_ColorBGRAF operator+ (const Image_ColorBGRAF& theA, const Image_Col
template<typename ColorType_t> template<typename ColorType_t>
inline ColorType_t Image_ColorSub3 (const ColorType_t& theA, const ColorType_t& theB) inline ColorType_t Image_ColorSub3 (const ColorType_t& theA, const ColorType_t& theB)
{ {
ColorType_t aRes = {{theA.v[0] - theB.v[0], ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] - theB.v[0]),
theA.v[1] - theB.v[1], typename ColorType_t::ComponentType_t (theA.v[1] - theB.v[1]),
theA.v[2] - theB.v[2]}}; typename ColorType_t::ComponentType_t (theA.v[2] - theB.v[2])}};
return aRes; return aRes;
} }
@ -503,10 +533,10 @@ inline Image_ColorBGRF operator- (const Image_ColorBGRF& theA, const Image_Color
template<typename ColorType_t> template<typename ColorType_t>
inline ColorType_t Image_ColorSub4 (const ColorType_t& theA, const ColorType_t& theB) inline ColorType_t Image_ColorSub4 (const ColorType_t& theA, const ColorType_t& theB)
{ {
ColorType_t aRes = {{theA.v[0] - theB.v[0], ColorType_t aRes = {{typename ColorType_t::ComponentType_t (theA.v[0] - theB.v[0]),
theA.v[1] - theB.v[1], typename ColorType_t::ComponentType_t (theA.v[1] - theB.v[1]),
theA.v[2] - theB.v[2], typename ColorType_t::ComponentType_t (theA.v[2] - theB.v[2]),
theA.v[3] - theB.v[3]}}; typename ColorType_t::ComponentType_t (theA.v[3] - theB.v[3])}};
return aRes; return aRes;
} }