Go to the documentation of this file.
18 #ifndef viskores_io_PixelTypes_h
19 #define viskores_io_PixelTypes_h
33 extern int GreyColorType;
34 extern int RGBColorType;
41 template <const viskores::Id size,
typename =
void>
46 template <const viskores::Id size>
51 template <const viskores::Id size>
75 template <const viskores::Id BitDepth, const viskores::IdComponent Channels>
78 static_assert(BitDepth >= 8,
"BitDepth not >= 8");
79 static_assert(!(BitDepth & (BitDepth - 1)),
"BitDepth not a power of 2");
140 virtual void print(std::ostream& os)
const = 0;
144 template <const viskores::Id BitDepth>
170 void print(std::ostream& os)
const override
172 os <<
"(" << (int)this->Components[0] <<
"," << (
int)this->Components[1] <<
","
173 << (int)this->Components[2] <<
")";
181 template <const viskores::Id BitDepth>
208 void print(std::ostream& os)
const override { os <<
"(" << (int)this->Components[0] <<
")"; }
218 #include <viskores/io/PixelTypes.hxx>
220 #endif //viskores_io_PixelTypes_h
viskores::Vec4f_32 ToVec4f() const override
viskores::Vec4f_32 ToVec4f() const override
Base type for more complex pixels (RGB, Greyscale, etc) that describes various values such as bit-dep...
Definition: PixelTypes.h:76
detail::VecBase< T, Size, Vec< T, Size > > Superclass
Definition: Types.h:819
static constexpr viskores::IdComponent BIT_DEPTH
Definition: PixelTypes.h:86
BasePixel< BitDepth, Channels > BaseType
Definition: PixelTypes.h:84
virtual ~RGBPixel()=default
viskores::Vec< typename ComponentTypeFromSize< BitDepth >::type, Channels > Superclass
Definition: PixelTypes.h:82
BasePixel(const unsigned char *imageData, const viskores::Id index)
Fills in this->Components by calling ConstructPixelFromImage.
Definition: PixelTypes.h:102
uint16_t UInt16
Base type to use for 16-bit unsigned integer numbers.
Definition: Types.h:185
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
ComponentType Diff(const Superclass &pixel) const override
static constexpr viskores::IdComponent BYTES_PER_PIXEL
Definition: PixelTypes.h:90
static constexpr viskores::IdComponent NUM_BYTES
Definition: PixelTypes.h:87
static constexpr viskores::IdComponent NUM_COMPONENTS
Definition: Types.h:824
ComponentType Diff(const Superclass &pixel) const override
static constexpr viskores::IdComponent NUM_CHANNELS
Definition: PixelTypes.h:89
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:83
Groups connected points that have the same field value.
Definition: Atomic.h:27
void print(std::ostream &os) const override
Definition: PixelTypes.h:170
virtual viskores::Vec4f_32 ToVec4f() const =0
Generates a Vec4f_32 from the current data available in the pixel.
RGBPixel(viskores::Vec4f_32 tuple)
Definition: PixelTypes.h:154
viskores::UInt16 type
Definition: PixelTypes.h:54
static constexpr viskores::IdComponent MAX_COLOR_VALUE
Definition: PixelTypes.h:88
void ConstructPixelFromImage(const unsigned char *imageData, const viskores::Id index)
Takes an input imageData pointer and an index to a location in that dataset and fills in this->Compon...
Definition: PixelTypes.h:145
virtual ~GreyPixel()=default
Definition: PixelTypes.h:42
void print(std::ostream &os) const override
Definition: PixelTypes.h:208
viskores::UInt8 type
Definition: PixelTypes.h:49
virtual void print(std::ostream &os) const =0
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:189
void FillImageAtIndexWithPixel(unsigned char *imageData, const viskores::Id index)
Takes an output imageData pointer and in index to a location in that dataset and fills in the pixel d...
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
virtual ~BasePixel()=default
virtual ComponentType Diff(const BaseType &pixel) const =0
Calculates this difference between two pixels as a single value.
BasePixel< BitDepth, 1 > Superclass
Definition: PixelTypes.h:188
GreyPixel(viskores::Vec4f_32 tuple)
Definition: PixelTypes.h:193
static int GetColorType()
T ComponentType
Definition: Types.h:823
static constexpr viskores::IdComponent GetBitDepth()
Definition: PixelTypes.h:91
A short fixed-length array.
Definition: Types.h:365
BasePixel< BitDepth, 3 > Superclass
Definition: PixelTypes.h:149
Definition: PixelTypes.h:182
friend std::ostream & operator<<(std::ostream &os, const BaseType &basePixel)
Implement the << operator for this class type.
Definition: PixelTypes.h:121
static int GetColorType()
typename Superclass::ComponentType ComponentType
Definition: PixelTypes.h:150