Go to the documentation of this file.
10 #ifndef vtk_m_io_PixelTypes_h
11 #define vtk_m_io_PixelTypes_h
25 extern int GreyColorType;
26 extern int RGBColorType;
33 template <const vtkm::Id size,
typename =
void>
38 template <const vtkm::Id size>
43 template <const vtkm::Id size>
67 template <const vtkm::Id BitDepth, const vtkm::IdComponent Channels>
70 static_assert(BitDepth >= 8,
"BitDepth not >= 8");
71 static_assert(!(BitDepth & (BitDepth - 1)),
"BitDepth not a power of 2");
132 virtual void print(std::ostream& os)
const = 0;
136 template <const vtkm::Id BitDepth>
162 void print(std::ostream& os)
const override
164 os <<
"(" << (int)this->Components[0] <<
"," << (
int)this->Components[1] <<
","
165 << (int)this->Components[2] <<
")";
173 template <const vtkm::Id BitDepth>
200 void print(std::ostream& os)
const override { os <<
"(" << (int)this->Components[0] <<
")"; }
210 #include <vtkm/io/PixelTypes.hxx>
212 #endif //vtk_m_io_PixelTypes_h
void print(std::ostream &os) const override
Definition: PixelTypes.h:200
RGBPixel(vtkm::Vec4f_32 tuple)
Definition: PixelTypes.h:146
virtual vtkm::Vec4f_32 ToVec4f() const =0
Generates a Vec4f_32 from the current data available in the pixel.
static constexpr vtkm::IdComponent BIT_DEPTH
Definition: PixelTypes.h:78
void print(std::ostream &os) const override
Definition: PixelTypes.h:162
Definition: PixelTypes.h:137
Groups connected points that have the same field value.
Definition: Atomic.h:19
static constexpr vtkm::IdComponent NUM_BYTES
Definition: PixelTypes.h:79
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
BasePixel< BitDepth, 1 > Superclass
Definition: PixelTypes.h:180
Base type for more complex pixels (RGB, Greyscale, etc) that describes various values such as bit-dep...
Definition: PixelTypes.h:68
Definition: PixelTypes.h:34
vtkm::UInt16 type
Definition: PixelTypes.h:46
T ComponentType
Definition: Types.h:811
vtkm::Vec< typename ComponentTypeFromSize< BitDepth >::type, Channels > Superclass
Definition: PixelTypes.h:74
BasePixel(const unsigned char *imageData, const vtkm::Id index)
Fills in this->Components by calling ConstructPixelFromImage.
Definition: PixelTypes.h:94
Definition: PixelTypes.h:174
BasePixel< BitDepth, Channels > BaseType
Definition: PixelTypes.h:76
void ConstructPixelFromImage(const unsigned char *imageData, const vtkm::Id index)
Takes an input imageData pointer and an index to a location in that dataset and fills in this->Compon...
virtual ComponentType Diff(const BaseType &pixel) const =0
Calculates this difference between two pixels as a single value.
static int GetColorType()
detail::VecBase< T, Size, Vec< T, Size > > Superclass
Definition: Types.h:807
static constexpr vtkm::IdComponent GetBitDepth()
Definition: PixelTypes.h:83
virtual void print(std::ostream &os) const =0
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
vtkm::Vec4f_32 ToVec4f() const override
A short fixed-length array.
Definition: Types.h:357
GreyPixel(vtkm::Vec4f_32 tuple)
Definition: PixelTypes.h:185
vtkm::Vec4f_32 ToVec4f() const override
virtual ~BasePixel()=default
virtual ~RGBPixel()=default
ComponentType Diff(const Superclass &pixel) const override
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:181
static constexpr vtkm::IdComponent NUM_COMPONENTS
Definition: Types.h:812
static constexpr vtkm::IdComponent NUM_CHANNELS
Definition: PixelTypes.h:81
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:75
ComponentType Diff(const Superclass &pixel) const override
BasePixel< BitDepth, 3 > Superclass
Definition: PixelTypes.h:141
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:142
void FillImageAtIndexWithPixel(unsigned char *imageData, const vtkm::Id index)
Takes an output imageData pointer and in index to a location in that dataset and fills in the pixel d...
uint16_t UInt16
Base type to use for 16-bit unsigned integer numbers.
Definition: Types.h:177
static constexpr vtkm::IdComponent MAX_COLOR_VALUE
Definition: PixelTypes.h:80
static constexpr vtkm::IdComponent BYTES_PER_PIXEL
Definition: PixelTypes.h:82
vtkm::UInt8 type
Definition: PixelTypes.h:41
virtual ~GreyPixel()=default
friend std::ostream & operator<<(std::ostream &os, const BaseType &basePixel)
Implement the << operator for this class type.
Definition: PixelTypes.h:113
static int GetColorType()