From 55a61b5d8d43e674d7d1475debc241c8482fd57e Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 29 Aug 2013 11:57:46 -0400 Subject: [PATCH] constify some method declarations --- PVRTCEncoder/src/Pixel.cpp | 4 +++- PVRTCEncoder/src/Pixel.h | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/PVRTCEncoder/src/Pixel.cpp b/PVRTCEncoder/src/Pixel.cpp index 1f35575..f23a69d 100644 --- a/PVRTCEncoder/src/Pixel.cpp +++ b/PVRTCEncoder/src/Pixel.cpp @@ -57,7 +57,9 @@ namespace PVRTCC { - void Pixel::FromBits(uint8 *bits, uint8 channelDepth[4], uint8 bitOffset) { + void Pixel::FromBits(const uint8 *bits, + const uint8 channelDepth[4], + uint8 bitOffset) { memcpy(m_BitDepth, channelDepth, sizeof(m_BitDepth)); uint32 nBits = bitOffset; diff --git a/PVRTCEncoder/src/Pixel.h b/PVRTCEncoder/src/Pixel.h index f9ad76e..7dd2465 100644 --- a/PVRTCEncoder/src/Pixel.h +++ b/PVRTCEncoder/src/Pixel.h @@ -61,18 +61,18 @@ class Pixel { public: Pixel(): m_R(0), m_G(0), m_B(0), m_A(0) { } - explicit Pixel(uint8 *bits, - uint8 channelDepth[4] = static_cast(0), + explicit Pixel(const uint8 *bits, + const uint8 channelDepth[4] = static_cast(0), uint8 bitOffset = 0) { - FromBits(bits, channelDepth); + FromBits(bits, channelDepth, bitOffset); } // Reads a pixel from memory given the bit depth. If NULL then // it is assumed to be 8 bit RGBA. The bit offset is the offset // from the least significant bit from which we start reading // the pixel values. - void FromBits(uint8 *bits, - uint8 channelDepth[4] = static_cast(0), + void FromBits(const uint8 *bits, + const uint8 channelDepth[4] = static_cast(0), uint8 bitOffset = 0); // Changes the depth of each pixel. This scales the values to