void ThumbnailProvider::update(Thumbnail& thumbnail)
{
  thumbnail.grayscale = grayscale;
  thumbnail.scale = static_cast<int>(std::pow(2.0, downScales));
  if(grayscale)
  {
    switch(thumbnail.scale)
    {
      case 8:
        shrinkGrayscale8x8SSE(theImage, thumbnail.imageGrayscale);
        break;
      case 4:
        shrinkGrayscale4x4SSE(theImage, thumbnail.imageGrayscale);
        break;
      default:
        shrinkGrayscaleNxN(theImage, thumbnail.imageGrayscale);
    }
  }
  else
  {
    switch(thumbnail.scale)
    {
      case 8:
        shrink8x8SSE(theImage, thumbnail.image);
        break;
      case 4:
        shrink4x4SSE(theImage, thumbnail.image);
        break;
      default:
        shrinkNxN(theImage, thumbnail.image);
    }
    thumbnail.compressedImage.compress(thumbnail.image);
  }
}
Esempio n. 2
0
void ThumbnailProvider::update(ThumbnailBH& thumbnail)
{
  thumbnail.scale = static_cast<int>(::pow(2.0, downScales));
  switch(thumbnail.scale)
  {
    case 8:
      shrink8x8SSE(theImageBH, thumbnail.image);
      break;
    case 4:
      shrink4x4SSE(theImageBH, thumbnail.image);
      break;
    default:
      shrinkNxN(theImageBH, thumbnail.image);
  }

  thumbnail.compressedImage.compress(thumbnail.image);
}