egami
C++ Image Processing program
Public Member Functions | Public Attributes
Pixel_proxy Struct Reference

A proxy to a pixel in an image. More...

#include <image.hpp>

List of all members.

Public Member Functions

 Pixel_proxy (Image *img, unsigned y, unsigned x) noexcept
 Constructs a proxy to a given pixel in a given image.
Pixel_proxyoperator= (std::initializer_list< int > values)
 Assigns rgb values to the pixel.
Pixel_proxyoperator= (const const_Pixel_proxy &rhs)

Public Attributes

unsigned char & r
unsigned char & g
unsigned char & b

Detailed Description

A proxy to a pixel in an image.

Definition at line 21 of file image.hpp.


Constructor & Destructor Documentation

Pixel_proxy::Pixel_proxy ( Image img,
unsigned  y,
unsigned  x 
)

Constructs a proxy to a given pixel in a given image.

Parameters:
imgthe Image containing the pixel
ythe row of the pixel
xthe column of the pixel

Definition at line 214 of file image.cpp.


Member Function Documentation

Pixel_proxy & Pixel_proxy::operator= ( std::initializer_list< int >  values)

Assigns rgb values to the pixel.

If an empty initializer_list is given, the pixel is set to black. If a single value is given, it is assigned to r, g and b (usefull for grey-scale images). If three values are given, they are assigned to r, g and b (in that order).

Parameters:
valuesthe values to assign

Definition at line 219 of file image.cpp.

Pixel_proxy & Pixel_proxy::operator= ( const const_Pixel_proxy rhs)

Definition at line 238 of file image.cpp.


Member Data Documentation

unsigned char & Pixel_proxy::b

Blue value of the referenced pixel

Definition at line 43 of file image.hpp.

unsigned char & Pixel_proxy::g

Green value of the referenced pixel

Definition at line 43 of file image.hpp.

unsigned char& Pixel_proxy::r

Red value of the referenced pixel

Definition at line 43 of file image.hpp.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends