WPngImage
is a C++ library to manage images in PNG format. It can be used
as a completely stand-alone library using the lodepng
library (included, and used by default), or using the official libpng
library.
The main goal of WPngImage
is to be as easy and simple to use as possible, while
still being expressive and supporting a variety of PNG pixel formats. The design
philosophy of this library is to aim for simplicity and ease-of-use, using a "plug&play"
principle: Just a couple of source files. Simply add them to your project, and that's it.
No myriads of source files, no configuration scripts and makefiles necessary.
WPngImage
supports internal pixel representations in 8-bits-per-channel,
16-bits-per-channel and floating point, in RGBA or gray-alpha modes. The public interface
of the class has been designed in such a manner that all these internal representations
can be handled in the same way, with identical code, regardless of what the format of
the pixels is (although, if necessary, the program can perform different operations
depending on the internal pixel format.) A variety of arithmetic and colorspace
conversion operations for pixels are provided.
WPngImage
also supports decoding and encoding PNG images from/to memory
(a feature that most other image manipulation libraries lack, even though this can be
very useful in many situations.)
By default WPngImage
uses C++11 for some convenience functionality and
efficiency (eg. it implements a move constructor and assignment operator). The class can
be compiled in C++98 mode if necessary, though. Consult the Compiling
section for details.
Table of contents:
The source code of this software is published under the MIT license.
Copyright (c) 2017 Juha Nieminen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This is an example of a minimal full program that simply creates a PNG image file, containing a red-green gradient across it. (Note that in subsequent examples the include and main() will be omitted, for brevity.)
#include "WPngImage.hh" int main() { WPngImage image(256, 256); for(int y = 0; y < image.height(); ++y) for(int x = 0; x < image.width(); ++x) image.set(x, y, WPngImage::Pixel8(x, y, 0)); image.saveImage("example.png"); }
The constructor can also take a pixel value to fill the newly created image (the default being black, with full alpha). For example:
// New image with fully transparent pixels:
WPngImage image(256, 256, WPngImage::Pixel8(0, 0, 0, 0));
By default an 8-bits-per-channel RGBA image will be created. You can also choose to create
a 16-bits-per-channel or floating-point image, or a grayscale image (using any of the three
bit depths). This can be done by either giving a
pixel of the correspondent type to the constructor, or the correspondent value of
type WPngImage::PixelFormat
. (In the case of grayscale pixel formats, only
the latter option is possible.) Examples:
// New 16-bits-per-channel images: WPngImage image1(256, 256, WPngImage::Pixel16(65535, 65535, 65535)); // white WPngImage image2(256, 256, WPngImage::kPixelFormat_RGBA16); // black // New floating-point images: WPngImage image3(256, 256, WPngImage::PixelF(1.0, 1.0, 1.0)); // white WPngImage image4(256, 256, WPngImage::kPixelFormat_RGBAF); // black // New grayscale images: WPngImage image5(256, 256, WPngImage::kPixelFormat_GA8); WPngImage image6(256, 256, WPngImage::kPixelFormat_GA16); WPngImage image7(256, 256, WPngImage::kPixelFormat_GAF);
Note that a floating point image will be saved as an integer image to PNG (because floating point components are not supported by the PNG format.) Using a floating point image during creation or manipulation can, however, be useful for several reasons (eg. they are uncapped, ie. can go outside the range from 0.0 to 1.0, while the integer pixel values will be capped to their respective range.)
This example will load a png image, invert it (ie. make it a negative) and save it to another file.
WPngImage image; const auto status = image.loadImage("photo.png"); if(status.printErrorMsg()) return EXIT_FAILURE; for(int y = 0; y < image.height(); ++y) for(int x = 0; x < image.width(); ++x) image.set(x, y, 65535 - image.get16(x, y)); image.saveImage("photo_negative.png");
The get16()
function will return an object of type
WPngImage::Pixel16
, which is a 16-bits-per-channel pixel type (ie. with
pixel channel values ranging from 0 to 65535). This is independent of the actual pixel
format used by the image (which by default, like here, will be the closest pixel format
that matches the input PNG.) Even if the image itself uses eg. 8-bits-per-channel, the
conversion between the two is done transparently.
In this example get16()
was used because it's the best way to preserve accuracy
regardless of what pixel format the input PNG file uses. In other words, if the input PNG was
also 16-bits-per-channel, the result will be accurate to that bit depth. However, it doesn't
matter if the input PNG used 8-bits-per-channel: The result will also likewise do so, and
the result will also be accurate to that bit depth.
Another possibility is to use floating point pixels instead. This also preserves full accuracy regardless of the bit depth of the input PNG file, but on the other hand, requires extra conversions between integers and floating point:
image.set(x, y, 1.0 - image.getF(x, y));
One advantage of using floating point pixels is that they will be uncapped (ie. their values
can go beyond the range from 0.0 to 1.0). The integer pixels will be capped to their range
and can't go beyond them (any operation that would make them go beyond that range will be
clamped to the range.) Note, however, that if the WPngImage
instance itself uses
integer pixels, the floating point pixels given to it will be converted to integer ones (and
thus capped to their respective range.)
If you know that the input uses 8-bits-per-channel, you can, of course, perform the operation using pixels of that bit depth:
image.set(x, y, 255 - image.get8(x, y));
(This will work even if the image is using 16 bits per channel, but the operation above will in this case be inaccurate, as the lowest 8 bits of accuracy will be lost.)
A diverse set of arithmetic operations are supported for pixels, and detailed in the section Arithmetic operators.
You can access and modify the members of the pixel object directly, if the provided operators do not suffice. For example:
auto pixel = image.get16(x, y); pixel.r *= 2; pixel.g /= 4; image.set(x, y, pixel);
By default the image will be saved using a pixel format that most closely matches the one
being currently used. The image can be saved with another pixel format by specifying it to
the saveImage()
function. See the section
Saving for details.
If the default error handling does not suffice, more options are available. Consult the section IOStatus for details.
In many cases, where the same operation is done to all the pixels in the image,
WPngImage
offers a shortcut function which applies a unary function to all
the pixels of the image. The two for-loops above can be replaced with this one-liner:
image.transform16([](auto pixel) { return 65535 - pixel; });
Consult the section Changing all the pixels for more details.
WPngImage
offers some basic drawing functions for convenience. Some
examples:
image.putImage(10, 20, anotherImage); image.drawImage(50, 100, anotherImage, 10, 10, 80, 80); image.putHorLine(10, 20, 100, WPngImage::Pixel8(255, 255, 255, 190)); image.drawVertLine(10, 20, 100, WPngImage::Pixel8(255, 255, 255, 190)); image.putRectangle(10, 20, 100, 50, WPngImage::Pixel8(255, 255, 0, 120), false); image.drawRectangle(100, 200, 100, 50, WPngImage::Pixel8(255, 255, 0, 120), true);
The difference between the put...()
and draw...()
functions
is that the former will simply assign the target pixels with the source pixels, overwriting them.
The latter will mix the pixels using alpha blending (ie. effectively drawing the parameter
image or pixel on top of this image.) This makes a difference if the source pixel has a non-full
alpha.
putImage()
and drawImage()
take another WPngImage
object and copy its contents to this image at the specified coordinates. The coordinates
specify where the upper left corner of the parameter will be. This is a convenient
way of eg. composing an image out of other images.
A sub-section of the parameter image can be specified as four additional coordinates. The first two specify the upper left corner of the sub-section in the parameter image, and the next two the width and height of the sub-section. In the above examples, an 80x80 section, with the upper left corner of the section being at (10, 10), will be used from the parameter image. (When these are not specified, the entire parameter image will be used.)
It's ok if the specified coordinates, or the parameter image, are outside the boundaries of this image. Only the visible part will be drawn onto this image. Likewise it's ok if the sub-section coordinates are outside of the parameter image (they will be handled as if the image had fully transparent pixels around it.)
put/drawHorLine()
and put/drawVertLine()
draw a horizontal/vertical
line, starting at the coordinates specified by the first two parameters, with a length of
the third parameter. (It's ok for any of these to be out of boundaries, and for the length
to be negative.) Alpha blending will be used to draw the line (which makes a difference
if the alpha of the given pixel is not full.)
put/drawRectangle()
does the same for rectangles. The last boolean parameter
specifies if the rectangle should be filled or not.
Consult the sections Drawing images, Drawing lines and Drawing rectangles for more information.
WPngImage
supports conversions between RGB pixels and several color spaces.
This example will shift the hue of the image by 90 degrees (without affecting its saturation
or lightness):
for(int y = 0; y < image.height(); ++y) for(int x = 0; x < image.width(); ++x) { WPngImage::HSL hsl = image.get16(x, y).toHSL(); hsl.h += 0.25; image.set(x, y, WPngImage::Pixel16(hsl)); }
For a full list of supported color space conversions, see the section Color space conversions.
This example is similar to the previous one, but it converts an image to grayscale:
WPngImage image; auto status = image.loadImage("photo.png"); if(status.printErrorMsg()) return EXIT_FAILURE; for(int y = 0; y < image.height(); ++y) for(int x = 0; x < image.width(); ++x) image.set(x, y, image.get16(x, y).grayCIEPixel()); image.saveImage("photo_grayscale.png");
(Note that you can also use grayPixel()
instead of grayCIEPixel()
,
but the latter is more accurate, although a bit less efficient.)
The example converts the image to grayscale, but preserves the original pixel format.
(In other words, if the input PNG was eg. 8-bits-per-channel RGBA, so will the
WPngImage
object and the output PNG.) The same can be achieved by changing
the pixel format to grayscale.
There are several options for this. We can make PngImage
load the image
directly into an internal grayscale pixel format representation:
image.loadImage("photo.png", WPngImage::kPngReadConvert_Grayscale); image.saveImage("photo_grayscale.png");
In this case, the pixels will be stored as gray-alpha values inside the image
object. (Setting a pixel with a non-grayscale value will cause it to be automatically
converted to grayscale.)
We can also specify a specific output pixel format to saveImage()
:
image.loadImage("photo.png"); image.saveImage("photo_grayscale.png", WPngImage::kPngFileFormat_GA8);
In this case, the image will be loaded and handled with whatever pixel format the input file has, but written to the output file as an 8-bit grayscale PNG.
A final option is to convert the image to another pixel format (grayscale in this case) after it has been loaded:
image.loadImage("photo.png"); image.convertToPixelFormat(WPngImage::kPixelFormat_GA8); image.saveImage("photo_grayscale.png");
If you would prefer to retain the bit depth of the original PNG file, you can check this
depth with the is8BPCPixelFormat()
or the is16BPCPixelFormat()
functions. Thus you could write, for example:
if(image.is8BPCPixelFormat()) image.convertToPixelFormat(WPngImage::kPixelFormat_GA8); else image.convertToPixelFormat(WPngImage::kPixelFormat_GA16);
(It's not necessary to check if the image is already in the desired pixel format.
If it is, then convertToPixelFormat()
will do nothing.)
Why have different pixel formats anyway? Why not always convert the input file to eg. floating point, which has the maximum accuracy and range? It would simplify things.
It would indeed make some things a bit simpler, but there are advantages and disadvantages to each pixel format, which is why this class supports several of them.
Firstly, memory usage: Floating point RGBA pixels (WPngImage::kPixelFormat_RGBAF
)
will take 4x4=16 bytes per pixel. This means that, for example, a 1920x1080 image will
take 32 megabytes of RAM. On the other extreme, an 8-bit gray image
(WPngImage::kPixelFormat_GA8
) will take 2 bytes per pixel, meaning that the
1920x1080 image will take 4 megabytes of RAM. This can be important especially if a lot of
images are being handled at the same time.
The memory required by each pixel format is as follows (with an example of how much memory a 1920x1080 image would require):
WPngImage::kPixelFormat_GA8
: 2 bytes per pixel (4 MB).WPngImage::kPixelFormat_GA16
: 4 bytes per pixel (8 MB).WPngImage::kPixelFormat_GAF
: 8 bytes per pixel (16 MB).WPngImage::kPixelFormat_RGBA8
: 4 bytes per pixel (8 MB).WPngImage::kPixelFormat_RGBA16
: 8 bytes per pixel (16 MB).WPngImage::kPixelFormat_RGBAF
: 16 bytes per pixel (32 MB).However, larger bit depths will obviously have more accuracy, which can be important with some calculations. 8-bits-per-channel may be too inaccurate for some applications.
8-bit and 16-bit pixel formats are clamped to their respective range (ie. 0-255 and 0-65535
respectively). If any operation would make them go outside of that range, it will be clamped
to the range. (You can of course modify the r
, g
, b
and a
members of the pixel object directly, but in that case the value will
simply wrap around, as per the C++ unsigned integer arithmetic rules.)
Floating point pixels do not have this limitation. They can go beyond their range from 0.0
to 1.0. This can be used for example for HDR calculations. Note, however, that if the
WPngImage
instance is not using a floating point pixel format, if you set
a pixel with a floating point pixel value, it will be converted to the current integer
pixel format, clamping the values as needed.
Thus if retaining the floating point values in the image is necessary, it's recommended to specify a floating point pixel format (when creating or loading an image). This is also recommended if a lot of floating point operations will be done to the image, as this forgoes the need to do integer-to-float and float-to-integer conversions every time.
Note, however, that when saving to a PNG file, the pixels will be saved in an integer format, clamping the values as needed (because the PNG format does not support floating point pixels.)
To integrate WPngImage
into your project as a stand-alone class (but still
with full PNG saving and loading support), simply add the following source code files to your
project or compiler command:
WPngImage.cc
lodepng.cpp
Nothing else is needed. For possible updates on the lodepng.cpp
file,
consult the lodpng home page.
For example, in a typical Linux system a small program could be compiled like:
g++ -Ofast -march=native example.cc WPngImage/WPngImage.cc WPngImage/lodepng.cpp
If you would prefer to use the official libpng library
instead of lodepng, the preprocessor macro WPNGIMAGE_USE_LIBPNG
needs to be set
to 1
in the project settings or compiler parameters.
In this case only the source file:
WPngImage.cc
needs to be added to the project. In a typical Linux system a program can be compiled like:
g++ -Ofast -march=native -DWPNGIMAGE_USE_LIBPNG=1 example.cc WPngImage/WPngImage.cc -lpng
If you only use WPngImage
for its image manipulation functionality (or you are
eg. loading and saving the image into a format other than PNG), it may be useful to simply
not compile PNG I/O support into the library at all, to save space (and for faster compilation).
In this case the WPNGIMAGE_DISABLE_PNG_FILE_IO_SUPPORT
preprocessor macro should be
defined with a value of 1
(this can be done in your project settings, the compiler
command-line options, or directly editing the #define
at the beginning of PngImage.hh
.)
In this case only the source file:
WPngImage.cc
ought to be added to the project.
g++ -Ofast -march=native -DWPNGIMAGE_DISABLE_PNG_FILE_IO_SUPPORT=1 example.cc WPngImage/WPngImage.cc
In this case, none of the loadImage()
and saveImage()
member functions will
be compiled in, and therefore cannot be called. Likewise WPngImage::IOStatus
will not be
defined and thus can't be used.
By default the class uses some C++11 features for additional convenience and efficiency
(for example it implements a move constructor and move assignment operator). If necessary,
however, it can be compiled in C++98 compatibility mode (in which case those additional
features will not be available). To do this, either edit the WPngImage.hh
file
and at the beginning of the file, change the line
#define WPNGIMAGE_RESTRICT_TO_CPP98 0
to
#define WPNGIMAGE_RESTRICT_TO_CPP98 1
or create the precompiler macro WPNGIMAGE_RESTRICT_TO_CPP98
with a value of
1
in your project/compiler settings (in which case WPngImage.hh
doesn't need to be edited.) For example with g++ it would happen like:
g++ -O3 -DWPNGIMAGE_RESTRICT_TO_CPP98=1 example.cc WPngImage.cc lodepng.cpp
WPngImage.hh
defines the following precompiler macros:
WPNGIMAGE_VERSION
An integer containing three values in its three least-significant bytes: Major version
(third-least-significant byte), minor version (second-least-significant byte), minor
sub-version (least-significant byte). For example, the value 0x010500
indicates
the version 1.5.0.
WPNGIMAGE_VERSION_STRING
The version in string format. For example, "1.5.0"
.
WPNGIMAGE_COPYRIGHT_STRING
A string containing short copyright info. For example,
"WPngImage v1.5.0 (C)2022 Juha Nieminen"
.
These enumerated values defined inside WPngImage
are used by the various
member functions:
// PNG file format enum PngFileFormat { kPngFileFormat_none, kPngFileFormat_GA8, // 8 bits-per-channel gray-alpha kPngFileFormat_GA16, // 16 bits-per-channel gray-alpha kPngFileFormat_RGBA8, // 8 bits-per-channel RGBA kPngFileFormat_RGBA16 // 16 bits-per-channel RGBA }; // Pixel format enum PixelFormat { kPixelFormat_GA8, // 8 bits-per-channel gray-alpha kPixelFormat_GA16, // 16 bits-per-channel gray-alpha kPixelFormat_GAF, // Floating point gray-alpha kPixelFormat_RGBA8, // 8 bits-per-channel RGBA kPixelFormat_RGBA16, // 16 bits-per-channel RGBA kPixelFormat_RGBAF // Floating point RGBA }; // PNG loading pixel format conversion enum PngReadConvert { kPngReadConvert_closestMatch, kPngReadConvert_8bit, kPngReadConvert_16bit, kPngReadConvert_Float, kPngReadConvert_Grayscale, kPngReadConvert_RGBA }; // PNG saving pixel format conversion enum PngWriteConvert { kPngWriteConvert_original, kPngWriteConvert_closestMatch };
WPngImage(); WPngImage(int width, int height, PixelFormat = kPixelFormat_RGBA8); WPngImage(int width, int height, Pixel8, PixelFormat = kPixelFormat_RGBA8); WPngImage(int width, int height, Pixel16, PixelFormat = kPixelFormat_RGBA16); WPngImage(int width, int height, PixelF, PixelFormat = kPixelFormat_RGBAF);
The default constructor creates an empty instance, with no image data. (Any operation
done to such an instance will just do nothing.) An image can then be either created
with the newImage()
functions or loaded with loadImage()
or loadImageFromRAM()
.
The other constructors will create a new image of the specified size. A pixel value, used to fill this new image, can be specified (the default being a black pixel with full alpha.) The pixel format can likewise be specified, if the default value is not suitable.
Example:
// New image with fully transparent pixels:
WPngImage image(256, 256, WPngImage::Pixel8(0, 0, 0, 0));
WPngImage
performs a deep copy when copied or assigned to another instance.
In C++11 mode it implements a move constructor and move assignment for efficiency.
WPngImage
instances can also be explicitly and efficiently moved and swapped
with these member functions (only some pointers are moved/swapped rather than all the image
data):
void move(WPngImage&); void swap(WPngImage&);
void newImage(int width, int height, PixelFormat = kPixelFormat_RGBA8); void newImage(int width, int height, Pixel8, PixelFormat = kPixelFormat_RGBA8); void newImage(int width, int height, Pixel16, PixelFormat = kPixelFormat_RGBA16); void newImage(int width, int height, PixelF, PixelFormat = kPixelFormat_RGBAF);
These are completely equivalent to the constructors. Any previously existing image data in this instance will be destroyed before creating the new image data.
IOStatus loadImage(const char* fileName, PngReadConvert = kPngReadConvert_closestMatch); IOStatus loadImage(const char* fileName, PixelFormat); IOStatus loadImage(const std::string& fileName, PngReadConvert = kPngReadConvert_closestMatch); IOStatus loadImage(const std::string& fileName, PixelFormat);
The PNG file specified by fileName
will be attempted to be loaded.
The second parameter can be a value of type WPngImage::PngReadConvert
, which
specifies what kind of pixel format conversion policy ought to be used for the read image,
or directly a value of type WPngImage::PixelFormat
if the conversion should
be to a specific pixel format.
The different values of WPngImage::PngReadConvert
have the following meanings:
WPngImage::kPngReadConvert_closestMatch
: The pixel format that most closely
matches the input PNG file, without loss of data, will be used. (This affects whether a
grayscale or RGBA pixel format is used, as well as whether an 8-bit or 16-bit format is
used.)WPngImage::kPngReadConvert_8bit
: The read image will be converted to an
8-bits-per-channel pixel format (retaining whether it was grayscale or RGBA).WPngImage::kPngReadConvert_16bit
: The read image will be converted to an
16-bits-per-channel pixel format (retaining whether it was grayscale or RGBA).WPngImage::kPngReadConvert_Float
: The read image will be converted to a
floating point pixel format (retaining whether it was grayscale or RGBA).WPngImage::kPngReadConvert_Grayscale
: The read image will be converted to
a grayscale pixel format, with matching bit depth.WPngImage::kPngReadConvert_RGBA
: The read image will be converted to
an RGBA pixel format, with matching bit depth.Note: By default a pixel format that most closely matches the input PNG file will be used.
This means that loading a grayscale PNG will cause the pixel format to likewise be grayscale.
However, for applications that modify the image colors in some manner it may be useful, or
even necessary, to always convert the image to RGBA. It's thus recommended to always specify
WPngImage::kPngReadConvert_RGBA
(or possibly kPixelFormat_RGBA8
if
the application only supports 8 bits per channel) when using the class in these applications.
See the section IOStatus for details on the return value.
IOStatus loadImageFromRAM(const void* pngData, std::size_t pngDataSize, PngReadConvert = kPngReadConvert_closestMatch); IOStatus loadImageFromRAM(const void* pngData, std::size_t pngDataSize, PixelFormat);
A PNG image can also be decoded from RAM. These work in the same way as
loadImage()
, but they take a pointer and the size of the data (in bytes).
The class has no way of checking that the pointer points to a valid location and that the size parameter is correct. Thus it's up to the calling code to make sure that they do.
See the section IOStatus for details on the return value.
IOStatus saveImage(const char* fileName, PngWriteConvert = kPngWriteConvert_closestMatch) const; IOStatus saveImage(const char* fileName, PngFileFormat) const; IOStatus saveImage(const std::string& fileName, PngWriteConvert = kPngWriteConvert_closestMatch) const; IOStatus saveImage(const std::string& fileName, PngFileFormat) const;
Save the current image data to a PNG file. (If there is currently no image data, does nothing.) A specific PNG pixel format can be specified as a second parameter (see section Enumerated values.)
Alternatively, a conversion policy can be specified as the second parameter. This will
have an effect only if the current image was loaded from a file (or from memory). If the
current image was created (using a constructor or a call to newImage()
), then
either conversion policy will just be interpreted as matching the current pixel format.
WPngImage::PngWriteConvert
can have the following values:
WPngImage::kPngWriteConvert_closestMatch
: The image will be saved using
the pixel format that most closely matches the one being currently used (ignoring the
pixel format of the file that was loaded). If a floating point pixel format is being
used, it will be saved with 16 bits-per-channel.WPngImage::kPngWriteConvert_original
: The image will be saved using the
pixel format that most closely matches the one in the PNG file that was loaded (even if
it's different from the pixel format currently being used.) For example, if the original
PNG file was RGBA with 8 bits-per-channel, and it was loaded to an RGBAF pixel format,
with this parameter it will be saved back to an RGBA 8 bits-per-channel format.The "original pixel format of the PNG file" can be changed after loading a file with a call to the function:
void setFileFormat(PngFileFormat);
After this, WPngImage::kPngWriteConvert_original
will be interpreted as
that specified format.
Note that if all the pixels to be saved are fully opaque (ie. have full alphas), saving the alpha channel will be omitted (ie. the image will be saved in RGB or gray format, without an alpha channel.)
See the section IOStatus for details on the return value.
Encoding the image to a PNG in RAM is not as straigforward as decoding it because the final size of the data cannot be known in advance. Two options are provided to do this:
Encode into a std::vector<unsigned char>
:
IOStatus saveImageToRAM(std::vector<unsigned char>& dest, PngWriteConvert = kPngWriteConvert_closestMatch) const; IOStatus saveImageToRAM(std::vector<unsigned char>& dest, PngFileFormat) const;
Pass the encoded data to a callback function:
using ByteStreamOutputFunc = std::function<void(const unsigned char*, std::size_t)>; IOStatus saveImageToRAM(ByteStreamOutputFunc, PngWriteConvert = kPngWriteConvert_closestMatch) const; IOStatus saveImageToRAM(ByteStreamOutputFunc, PngFileFormat) const;
Note that in the latter case, the callback function may be called numerous times, with differing amounts of data, which should be appended to each other by the function.
In C++11 mode, anything that behaves like a function taking two parameters,
(const unsigned char*, std::size_t)
, be it a raw function, a functor object,
or a lambda, can be used. If the library is compiled in C++98 compatibility mode, however,
the above type alias will instead be:
typedef void(*ByteStreamOutputFunc)(const unsigned char*, std::size_t);
meaning that only a raw function can be used.
See the next section for details on the return value.
WPngImage::IOStatus
is an object returned by the loading and saving functions.
It contains the following members:
IOStatusValue value; std::string fileName, pngLibErrorMsg; int errnoValue;
It's implicitly convertible to a value of the enumerated type
WPngImage::IOStatusValue
, which has the following possible values:
WPngImage::kIOStatus_Ok
: The operation completed successfully.WPngImage::kIOStatus_Error_CantOpenFile
: The file could not be opened
(for either loading or saving). The value of errno
will be stored in the
errnoValue
member variable and can be checked for the more specific reason
(most likely case is that the file doesn't exist, in the case of loading.)WPngImage::kIOStatus_Error_NotPNG
: The signature in the file/data fails check.
This is most probably not a PNG file at all.WPngImage::kIOStatus_Error_PNGLibraryError
: libpng returned an error while
decoding or encoding the data.In the last case, pngLibErrorMsg
, if not empty, will contain the error message
returned by libpng. (For example, if the PNG data was corrupted, the message will be something
like "IDAT: CRC error".)
Note that the fileName
member variable will contain the file name given as
parameter to loadImage()
or saveImage()
only in case of error.
If there was no error, or the image was loaded from or saved to memory, it will be empty.
(This is done for efficiency.)
WPngImage::IOStatus
also has a utility member function for simplified error
message printing:
bool printErrorMsg(std::ostream& = std::cerr) const;
If there was an error, it will print an error message (in English) to the given stream
(by default std::cerr
if not specified) and return true. If there was no error,
it will return false. It can, thus, be used like:
const auto status = image.loadImage("photo.png"); if(status.printErrorMsg()) return false;
If this does not suffice for the application, the status value can be used for custom
error handling. This is an example (which is a simplified version of what the
printErrorMsg()
function itself does):
const auto status = image.loadImage(filename);
switch(status)
{
case WPngImage::kIOStatus_Error_CantOpenFile:
std::perror(filename);
break;
case WPngImage::kIOStatus_Error_NotPNG:
std::cerr << filename << " is not a PNG file.\n";
break;
case WPngImage::kIOStatus_Error_PNGLibraryError:
std::cerr << "Error reading " << filename;
if(!status.pngLibErrorMsg.empty())
std::cerr << ": " << status.pngLibErrorMsg;
std::cerr << "\n";
break;
case WPngImage::kIOStatus_Ok: /* image loaded ok */
}
Image dimensions:
int width() const; int height() const;
The original pixel format of the loaded PNG file (if one has been loaded):
PngFileFormat originalFileFormat() const; void setFileFormat(PngFileFormat);
Current pixel format properties:
PixelFormat currentPixelFormat() const; bool isGrayscalePixelFormat() const; bool isRGBAPixelFormat() const; bool is8BPCPixelFormat() const; bool is16BPCPixelFormat() const; bool isFloatPixelFormat() const;
The following static const bool variable can be used to determine if the class is using libpng or lodepng:
static const bool isUsingLibpng;
Convert the current image to another pixel format:
void convertToPixelFormat(PixelFormat);
Note that this is a relatively heavy operation because it internally creates a new image data and transfers all the pixels from the existing one to the new one (doing the necessary conversion). However, if the current pixel format is already the one specified, does nothing.
Pixel8 get8(int x, int y) const; Pixel16 get16(int x, int y) const; PixelF getF(int x, int y) const; void set(int x, int y, Pixel8); void set(int x, int y, Pixel16); void set(int x, int y, PixelF); void fill(Pixel8); void fill(Pixel16); void fill(PixelF);
See the section Pixel reference for details on the pixel objects.
The type of pixel requested or set does not need to match the current pixel format. If it's different, then it will be internally converted to the appropriate format when returning/assigning it. (Note that this will mean a loss of precision if the target pixel type is of lower bit depth than the source pixel type.)
There are no separate pixel objects for grayscale. If the current image uses a grayscale
pixel format, then getting a pixel will return one with all three components set to the
same grayscale value. When setting a pixel, if the color components are unequal, it will
be converted to grayscale using the toGrayCIE()
function of the pixel object.
If the specified coordinates are out of bounds, the getters will return a fully transparent pixel, and the setters will do nothing.
The fill()
functions can be used to set the entire image to the specified
pixel color.
using TransformFunc8 = std::function<Pixel8(Pixel8)>; using TransformFunc16 = std::function<Pixel16(Pixel16)>; using TransformFuncF = std::function<PixelF(PixelF)>; void transform(TransformFunc8); void transform(TransformFunc16); void transform(TransformFuncF); void transform(TransformFunc8, WPngImage& dest) const; void transform(TransformFunc16, WPngImage& dest) const; void transform(TransformFuncF, WPngImage& dest) const; void transform8(TransformFunc8); void transform16(TransformFunc16); void transformF(TransformFuncF); void transform8(TransformFunc8, WPngImage& dest); void transform16(TransformFunc16, WPngImage& dest); void transformF(TransformFuncF, WPngImage& dest);
These functions can be used to change all the pixels of the image using an unary functor. For each pixel in the image, the functor is given it as parameter, and its return value is assigned to that pixel. This is completely equivalent to traversing the image with two for-loops and performing this assignment explicitly, but this function can be more convenient in many cases.
Example: Inverting an image:
image.transform([](WPngImage::Pixel16 pixel) { return 65535 - pixel; });
The suffixed versions of the transform()
function exist to make it possible
to use generic lambdas. The previous example can thus be more briefly written as:
image.transform16([](auto pixel) { return 65535 - pixel; });
The versions taking two parameters can be used to write the result to another
WPngImage
instance rather than this one. If that other image is not already
of the same size as this one, it will be re-created using that size (by calling the
newImage()
function). If the destination image did not have any image data
at all, it will be made to use the same pixel format as this one, otherwise its pixel
format will be preserved.
If the library is compiled in C++98 compatibility mode, the functions can only take a function pointer as parameter. The function types will be:
typedef Pixel8(*TransformFunc8)(Pixel8); typedef Pixel16(*TransformFunc16)(Pixel16); typedef PixelF(*TransformFuncF)(PixelF);
void putImage(int destX, int destY, const WPngImage&); void putImage(int destX, int destY, const WPngImage&, int srcX, int srcY, int srcWidth, int srcHeight); void drawImage(int destX, int destY, const WPngImage&); void drawImage(int destX, int destY, const WPngImage&, int srcX, int srcY, int srcWidth, int srcHeight);
These functions will copy the pixels from a given image ("parameter image") to
this image, at the specified location. The coordinates destX
, destY
specify where the upper-left corner of the parameter image will end up in this image
(so, for example, the coordinates 0, 0
will make the upper left corner of
the parameter image match with the upper left corner if this image.)
The second versions of the these functions can be used to draw only a part of the
parameter image into this image. The additional parameters specify the sub-rectangle
within the parameter image to draw (with srcX
and srcY
specifying
the upper-left corner of the rectangle.) In this case the coordinates destX
,
destY
specify where the upper-left corner of the sub-rectangle will end up
in this image.
It's ok if the parameter image ends up partially (or completely) out of bounds of this image: Only the visible part will be drawn. It's also ok if the sub-rectangle parameters are out of bounds of the parameter image (any pixels outside the parameter image will be ignored.) Note that if the specified width or height is zero or negative, nothing will be drawn.
The difference between putImage()
and drawImage()
is that the
former will simply assign the parameter pixels to this image, overwriting the target pixels,
while the latter will mix the source and target pixels using alpha blending, effectively
drawing the parameter image on top of this image. This makes a difference if the parameter
image has pixels with non-full alphas.
void drawPixel(int x, int y, Pixel8); void drawPixel(int x, int y, Pixel16); void drawPixel(int x, int y, PixelF);
These are similar to the set()
functions, except that the given pixel is
blended with the destination pixel using alpha blending. (This makes a difference if the
given pixel has a non-full alpha.) Calling eg. the first function is essentially identical
to a line like:
image.set(x, y, image.get8(x, y).blendedPixel(pixel));
except it's more convenient and a bit more efficient.
void putHorLine(int x, int y, int length, Pixel_t); void putVertLine(int x, int y, int length, Pixel_t); void drawHorLine(int x, int y, int length, Pixel_t); void drawVertLine(int x, int y, int length, Pixel_t);
These are simple convenience functions to draw horizontal and vertical lines.
It's ok if the line is partially (or completely) out of bounds. Only the parts that
end up inside this image will be drawn. It's also ok for the length
parameter
to be negative. (It will be interpreted appropriately, ie. going left or up from the
starting coordinates.)
The difference between the put
and draw
versions is that the
former will simply assign the target pixels with the given parameter, while the latter will
use alpha blending. This makes a difference if the pixel object given as parameter has a
non-full alpha.
void putRect(int x, int y, int width, int height, Pixel_t, bool filled); void drawRect(int x, int y, int width, int height, Pixel_t, bool filled);
These are simple convenience functions to draw rectangles.
If the filled
parameter is false
then only the outline of
the rectangle will be drawn. (Effectively this is a convenience shortcut for calling the
equivalent line drawing functions four times). Else a filled rectangle will be drawn.
It's ok if the rectangle is partially (or completely) out of bounds. Only the parts that
end up inside this image will be drawn. It's also ok for the width
and
height
parameters to be negative. (They will be interpreted appropriately,
ie. going left or up from the starting coordinates.) If width
or
height
are 1 (or -1), then this is completely equivalent to calling the
correspondent line drawing function.
The difference between the put
and draw
versions is that the
former will simply assign the target pixels with the given parameter, while the latter will
use alpha blending. This makes a difference if the pixel object given as parameter has a
non-full alpha.
void resizeCanvas(int newOriginX, int newOriginY, int newWidth, int newHeight); void resizeCanvas(int newOriginX, int newOriginY, int newWidth, int newHeight, Pixel8); void resizeCanvas(int newOriginX, int newOriginY, int newWidth, int newHeight, Pixel16); void resizeCanvas(int newOriginX, int newOriginY, int newWidth, int newHeight, PixelF);
These functions can be used to resize the area of the current image. This will either expand the image (by adding pixels of the specified color) or crop the image, depending on the origin and size parameters.
The new origin parameters specify where the new upper left corner, relative to the current one, should be. If they are zero, the upper left corner will remain unchanged. Negative values will expand the image towards the left and up respectively. Positive values will crop the image from the left and top respectively. The new width and height parameters will act likewise with the right and bottom edges.
For example, this will expand the current image by 10 pixels on each side (putting fully transparent pixels on those new extra areas):
image.resizeCanvas(-10, -10, image.width()+20, image.height()+20, WPngImage::Pixel8(0, 0, 0, 0));
void flipHorizontally(); void flipVertically(); void rotate180(); void rotate90cw(); void rotate90ccw();
These functions flip the image horizontally and vertically, or rotate it 180 or 90 degrees clockwise or counter-clockwise. (Rotating the image 90 degrees will swap its width and height.)
Flipping and rotating by 180 degrees will be done in-place (ie. no additional memory will be allocated). Likewise rotating 90 degrees, if the image is square. For non-square images rotating by 90 degrees will internally make a new allocation.
void translate(int xOffset, int yOffset); void translate(int xOffset, int yOffset, Pixel8); void translate(int xOffset, int yOffset, Pixel16); void translate(int xOffset, int yOffset, PixelF);
These functions will translate the image by a given amount. (xOffset
and
yOffset
can be positive, negative or zero.) The pixels that end up outside
the image are simply discarded.
The first version will leave the pixels in the empty space left by the translation unmodified (in other words, they will still contain the original pixels). The versions taking a pixel will fill this new empty space with that given pixel color.
(If both xOffset
and yOffset
are zero, nothing is done.
If either one is larger than the corresponding image dimension, ie. the image will
be effectively translated completely outside the image area, the first function will
do nothing, and the other functions will effectively just fill the image with the
given pixel color.)
void premultiplyAlpha();
Multiplies each component of every pixel by the alpha value of that pixel (and, in the case of the integer pixel formats, divides by the maximum component value). This can be useful in some applications, where a texture needs to be alpha-premultiplied before being used (eg. in OpenGL).
The same operation is also supported for individual pixels. See the section Other operations.
const Pixel8* getRawPixelData8() const; Pixel8* getRawPixelData8(); const Pixel16* getRawPixelData16() const; Pixel16* getRawPixelData16(); const PixelF* getRawPixelDataF() const; PixelF* getRawPixelDataF();
These functions return a raw pointer to the pixel data managed by this class.
The pointer, if not null, will point to an array of width()*height()
pixel objects of the correspondent type. These functions are provided for potential
efficiency optimizations in the calling code (as the array can be indexed and traversed
directly using the raw pointer, without extra operations).
NOTE, however, that these functions will only return a valid pointer if the
current pixel format matches exactly the RGBA pixel type of the correspondent bit depth.
In other words, eg. getRawPixelData8()
will return a valid pointer only if
currentPixelFormat()
is WPngImage::kPixelFormat_RGBA8
. Likewise
for the other functions. In any other situations these functions will return a null
pointer. If the current pixel format is a gray-alpha format, currently they will all return
null. Thus these functions should be used carefully.
WPngImage
defines three pixel object types:
WPngImage::Pixel8
: An 8-bits-per-channel RGBA pixel (4 bytes).
Component range: 0-255.WPngImage::Pixel16
: A 16-bits-per-channel RGBA pixel (8 bytes).
Component range: 0-65535.WPngImage::PixelF
: A floating point RGBA pixel (16 bytes). Unlimited range
(up to the limits of the float
type.) The range from off to full (which is
used when converting to one of the integer pixels) is 0.0-1.0.Each of these three types act exactly the same and have all the same member variables
and functions. Their only difference is the type of the members: std::uint8_t
,
std::uint16_t
and float
. They are collectively referred to as
"Pixel_t
", and their component type as "CT
", in the rest of this
document.
They have four publicly accessible member variables: r
, g
,
b
, and a
. The calling code is free to modify them if the
provided operations do not suffice.
They also have a typedef named Component_t
equal to the correspondent component
type of the class.
Consult the tutorial section Advantages and disadvantages of different pixel formats for some tips on choosing which pixel type to use for a given situation.
Each pixel type has these five constructors:
Pixel_t(); explicit Pixel_t(CT gray); Pixel_t(CT gray, CT alpha); Pixel_t(CT red, CT green, CT blue); Pixel_t(CT red, CT green, CT blue, CT alpha);
They also have two explicit constructors that take a pixel object of one of the other types.
The component values will be converted appropriately. For example, Pixel8
has
the following constructors:
explicit Pixel8(Pixel16); explicit Pixel8(PixelF);
The other two pixel classes have correspondent constructors.
When converting one of the integer pixels to PixelF
, they will be converted
to the range 0.0-1.0. When converting in the other direction, any value outside of that
range will be clamped to the minimum/maximum values of the destination.
Additionally, they have an explicit constructor for each of the color space struct types. Consult the section Color space conversions for more on this.
explicit Pixel_t(const HSV&); explicit Pixel_t(const HSL&); explicit Pixel_t(const XYZ&); explicit Pixel_t(const YXY&); explicit Pixel_t(const CMY&); explicit Pixel_t(const CMYK&);
Pixel values can also be set using these convenience functions. They are equivalent to the constructors, except that the versions not taking an alpha value will leave the current alpha value unmodified.
void set(CT gray); void set(CT gray, CT alpha); void set(CT red, CT green, CT blue); void set(CT red, CT green, CT blue, CT alpha);
Each pixel type supports all four arithmetic operators, in binary and assignment forms
(operator+
, operator+=
, operator-
, operator-=
,
operator*
, operator*=
, operator/
, operator/=
)
with either a numeric type (int
in the case of Pixel8
and
Pixel16
, and float
in the case of PixelF
) or another
pixel of the same type.
Note that in the case of Pixel8
and Pixel16
, any operation that
would cause the result to go outside of their respective ranges will be clamped to the range
(ie. overflow will be clamped to the maximum value, underflow to zero.) With PixelF
there is no limit.
In the case of Pixel8
and Pixel16
, dividing by zero will not cause
malfunction. Instead, the pixel color components will be set to full. In the case of
PixelF
, no checking is done.
With binary arithmetic operators, the numeric value can be on the left or right hand side of the
operator. ("pixel+10
" and "10+pixel
" will have the same result.
On the other hand, "pixel-10
" and "10-pixel
" obviously will not.)
The operation will be performed to each of the color components of the pixel. The alpha component will be unmodified (because this is most often the desired behavior).
Examples:
pixel16 = 65535 - pixel16; // Inverts the pixel pixelF = 1.0 - pixelF; // Inverts the pixel pixel16 *= 2; // Doubles brightness pixelF *= 1.2; // Increases brightness by 20%
All the arithmetic operators are also supported with another pixel object of the same
type. The operation will be done for each pair of color components, but there is no
universally defined standard on how these operations should be performed
in terms of the alpha channel. This library chooses the option to average the
two alpha channels for the result (regardless of which operator is being applied). If this
is not the desired behavior, the application should modify the r
, g
,
b
and a
members directly instead.
Example:
// Adds two pixels together. Their alpha will be averaged.
pixel1 += pixel2;
Note that these pixel types support proper (alpha-aware) averaging, as well as alpha blending, of pixels. These are detailed in the section Other operations.
WPngImage
supports a number of color space conversions for pixels. The class
defines the following structs, each for the correspondent color space:
struct WPngImage::HSV { Float h, s, v, a; }; struct WPngImage::HSL { Float h, s, l, a; }; struct WPngImage::XYZ { Float x, y, z, a; }; struct WPngImage::YXY { Float Y, x, y, a; }; struct WPngImage::CMY { Float c, m, y, a; }; struct WPngImage::CMYK { Float c, m, y, k, a; };
The pixel classes define the following member functions to convert the pixel to the correspondent color space:
HSV toHSV() const; HSL toHSL() const; XYZ toXYZ() const; YXY toYXY() const; CMY toCMY() const; CMYK toCMYK() const;
The conversion back to the RGBA pixel can be done by giving the color space struct instance to its constructor (the pixel classes have an explicit constructor for each color space struct), or by calling one of these member functions:
void set(const HSV&); void setFromHSV(Float h, Float s, Float v); void setFromHSV(Float h, Float s, Float v, Float a); void set(const HSL&); void setFromHSL(Float h, Float s, Float l); void setFromHSL(Float h, Float s, Float l, Float a); void set(const XYZ&); void setFromXYZ(Float x, Float y, Float z); void setFromXYZ(Float x, Float y, Float z, Float a); void set(const YXY&); void setFromYXY(Float Y, Float x, Float y); void setFromYXY(Float Y, Float x, Float y, Float a); void set(const CMY&); void setFromCMY(Float c, Float m, Float y); void setFromCMY(Float c, Float m, Float y, Float a); void set(const CMYK&); void setFromCMYK(Float c, Float m, Float y, Float k); void setFromCMYK(Float c, Float m, Float y, Float k, Float a);
void blendWith(const Pixel_t& src); Pixel_t blendedPixel(const Pixel_t& src) const;
Mixes two pixels by alpha-blending the pixel given as parameter on top of this pixel. (This will have an effect if the alpha of the pixel given as parameter is different from its maximum value. Else this will effectively work as an assignment.)
void averageWith(const Pixel_t&); Pixel_t averagedPixel(const Pixel_t&) const; void averageWith(const Pixel_t*, std::size_t amount); Pixel_t averagedPixel(const Pixel_t*, std::size_t amount) const; template<typename... Rest> void averageWith(const Pixel_t&, Rest&&...); template<typename... Rest> Pixel_t averagedPixel(const Pixel_t&, Rest&&...) const;
Performs proper (alpha-aware) averaging of pixels. (In other words, calculates the weighted average of the pixel color components, using their alphas as the weight factors. The alphas themselves are averaged.)
The variadic template versions can take any amount of parameters (of the same pixel type), and are only available when compiling in C++11 mode.
Examples
WPngImage::PixelF average1 = pixel1.averagedPixel(pixel2); WPngImage::PixelF average2 = pixel1.averagedPixel(pixel2, pixel3, pixel4);
void interpolate(const Pixel_t&, CT factor); Pixel_t interpolatedPixel(const Pixel_t&, CT factor) const; void rawInterpolate(const Pixel_t&, CT factor); Pixel_t rawInterpolatedPixel(const Pixel_t&, CT factor) const;
The first pair of functions calculates proper (alpha-aware) interpolation between this pixel and the one given as parameter. The second pair calculates a simple component-wise interpolation without using the alpha channel as a weighting factor. (The latter will cause, for example, a completely transparent pixel to affect the color of the interpolation. However, in some situations this might be the desired behavior.)
The factor parameter determines the interpolation position between the two pixels. A factor of 0 yields fully the color of this pixel, a factor of the maximum component value yielding fully the parameter pixel color. Factor values in between these two yield linearly interpolated colors between the two.
For Pixel8
the factor ranges from 0 to 255, for Pixel16
it
ranges from 0 to 65535, and for PixelF
it ranges from 0.0 to 1.0.
Note that in the last case the factor can go outside that range. It will not be clipped. The weighting of the two colors will be continued linearly also outside the range (meaning that one color will be more and more emphasized and the other having more and more of a negative effect.)
Pixel8
and Pixel16
:
CT toGray(Int32 rWeight = 299, Int32 gWeight = 587, Int32 bWeight = 114) const; Pixel_t grayPixel(Int32 rWeight = 299, Int32 gWeight = 587, Int32 bWeight = 114) const;
PixelF
:
Float toGray(Float rWeight = 0.299f, Float gWeight = 0.587f, Float bWeight = 0.114f) const; PixelF grayPixel(Float rWeight = 0.299f, Float gWeight = 0.587f, Float bWeight = 0.114f) const;
These perform a simplistic conversion to grayscale using a weight value for each color component. To use different weights than the defaults, specify them as parameters.
CT toGrayCIE() const; Pixel_t grayCIEPixel() const;
These perform a colorimetric (luminance-preserving) conversion to grayscale, as defined by the CIE 1931 standard. This is a more complicated (and thus slightly heavier) conversion than the simpler weighted-average one, but is more accurate.
void premultiplyAlpha(); Pixel_t premultipliedAlphaPixel() const;
Multiplies each component by the alpha value (and, in the case of the integer pixel formats, divides by the maximum component value). This can be useful in some applications, where a texture needs to be alpha-premultiplied before being used (eg. in OpenGL).
void clamp(); PixelF clampedPixel() const;
These functions are exclusive to WPngImage::PixelF
(because it's the only
pixel format that can go outside its normal range).
If any of the four components has a value larger than 1.0
, that component
will be clamped to 1.0
. Likewise if it's less than 0.0
, it will be
clamped to 0.0
.
When used in C++11 (or later), the pixel types can be used in constexpr
expressions, but this is limited to construction, comparison, and element access. In other
words, expressions like this are possible:
constexpr WPngImage::Pixel8 p1(1, 2, 3, 4), p2(5, 6, 7); static_assert(p1.r == 1 && p1.g == 2 && p1.b == 3 && p1.a == 4, "Error"); static_assert(p1 != p2, "Error");
The other member functions of the pixel classes are not constexpr
for
practical reasons, and thus not usable in constexpr
expressions.
The utils
subdirectory contains separate utility libraries for use with WPngImage. Each
has its own separate documentation inside that directory (linked here).


COM+ samples help you understand how to use COM+ features. We provide Visual Basic, Visual C++, and Visual J++ projects that demonstrate the implementation of services such as queued components and events.
| Samples directory | Description |
| Administration | Applications demonstrating how to use and automate COM+ adminsitration |
| Application_Samples | Enterprise-level COM+ user applications as a "best practice" model |
| Fundamentals | Tutorial samples for basic COM programming and other COM Base feature samples |
| Installation_Verification | COM+ application to verify correct installation of COM+ |
| Performance | Toolkit beta for tuning COM application performance |
| Services | Applications demonstrating different COM+ services |
| COM Tutorial | COM development tutorials |


Profile Info
Name:
Email:
Password:
Male
Female
Type of computer:
I have a laptop
I have a desktop
Age:
0 - 20
20 - 40
40+
Biography:


|
Hexagones
1.0
|
Header file of the Map class. More...
Go to the source code of this file.
Data Structures | |
| struct | TMap |
| An class representing the view of the hexagonal map. More... | |
Typedefs | |
| typedef struct THex | THex |
| typedef struct TMap | TMap |
| An class representing the view of the hexagonal map. More... | |
Functions | |
| TMap * | New_TMap (void) |
| The constructor for create a TMap object. More... | |
| void | TMap_Init_Map (TMap *this) |
| Method to initialise the map on the window. More... | |
| void | TMap_Update_Hex (TMap *this, THex *hex) |
| Method for redrawing a tile in its entirety. More... | |
| void | TMap_Reset_Map (TMap *this, color_name_t color) |
| Method to reset the map to its original state. More... | |
| void | TMap_New_Free (TMap *this) |
| Method to free all ressources take by the map view. More... | |
Header file of the Map class.
An class representing the view of the hexagonal map.
TMap is a class representing the view of the hexagonal map.
| TMap* New_TMap | ( | void | ) |
The constructor for create a TMap object.
| void TMap_Init_Map | ( | TMap * | this | ) |
Method to initialise the map on the window.
| this | A pointer to the map view object. |
You do not have to call this method directly. You must use the Init_Map method of the TMap structure like this: map->Init_Map(map);
| void TMap_New_Free | ( | TMap * | this | ) |
Method to free all ressources take by the map view.
| this | A pointer to the map view object. |
You do not have to call this method directly. You must use the Free method of the TMap structure like this: map->Free(map);
| void TMap_Reset_Map | ( | TMap * | this, |
| color_name_t | color | ||
| ) |
Method to reset the map to its original state.
| this | A pointer to the map view object. |
| color | The color to redraw all the tiles. |
You do not have to call this method directly. You must use the Reset_Map method of the TMap structure like this: map->Reset_Map(map, WHITE);
Method for redrawing a tile in its entirety.
| this | A pointer to the map view object. |
| hex | The tile to redraw. |
You do not have to call this method directly. You must use the Update_Hex method of the TMap structure like this: map->Update_Hex(map, hex);


TRICK (Fine Line) Starring: Christian Campbell, J. P. Pitoc, Tori Spelling, Clinton Leupp, Steve Hayes. Screenplay: Jason Schafer. Producers: Eric d'Arbeloff, Jim Fall and Ross Katz. Director: Jim Fall.  Reviewed by Scott Renshaw.
TRICK is one of those rare gay romantic comedies that passes the "straight test." As films with gay themes became more prevalent in recent years, they began to blur together. Filmmakers appeared to think that the mere act of putting a same-sex couple on the screen made the film praise-worthy, often failing to introduce much that was entertaining on its own merits. Thus was born my "straight test," which allowed for a fairly quick barometer of quality: would anyone pay the slightest attention to the same story if the two principal characters were a man and a woman?
Jim Fall's bright, fun, frisky comedy not only passes the "straight test," it makes plenty of straight romantic comedies look positively inept by comparison. Christian Campbell stars as Gabriel, an aspiring musical-comedy composer who spends his days working temp jobs and his nights feeding the ego of his best girlfriend/aspiring singer Katherine (Tori Spelling). That doesn't leave much time to find love, let alone a one-night stand, until a trip to a bar introduces Gabriel to Mark (J. P. Pitoc), a sexy go-go dancer. They make plans for a night of simple sex, but plans go awry when every opportunity to be alone is thwarted. As the evening progresses, and Gabriel and Mark get better acquainted, simple sex begins to seem less interesting -- though also less complicated -- than the prospect of a more serious relationship.
TRICK's single-day structure may be something of a trick in itself, yet there's rarely a moment when Jason Schafer's screenplay feels forced or contrived. Sure, it falls back on humor from drag queens and cabaret performances. Both devices also happen to produce two of TRICK's funniest scenes: a Spanish-language ode to the singer's male member, and advice from a man made up to bear a startling resemblance to one of the cast members. In fact, as pure comedy, TRICK rarely stumbles. Every character gets wonderful moments, sparked by the kind of dialogue Woody Allen used to produce in his prime. Even Tori Spelling -- yes, I said Tori Spelling -- is a revelation as the blissfully self-absorbed Katherine, particularly throwing her "talents" behind a performance of Gabriel's composition "Enter You." When a director can turn Spelling into a gifted comic actress, you know he's a talent to watch for.
I suppose the reason TRICK is even more appealing than its laugh value is that it does more with a gay relationship than any film I can remember. That's probably because it isn't _just_ about a gay relationship. The adorably dimpled Christian Campbell (brother of SCREAM's Neve) makes for an appealing protagonist because he's so recognizably human in his relationship anxieties. The developing relationshp between Gabriel and Mark works the way all good romantic relationships work, exploring the way people discover surprisingly wonderful things about each other when they least expect it. The fact that the relationship develops in the midst of such entertaining comedy is a delightful bonus. The obstacles thrown in their way do begin to feel a bit contrived, but you may be having too much fun to notice. TRICK is so effortlessly charming, I may just change the name of the "straight test" to the "TRICK test."
On the Renshaw scale of 0 to 10 trick treats: 8.
Visit Scott Renshaw's Screening Room http://www.inconnect.com/~renshaw/ *** Subscribe to receive new reviews directly by email! See the Screening Room for details, or reply to this message with subject "Subscribe".
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


UIKit Integration
-
Describes a type of cell that presents a view controller when pressed.
To present a view controller from a FormRow, create and register a specialized FormRow type, and associate it with a FormRow cell class that implements
ControllerSpringingCell
. Use this property on the cell to pass in a closure that returns the view controller to be presented. The view controller could be created dynamically within the closure, or captured in the closure scope.See moreSeealso
FormTableViewCell,Declaration
Swift
public protocol ControllerSpringingCell
-
A protocol with requirements for UITableViewCell subclasses to be used in a table view showing a Form.
See moreDeclaration
Swift
public protocol FormTableViewCell
-
FormViewController
is a descendent ofUIViewController
used to display aForm
in a UIKit application.In order to show a
Form
to a user, you will typically create aForm
, instantiate aFormViewController
, set theFormViewController
’sform
property, and present theFormViewController
.Where a
Form
refers to both the schema and data an application wishes to obtain from a user, theFormViewController
is an adapter that manages the visual presentation of aForm
, manages the lifecycle of interaction with theForm
, and is a key point of interaction with the rest of an iOS application.See moreSeealso
Form
Declaration
Swift
public class FormViewController: UIViewController


installation
prerequisites
There are a few things you need to have in your toolbox before tackling a web application using Mongoid.
- A good to advanced knowledge of Ruby.
- Have good knowledge of your web framework if using one.
- A thorough understanding of MongoDB.
This may seem like a "thank you Captain Obvious" moment, however if you believe that you can just hop over to Mongoid because you read a blog post on how cool Ruby and MongoDB were, you are in for a world of pain.
Mongoid leverages many aspects of the Ruby programming language that are not for beginner use, and sending the core team into a frenzy tracking down a bug for a common Ruby mistake is a waste of our time, and all of the other users of the framework as well.

Mongoid is an abstraction to make application developers' lives easier, however the internals leverage the power of MongoDB and it is truly important to know what is going on under the covers. This is why the documentation provides the exact queries that Mongoid is executing against the database when you call a persistence operation. If we took the time to tell you, you should listen. :)
okay, now i'm ready
The preferred method for installing Mongoid is with bundler. Add the Mongoid and optional BSON extenstions to your Gemfile:
gem "mongoid", "~> 2.4" gem "bson_ext", "~> 1.5"
Alternatively you can get the Mongoid gem direcly from rubygems.org:
$ gem install mongoid bson_ext
Note for performance improvements you will want to also install the bson c extensions if compatible with your system, however it is not a direct dependency of Mongoid in case it is not compatible.


Retrieve the list of objects that match the search parameters
listObjects(x, ...) # S4 method for D1Node listObjects( x, fromDate = as.character(NA), toDate = as.character(NA), formatId = as.character(NA), replicaStatus = as.logical(TRUE), start = as.integer(0), count = as.integer(1000) )
| x | The Node instance from which the SystemMetadata will be downloaded |
|---|---|
| ... | (Not yet used.) |
| fromDate | Entries with a modified date greater than |
| toDate | Entries with a modified date less than |
| formatId | The format to match, for example "eml://ecoinformatics.org/eml-2.1.1" |
| replicaStatus | A logical value that determines if replica (object not on it's origin node) should be returned. Default is TRUE. |
| start | An integer that specifies the first element of the result set that will be returned |
| count | An integer that specifies how many results will be returned |
list Objects that met the search criteria
list Objects that met the search criteria
The list of objects that is returned is paged according to the 'start'
and
'count'
values, so that large result sets can be returned over multiple calls.
if (FALSE) { library(dataone) cn <- CNode("STAGING") fromDate <- "2013-01-01T01:01:01.000+00:00" toDate <- "2015-12-31T01:01:01.000+00:00" formatId <- "eml://ecoinformatics.org/eml-2.1.0" start <- 0 count <- 5 objects <- listObjects(cn, fromDate=fromDate, toDate=toDate, formatId=formatId, start=start, count=count) # Inspect id of first object objects[1]$objectInfo$identifier }


| MPI_GROUP_FREE(group) | |
| INOUT group | group (handle) |
int MPI_Group_free(MPI_Group *group)
MPI_Group_free(group, ierror)
TYPE(MPI_Group), INTENT(INOUT) :: group
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
MPI_GROUP_FREE(GROUP, IERROR)
INTEGER GROUP, IERROR
This operation marks a group object for deallocation. The handle group is set to MPI_GROUP_NULL by the call. Any on-going operation using this group will complete normally.
Advice
to implementors.
One can keep a reference count that is incremented for each call to
MPI_COMM_GROUP,
MPI_COMM_CREATE, MPI_COMM_DUP, and MPI_COMM_IDUP, and
decremented for each call to MPI_GROUP_FREE or
MPI_COMM_FREE; the group object is ultimately deallocated when the
reference count drops to zero.
( End of advice to implementors.)


--- layout: post title: Support and FAQ subtitle_body: 'Check our FAQ for answers to common questions, or contact us for Support.' _date: 05/28/2019 posted_at: null permalink: /support/ masthead: img_path: pat_path: overlay: true categories: [] elsewhere: name: null url: null comments: false share: false seo: title: ShopStatus FAQ description: ShopStatus is an essential app for any Shopify store. Get Alerts When Your Shopify Store Has Issues, Learn the Cause, and Solve the Issue. canonical: null noindex: false social: title: null description: null img_path: '/assets/images/71.jpg' has_info_box: true --- {% include widgets/faq-accordion.html %}


{% with registration_baggage_registrations=registration.baggage.get_registrations %}
The deadline for group changes is {{ league.group_lock_start_date|date:'l, F jS' }} at {{ league.group_lock_start_date|date:'g:iA'|lower }}. This division allows groups of up to {{ league.baggage }} (including you).
{% if registration_baggage_registrations|length > 1 %}


public interface ITKAddress
urn:nhs-uk:addressing:ods:RHM:department:workgroup
where the first part (urn:nhs-uk:addressing:ods
) is
fixed the next part (RHM
in this example) is the ODS
code for the NHS organisation and the latter structures of the address (department:workgroup
) can
be locally defined.
From a messaging standpoint the exact structures on the right hand side are not important, however enough information
must be provided to unambiguously resolve the ITKTransportRoute
of the recipient system (or potentially the next hop in the case of a routed message)
via the DirectoryOfServices
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ADDRESS_TYPE
The OID representing the default (ITK) address type.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getType()
Obtains the address type
|
String |
getURI()
Obtain the URI associated with this address -
e.g.
|
void |
setType(String type)
Allows the address type to be specified if it is not the
DEFAULT_ADDRESS_TYPE |
void |
setURI(String uRI)
Set the URI for this address
|
static final String DEFAULT_ADDRESS_TYPE
void setType(String type)
DEFAULT_ADDRESS_TYPE
type
- The OID representing the address typeString getType()
void setURI(String uRI)
uRI
- the URI to setString getURI()
urn:nhs-uk:addressing:ods:RHM:department:workgroup
All content is available under the Open Government Licence, except where otherwise stated
All example source code is available under Apache 2.0, except where otherwise stated


Class Graphics
The Graphics class exposes an easy to use API for generating vector drawing instructions and drawing them to a specified context.
Note that you can use Graphics without any dependency on the Easel framework by calling draw() directly,
or it can be used with the Shape object to draw vector graphics within the context of an Easel display list.
Note that all drawing methods in Graphics return the Graphics instance, so they can be chained together. For example, the following line of code would generate the instructions to draw a rectangle with a red stroke and blue fill, then render it to the specified context2D:
myGraphics.beginStroke("#F00").beginFill("#00F").drawRect(20, 20, 100, 50).draw(myContext2D);
Defined in: Graphics.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Graphics(instructions)
Constructs a new Graphics instance.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Shortcut to arc.
|
|
|
Shortcut to arcTo.
|
|
|
Shortcut to beginBitmapFill.
|
|
|
Shortcut to beginBitmapStroke.
|
|
|
Shortcut to bezierCurveTo.
|
|
|
Shortcut to clear.
|
|
|
Shortcut to closePath.
|
|
|
Maps the familiar ActionScript curveTo() method to the functionally similar quatraticCurveTo() method.
|
|
|
Shortcut to drawCircle.
|
|
|
Shortcut to drawEllipse.
|
|
|
Shortcut to drawPolyStar.
|
|
|
Shortcut to drawRect.
|
|
|
Maps the familiar ActionScript drawRect() method to the functionally similar rect() method.
|
|
|
Shortcut to endFill.
|
|
|
Shortcut to endStroke.
|
|
|
Shortcut to beginFill.
|
|
|
Shortcut to beginLinearGradientFill.
|
|
|
Shortcut to beginLinearGradientStroke.
|
|
|
Shortcut to lineTo.
|
|
|
Shortcut to moveTo.
|
|
|
Shortcut to quadraticCurveTo / curveTo.
|
|
|
Shortcut to rect.
|
|
|
Shortcut to drawRoundRectComplex.
|
|
|
Shortcut to beginRadialGradientFill.
|
|
|
Shortcut to drawRoundRect.
|
|
|
Shortcut to beginRadialGradientStroke.
|
|
|
Shortcut to beginStroke.
|
|
|
Shortcut to setStrokeStyle.
|
|
| <static> |
Graphics.STROKE_CAPS_MAP
Maps numeric values for the caps parameter of setStrokeStyle to corresponding string values.
|
| <static> |
Graphics.STROKE_JOINTS_MAP
Maps numeric values for the joints parameter of setStrokeStyle to corresponding string values.
|
| Method Attributes | Method Name and Description |
|---|---|
|
arc(x, y, radius, startAngle, endAngle, anticlockwise)
Draws an arc defined by the radius, startAngle and endAngle arguments, centered at the position (x, y).
|
|
|
arcTo(x1, y1, x2, y2, radius)
Draws an arc with the specified control points and radius.
|
|
|
beginBitmapFill(image, repetition)
Begins a pattern fill using the specified image.
|
|
|
beginBitmapStroke(image, repetition)
Begins a pattern fill using the specified image.
|
|
|
beginFill(color)
Begins a fill with the specified color.
|
|
|
beginLinearGradientFill(colors, ratios, x0, y0, x1, y1)
Begins a linear gradient fill defined by the line (x0, y0) to (x1, y1).
|
|
|
beginLinearGradientStroke(colors, ratios, x0, y0, x1, y1)
Begins a linear gradient stroke defined by the line (x0, y0) to (x1, y1).
|
|
|
beginRadialGradientFill(colors, ratios, x0, y0, r0, x1, y1, r1)
Begins a radial gradient fill.
|
|
|
beginRadialGradientStroke(colors, ratios, x0, y0, r0, x1, y1, r1)
Begins a radial gradient stroke.
|
|
|
beginStroke(color)
Begins a stroke with the specified color.
|
|
|
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
Draws a bezier curve from the current drawing point to (x, y) using the control points (cp1x, cp1y) and (cp2x, cp2y).
|
|
|
clear()
Clears all drawing instructions, effectively reseting this Graphics instance.
|
|
|
Closes the current path, effectively drawing a line from the current drawing point to the first drawing point specified since the fill or stroke was last set.
|
|
|
drawCircle(x, y, radius)
Draws a circle with the specified radius at (x, y).
|
|
|
drawEllipse(x, y, w, h)
Draws an ellipse (oval).
|
|
|
drawPolyStar(x, y, radius, sides, pointSize, angle)
Draws a star if pointSize is greater than 0 or a regular polygon if pointSize is 0 with the specified number of points.
|
|
|
drawRoundRect(x, y, w, h, radius)
Draws a rounded rectangle with all corners with the specified radius.
|
|
|
drawRoundRectComplex(x, y, w, h, radiusTL, radiusTR, radiusBR, radiusBL)
Draws a rounded rectangle with different corner radiuses.
|
|
|
endFill()
Ends the current subpath, and begins a new one with no fill.
|
|
|
Ends the current subpath, and begins a new one with no stroke.
|
|
| <static> |
Graphics.getHSL(hue, saturation, lightness, alpha)
Returns a CSS compatible color string based on the specified HSL numeric color values in the format "hsla(360,100,100,1.0)", or if alpha is null then in the format "hsl(360,100,100)".
|
| <static> |
Graphics.getRGB(r, g, b, alpha)
Returns a CSS compatible color string based on the specified RGB numeric color values in the format "rgba(255,255,255,1.0)", or if alpha is null then in the format "rgb(255,255,255)".
|
|
lineTo(x, y)
Draws a line from the current drawing point to the specified position, which become the new current drawing point.
|
|
|
moveTo(x, y)
Moves the drawing point to the specified position.
|
|
|
quadraticCurveTo(cpx, cpy, x, y)
Draws a quadratic curve from the current drawing point to (x, y) using the control point (cpx, cpy).
|
|
|
rect(x, y, w, h)
Draws a rectangle at (x, y) with the specified width and height using the current fill and/or stroke.
|
|
|
setStrokeStyle(thickness, caps, joints, miter)
Sets the stroke style for the current subpath.
|
- Parameters:
- instructions
- Optional. This is a string that will be eval'ed in the scope of this Graphics object. This provides a mechanism for generating a vector shape from a serialized string. Ex. "beginFill('#F00');drawRect(0, 0, 10, 10);"
- Parameters:
- x
- y
- radius
- startAngle
- endAngle
- anticlockwise
- Parameters:
- x1
- y1
- x2
- y2
- radius
- Parameters:
- image
- The Image, Canvas, or Video object to use as the pattern.
- repetition
- Optional. Indicates whether to repeat the image in the fill area. One of repeat, repeat-x, repeat-y, or no-repeat. Defaults to "repeat".
- Parameters:
- image
- The Image, Canvas, or Video object to use as the pattern.
- repetition
- Optional. Indicates whether to repeat the image in the fill area. One of repeat, repeat-x, repeat-y, or no-repeat. Defaults to "repeat".
- Parameters:
- color
- A CSS compatible color value (ex. "#FF0000" or "rgba(255,0,0,0.5)"). Setting to null will result in no fill.
myGraphics.beginLinearGradientFill(["#000","#FFF"], [0, 1], 0, 20, 0, 120).drawRect(20, 20, 120, 120);
- Parameters:
- colors
- An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
- ratios
- An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
- x0
- The position of the first point defining the line that defines the gradient direction and size.
- y0
- The position of the first point defining the line that defines the gradient direction and size.
- x1
- The position of the second point defining the line that defines the gradient direction and size.
- y1
- The position of the second point defining the line that defines the gradient direction and size.
myGraphics.setStrokeStyle(10).beginLinearGradientStroke(["#000","#FFF"], [0, 1], 0, 20, 0, 120).drawRect(20, 20, 120, 120);
- Parameters:
- colors
- An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
- ratios
- An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
- x0
- The position of the first point defining the line that defines the gradient direction and size.
- y0
- The position of the first point defining the line that defines the gradient direction and size.
- x1
- The position of the second point defining the line that defines the gradient direction and size.
- y1
- The position of the second point defining the line that defines the gradient direction and size.
myGraphics.beginRadialGradientFill(["#F00","#00F"], [0, 1], 100, 100, 0, 100, 100, 50).drawCircle(100, 100, 50);
- Parameters:
- colors
- An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
- ratios
- An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
- x0
- Center position of the inner circle that defines the gradient.
- y0
- Center position of the inner circle that defines the gradient.
- r0
- Radius of the inner circle that defines the gradient.
- x1
- Center position of the outer circle that defines the gradient.
- y1
- Center position of the outer circle that defines the gradient.
- r1
- Radius of the outer circle that defines the gradient.
myGraphics.setStrokeStyle(10).beginRadialGradientStroke(["#F00","#00F"], [0, 1], 100, 100, 0, 100, 100, 50).drawRect(50, 90, 150, 110);
- Parameters:
- colors
- An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
- ratios
- An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%, then draw the second color to 100%.
- x0
- Center position of the inner circle that defines the gradient.
- y0
- Center position of the inner circle that defines the gradient.
- r0
- Radius of the inner circle that defines the gradient.
- x1
- Center position of the outer circle that defines the gradient.
- y1
- Center position of the outer circle that defines the gradient.
- r1
- Radius of the outer circle that defines the gradient.
- Parameters:
- color
- A CSS compatible color value (ex. "#FF0000" or "rgba(255,0,0,0.5)"). Setting to null will result in no stroke.
- Parameters:
- cp1x
- cp1y
- cp2x
- cp2y
- x
- y
- Parameters:
- x
- y
- radius
- Parameters:
- x
- y
- w
- h
- Parameters:
- x
- Position of the center of the shape.
- y
- Position of the center of the shape.
- radius
- The outer radius of the shape.
- sides
- The number of points on the star or sides on the polygon.
- pointSize
- The depth or "pointy-ness" of the star points. A pointSize of 0 will draw a regular polygon (no points), a pointSize of 1 will draw nothing because the points are infinitely pointy.
- angle
- The angle of the first point / corner. For example a value of 0 will draw the first point directly to the right of the center.
- Parameters:
- x
- y
- w
- h
- radius
- Corner radius.
- Parameters:
- x
- y
- w
- h
- radiusTL
- Top left corner radius.
- radiusTR
- Top right corner radius.
- radiusBR
- Bottom right corner radius.
- radiusBL
- Bottom left corner radius.
- Parameters:
- hue
- The hue component for the color, between 0 and 360.
- saturation
- The saturation component for the color, between 0 and 100.
- lightness
- The lightness component for the color, between 0 and 100.
- alpha
- Optional. The alpha component for the color where 0 is fully transparent and 1 is fully opaque.
- Parameters:
- r
- The red component for the color, between 0 and 0xFF (255).
- g
- The green component for the color, between 0 and 0xFF (255).
- b
- The blue component for the color, between 0 and 0xFF (255).
- alpha
- Optional. The alpha component for the color where 0 is fully transparent and 1 is fully opaque.
- Parameters:
- x
- y
- Parameters:
- x
- y
- Parameters:
- cpx
- cpy
- x
- y
- Parameters:
- x
- y
- w
- Width of the rectangle
- h
- Height of the rectangle
- Parameters:
- thickness
- The width of the stroke.
- caps
- Optional. Indicates the type of caps to use at the end of lines. One of butt, round, or square. Defaults to "butt". Also accepts the values 0 (butt), 1 (round), and 2 (square) for use with the tiny API.
- joints
- Optional. Specifies the type of joints that should be used where two lines meet. One of bevel, round, or miter. Defaults to "miter". Also accepts the values 0 (miter), 1 (round), and 2 (bevel) for use with the tiny API.
- miter
- Optional. If joints is set to "miter", then you can specify a miter limit ratio which controls at what point a mitered joint will be clipped.


The reasoner is activated and deactivated via the reasoner plugin. If the reasoner is inactive, the plugin looks like this:
To activate the reasoner, click the "Use reasoner" button.
When this button is pressed, the reasoner starts up and begins reasoning. The progress bar may fill up several times before reasoning is complete; there is no way to predict in advance how many reasoner passes will be necessary to reason over an ontology, so the progress bar simply shows the progress of the current reasoner pass.
Once reasoning is complete, a status message appears:
The first line gives the number of milliseconds elapsed during reasoning.
The second line shows how many implied links were discovered.
The third line shows how many implied links are actually shown. Most implied links are trimmed (see trimming). This line shows how many implied links were not trimmed.
The final line shows how many redundant links were found in the ontology.
To turn off the reasoner, unclick the "Use reasoner" box.


Authentication done!
You are successfully authorized!... maybe... perhaps...
Back to App Directory>> you are safe to close this page <<
You are successfully authorized!... maybe... perhaps...
Back to App Directory>> you are safe to close this page <<


|
Figure 1
|
Dynamic water level concept. Example from California for 1 m ... |
|
Figure 2
|
Coastal Storm Modeling System (CoSMoS) workflow. CoSMoS feat ... |
|
Figure 3
|
Study area and coastal flooding examples due to an extreme s ... |
|
Figure 4
|
Examples of coastal flooding with 0.25 m of sea level rise a ... |
|
Figure 5
|
Absolute changes in exposure to coastal-flooding hazards. Ab ... |
|
Figure 6
|
Relative changes in exposure to coastal-flooding hazards. Re ... |


Simple GUI boilerplate for IoT hackday. Purpose of this is to connect actual IoT devices via Firebase to this GUI.