KSquare Utilities
BMPImage.cpp File Reference
#include "FirstIncludes.h"
#include <algorithm>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <string.h>
#include <string>
#include <vector>
#include <stdio.h>
#include "MemoryDebug.h"
#include <windows.h>
#include "BMPImage.h"
#include "KKException.h"
#include "OSservices.h"
#include "Raster.h"

Go to the source code of this file.

Classes

struct  KKB::BmpImage::Bmp1BitRec
 
struct  KKB::BmpImage::Bmp4BitRecs
 
struct  KKB::BmpImage::BMP_24BitPixel
 
class  KKB::BmpImage::CodedPixels
 This object is used to help encode the data stored in BMPImage::image into 8 or 4 bit compressed formats used by BMP files. *. More...
 
struct  KKB::BmpImage::CodePair
 
class  KKB::BmpImage::PalletBuilder
 
class  KKB::BmpImage::PalletBuilder::RGBQUAD_Pred
 

Functions

bool GrayScaleImage (RGBQUAD *palette, kkint32 palletSize)
 Returns true if palette is for a grayscale image. More...
 

Function Documentation

bool GrayScaleImage ( RGBQUAD *  palette,
kkint32  palletSize 
)

Returns true if palette is for a grayscale image.

Definition at line 988 of file BMPImage.cpp.

991 {
992  bool isGrayScaleImage = true;
993 
994  for (kkint32 x = 0; ((x < palletSize) && isGrayScaleImage); x++)
995  {
996  kkint32 expectedColor = 255 - x;
997  if ((palette[x].rgbBlue != expectedColor) ||
998  (palette[x].rgbGreen != expectedColor) ||
999  (palette[x].rgbRed != expectedColor)
1000  )
1001  {
1002  isGrayScaleImage = false;
1003  }
1004  }
1005 
1006  return isGrayScaleImage;
1007 } /* GrayScaleImage */
__int32 kkint32
Definition: KKBaseTypes.h:88