This file is indexed.

/usr/include/crystalspace-2.0/csgfx/imagevolumemaker.h is in libcrystalspace-dev 2.0+dfsg-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
    Copyright (C) 2005 by Jorrit Tyberghein
	      (C) 2005 by Frank Richter

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/**\file
 * Create volume image.
 */
 
/**\addtogroup gfx
 * @{ 
 */

#ifndef __CS_CSGFX_IMAGEVOLUMEMAKER_H__
#define __CS_CSGFX_IMAGEVOLUMEMAKER_H__

#include "csextern.h"
#include "csutil/leakguard.h"
#include "csutil/refarr.h"
#include "imagebase.h"

/**
 * Wrapper class to create a volume aka 3D texture from a number of 2D images
 * as the volume slices. 
 */
class CS_CRYSTALSPACE_EXPORT csImageVolumeMaker :
  public scfImplementationExt0<csImageVolumeMaker, csImageBase>
{
protected:
  /**
   * Whether the name was manually overridden (in this case it is not updated
   * when the contained images are changed).
   */
  bool manualName;
  /**
   * Array of images that were added, but not yet processed into the image
   * data.
   */
  csRefArray<iImage> pendingImages;
  /// Width of the image
  int Width;
  /// Height of the image
  int Height;
  /// Depth of the image
  int Depth;
  /// Format of the image
  int Format;

  /// Image data
  void* data;
  /// Image palette
  csRGBpixel* palette;
  /// Image alpha
  uint8* alpha;

  /// Convert all added images to the right format and update \a data.
  void AppendPending ();
public:
  CS_LEAKGUARD_DECLARE (csImageVolumeMaker);

  /**
   * Create a new map without slices set.
   * Format, width, height are, unless specified, taken from the first image
   * added.
   */
  csImageVolumeMaker (int format = -1, int width = -1, int height = -1);
  /**
   * Create a new map and copy slices from \a source.
   */
  csImageVolumeMaker (iImage* source);
  virtual ~csImageVolumeMaker();

  virtual const void* GetImageData ();
  virtual int GetWidth () const { return Width > 0 ? Width : 0; }
  virtual int GetHeight () const { return Height > 0 ? Height : 0; }
  virtual int GetDepth () const { return Depth + (int)pendingImages.GetSize (); }
  /// Set the name of the image.
  virtual void SetName (const char* iName);
  /**
   * Get the name of the image.
   * \remarks Unless the name was manually overridden with SetName(), the
   *  default name will contain the names of the wrapped slices, separated
   *  by ':', in the form <tt>slice1.png:slice2.png:...</tt>.
   */
  virtual const char* GetName () const { return fName; }

  virtual int GetFormat () const;
  virtual const csRGBpixel* GetPalette ();
  virtual const uint8* GetAlpha ();

  virtual const char* GetRawFormat () const { return 0; }
  virtual csRef<iDataBuffer> GetRawData () const { return 0; }
  virtual csImageType GetImageType () const { return csimg3D; }
  
  void AddImage (iImage* source);
};

/** @} */

#endif // __CS_CSGFX_IMAGEVOLUMEMAKER_H__