OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::Image Class Reference

#include <Image.hpp>

Public Types

using base_type = Array< Color >
 
using iterator = base_type::iterator
 
using const_iterator = base_type::const_iterator
 
using reverse_iterator = base_type::reverse_iterator
 
using const_reverse_iterator = base_type::const_reverse_iterator
 

Public Member Functions

SIV3D_NODISCARD_CXX20 Image ()=default
 
SIV3D_NODISCARD_CXX20 Image (const Image &)=default
 
SIV3D_NODISCARD_CXX20 Image (Image &&image) noexcept
 
SIV3D_NODISCARD_CXX20 Image (size_t size)
 
SIV3D_NODISCARD_CXX20 Image (size_t size, Color color)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (size_t size, Arg::generator_< Fty > generator)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (size_t size, Arg::generator0_1_< Fty > generator)
 
SIV3D_NODISCARD_CXX20 Image (size_t width, size_t height)
 
SIV3D_NODISCARD_CXX20 Image (size_t width, size_t height, Color color)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (size_t width, size_t height, Arg::generator_< Fty > generator)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (size_t width, size_t height, Arg::generator0_1_< Fty > generator)
 
SIV3D_NODISCARD_CXX20 Image (Size size)
 
SIV3D_NODISCARD_CXX20 Image (Size size, Color color)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (Size size, Arg::generator_< Fty > generator)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (Size size, Arg::generator0_1_< Fty > generator)
 
SIV3D_NODISCARD_CXX20 Image (FilePathView path, ImageFormat format=ImageFormat::Unspecified)
 
SIV3D_NODISCARD_CXX20 Image (IReader &&reader, ImageFormat format=ImageFormat::Unspecified)
 
SIV3D_NODISCARD_CXX20 Image (FilePathView rgb, FilePathView alpha)
 
SIV3D_NODISCARD_CXX20 Image (Color rgb, FilePathView alpha)
 
SIV3D_NODISCARD_CXX20 Image (const Emoji &emoji)
 
SIV3D_NODISCARD_CXX20 Image (const Icon &icon, int32 size)
 
SIV3D_NODISCARD_CXX20 Image (const Grid< Color > &grid)
 
SIV3D_NODISCARD_CXX20 Image (const Grid< ColorF > &grid)
 
template<class Type , class Fty , std::enable_if_t< std::is_invocable_r_v< Color, Fty, Type >> * = nullptr>
SIV3D_NODISCARD_CXX20 Image (const Grid< Type > &grid, Fty converter)
 
Imageoperator= (const Image &)=default
 
Imageoperator= (Image &&image) noexcept
 
int32 width () const noexcept
 画像の幅(ピクセル)を返します。 More...
 
int32 height () const noexcept
 画像の高さ(ピクセル)を返します。 More...
 
Size size () const noexcept
 画像の幅と高さ(ピクセル)を返します。 More...
 
uint32 stride () const noexcept
 画像の各行のサイズ(バイト)を返します。 More...
 
uint32 num_pixels () const noexcept
 画像の総ピクセル数を返します。 More...
 
size_t size_bytes () const noexcept
 画像のデータサイズ(バイト)を返します。 More...
 
bool isEmpty () const noexcept
 画像が空であるかを返します。 More...
 
 operator bool () const noexcept
 画像が空でないかを返します。 More...
 
template<class Type = double>
Type horizontalAspectRatio () const noexcept
 
void shrink_to_fit ()
 使用するメモリ量を現在のサイズまで切り詰めます。 More...
 
void clear () noexcept
 画像を消去し、空の画像にします。 More...
 
void release ()
 画像を消去して空の画像にし、使用するメモリ量を切り詰めます。 More...
 
void swap (Image &image) noexcept
 画像を別の画像と交換します。 More...
 
Image cloned () const
 内容をコピーした新しい画像を作成して返します。 More...
 
Coloroperator[] (size_t y)
 指定した行の先頭ポインタを返します。 More...
 
Coloroperator[] (Point pos)
 指定した位置のピクセルの参照を返します。 More...
 
const Coloroperator[] (size_t y) const
 指定した行の先頭ポインタを返します。 More...
 
const Coloroperator[] (Point pos) const
 指定した位置のピクセルの参照を返します。 More...
 
Colordata ()
 画像データの先頭のポインタを返します。 More...
 
const Colordata () const
 画像データの先頭のポインタを返します。 More...
 
uint8dataAsUint8 ()
 画像データの先頭のポインタを uint8* 型で返します。 More...
 
const uint8dataAsUint8 () const
 画像データの先頭のポインタを uint8* 型で返します。 More...
 
const Array< Color > & asArray () const &
 
Array< ColorasArray () &&
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
void fill (Color color) noexcept
 画像を指定した色で塗りつぶします。 More...
 
void resize (size_t width, size_t height)
 
void resize (Size size)
 
void resize (size_t width, size_t height, Color fillColor)
 
void resize (Size size, Color fillColor)
 
void resizeRows (size_t rows, Color fillColor)
 
Color getPixel (int32 x, int32 y, ImageAddressMode addressMode) const
 
Color getPixel (Point pos, ImageAddressMode addressMode) const
 
ColorF samplePixel (double x, double y, ImageAddressMode addressMode) const
 
ColorF samplePixel (Vec2 pos, ImageAddressMode addressMode) const
 
Image clipped (const Rect &rect) const
 
Image clipped (int32 x, int32 y, int32 w, int32 h) const
 
Image clipped (const Point &pos, int32 w, int32 h) const
 
Image clipped (int32 x, int32 y, const Size &size) const
 
Image clipped (const Point &pos, const Size &size) const
 
Image squareClipped () const
 
template<class Fty >
ImageforEach (Fty f)
 
template<class Fty >
const ImageforEach (Fty f) const
 
ImageRGBAtoBGRA ()
 画像の R 成分と B 成分を入れ替えます。 More...
 
bool applyAlphaFromRChannel (FilePathView alpha)
 
bool save (FilePathView path, ImageFormat format=ImageFormat::Unspecified) const
 画像をファイルに保存します。 More...
 
Blob encode (ImageFormat format) const
 
bool saveWithDialog () const
 
bool savePNG (FilePathView path, PNGFilter filter=PNGEncoder::DefaultFilter) const
 
Blob encodePNG (PNGFilter filter=PNGEncoder::DefaultFilter) const
 
bool saveJPEG (FilePathView path, int32 quality=JPEGEncoder::DefaultQuality) const
 
Blob encodeJPEG (int32 quality=JPEGEncoder::DefaultQuality) const
 
bool savePPM (FilePathView path, PPMType format=PPMEncoder::DefaultFromat) const
 
Blob encodePPM (PPMType format=PPMEncoder::DefaultFromat) const
 
bool saveWebP (FilePathView path, Lossless lossless=Lossless::No, double quality=WebPEncoder::DefaultQuality, WebPMethod method=WebPMethod::Default) const
 
Blob encodeWebP (Lossless lossless=Lossless::No, double quality=WebPEncoder::DefaultQuality, WebPMethod method=WebPMethod::Default) const
 
Imagenegate ()
 画像の色を反転します。 More...
 
Image negated () const
 
Imagegrayscale ()
 画像をグレイスケール画像に変換します。 More...
 
Image grayscaled () const
 
Imagesepia ()
 画像をセピア画像に変換します。 More...
 
Image sepiaed () const
 
Imageposterize (int32 level)
 
Image posterized (int32 level) const
 
Imagebrighten (int32 level)
 
Image brightened (int32 level) const
 
Imagemirror ()
 画像を左右反転します。 More...
 
Image mirrored () const
 
Imageflip ()
 画像を上下反転します。 More...
 
Image flipped () const
 
Imagerotate90 ()
 画像を時計回りに 90° 回転します。 More...
 
Image rotated90 () const
 
Imagerotate180 ()
 画像を時計回りに 180° 回転します。 More...
 
Image rotated180 () const
 
Imagerotate270 ()
 画像を時計回りに 270° 回転します。 More...
 
Image rotated270 () const
 
ImagegammaCorrect (double gamma)
 
Image gammaCorrected (double gamma) const
 
Imagethreshold (uint8 threshold, InvertColor invertColor=InvertColor::No)
 
Image thresholded (uint8 threshold, InvertColor invertColor=InvertColor::No) const
 
Imagethreshold_Otsu (InvertColor invertColor=InvertColor::No)
 
Image thresholded_Otsu (InvertColor invertColor=InvertColor::No) const
 
ImageadaptiveThreshold (AdaptiveThresholdMethod method, int32 blockSize, double c, InvertColor invertColor=InvertColor::No)
 
Image adaptiveThresholded (AdaptiveThresholdMethod method, int32 blockSize, double c, InvertColor invertColor=InvertColor::No) const
 
Imagemosaic (int32 size)
 
Imagemosaic (int32 horizontal, int32 vertical)
 
Image mosaiced (int32 size) const
 
Image mosaiced (int32 horizontal, int32 vertical) const
 
Imagespread (int32 size)
 
Imagespread (int32 horizontal, int32 vertical)
 
Image spreaded (int32 size) const
 
Image spreaded (int32 horizontal, int32 vertical) const
 
Imageblur (int32 size, BorderType borderType=BorderType::Reflect_101)
 
Imageblur (int32 horizontal, int32 vertical, BorderType borderType=BorderType::Reflect_101)
 
Image blurred (int32 size, BorderType borderType=BorderType::Reflect_101) const
 
Image blurred (int32 horizontal, int32 vertical, BorderType borderType=BorderType::Reflect_101) const
 
ImagemedianBlur (int32 apertureSize)
 
Image medianBlurred (int32 apertureSize) const
 
ImagegaussianBlur (int32 size, BorderType borderType=BorderType::Reflect_101)
 
ImagegaussianBlur (int32 horizontal, int32 vertical, BorderType borderType=BorderType::Reflect_101)
 
Image gaussianBlurred (int32 size, BorderType borderType=BorderType::Reflect_101) const
 
Image gaussianBlurred (int32 horizontal, int32 vertical, BorderType borderType=BorderType::Reflect_101) const
 
ImagebilateralFilter (int32 d, double sigmaColor, double sigmaSpace, BorderType borderType=BorderType::Reflect_101)
 
Image bilateralFiltered (int32 d, double sigmaColor, double sigmaSpace, BorderType borderType=BorderType::Reflect_101) const
 
Imagedilate (int32 iterations=1)
 
Image dilated (int32 iterations=1) const
 
Imageerode (int32 iterations=1)
 
Image eroded (int32 iterations=1) const
 
ImagefloodFill (const Point &pos, const Color &color, FloodFillConnectivity connectivity=FloodFillConnectivity::Value4, int32 lowerDifference=0, int32 upperDifference=0)
 
Image floodFilled (const Point &pos, const Color &color, FloodFillConnectivity connectivity=FloodFillConnectivity::Value4, int32 lowerDifference=0, int32 upperDifference=0) const
 
Imagescale (int32 width, int32 height, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto)
 
Image scaled (int32 width, int32 height, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto) const
 
Imagescale (const Size &size, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto)
 
Image scaled (const Size &size, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto) const
 
Imagescale (double scaling, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto)
 
Image scaled (double scaling, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto) const
 
Imagefit (int32 width, int32 height, AllowScaleUp allowScaleUp=AllowScaleUp::Yes, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto)
 
Image fitted (int32 width, int32 height, AllowScaleUp allowScaleUp=AllowScaleUp::Yes, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto) const
 
Imagefit (const Size &size, AllowScaleUp allowScaleUp=AllowScaleUp::Yes, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto)
 
Image fitted (const Size &size, AllowScaleUp allowScaleUp=AllowScaleUp::Yes, InterpolationAlgorithm interpolation=InterpolationAlgorithm::Auto) const
 
Imageborder (int32 thickness, const Color &color=Palette::White)
 
Image bordered (int32 thickness, const Color &color=Palette::White) const
 
Imageborder (int32 top, int32 right, int32 bottom, int32 left, const Color &color=Palette::White)
 
Image bordered (int32 top, int32 right, int32 bottom, int32 left, const Color &color=Palette::White) const
 
Image warpAffine (const Mat3x2 &mat, const Color &background=Color{ 0, 0 }) const
 
Image rotated (double angle, const Color &background=Color{ 0, 0 }) const
 
Image warpPerspective (const Quad &quad, const Color &background=Color{ 0, 0 }) const
 
void paint (Image &dst, int32 x, int32 y, const Color &color=Palette::White) const
 
void paint (Image &dst, const Point &pos, const Color &color=Palette::White) const
 
void stamp (Image &dst, int32 x, int32 y, const Color &color=Palette::White) const
 
void stamp (Image &dst, const Point &pos, const Color &color=Palette::White) const
 
void overwrite (Image &dst, int32 x, int32 y) const
 
void overwrite (Image &dst, Point pos) const
 
void paintAt (Image &dst, int32 x, int32 y, const Color &color=Palette::White) const
 
void paintAt (Image &dst, const Point &pos, const Color &color=Palette::White) const
 
void stampAt (Image &dst, int32 x, int32 y, const Color &color=Palette::White) const
 
void stampAt (Image &dst, const Point &pos, const Color &color=Palette::White) const
 
void overwriteAt (Image &dst, int32 x, int32 y) const
 
void overwriteAt (Image &dst, Point pos) const
 
ImageROI operator() (int32 x, int32 y, int32 w, int32 h)
 
ImageROI operator() (const Point &pos, int32 w, int32 h)
 
ImageROI operator() (int32 x, int32 y, const Size &size)
 
ImageROI operator() (const Point &pos, const Size &size)
 
ImageROI operator() (const Rect &rect)
 
ImageConstROI operator() (int32 x, int32 y, int32 w, int32 h) const
 
ImageConstROI operator() (const Point &pos, int32 w, int32 h) const
 
ImageConstROI operator() (int32 x, int32 y, const Size &size) const
 
ImageConstROI operator() (const Point &pos, const Size &size) const
 
ImageConstROI operator() (const Rect &rect) const
 
Polygon alphaToPolygon (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
Polygon alphaToPolygonCentered (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
MultiPolygon alphaToPolygons (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
MultiPolygon alphaToPolygonsCentered (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
Polygon grayscaleToPolygon (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
Polygon grayscaleToPolygonCentered (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
MultiPolygon grayscaleToPolygons (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 
MultiPolygon grayscaleToPolygonsCentered (uint32 threshold=160, AllowHoles allowHoles=AllowHoles::Yes) const
 

Static Public Member Functions

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
static Image Generate (Size size, Fty generator)
 
template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
static Image Generate0_1 (Size size, Fty generator)
 

Static Public Attributes

static constexpr int32 MaxWidth = 16384
 作成可能な最大の画像の幅 More...
 
static constexpr int32 MaxHeight = 16384
 作成可能な最大の画像の高さ More...
 

Member Typedef Documentation

◆ base_type

◆ const_iterator

◆ const_reverse_iterator

◆ iterator

◆ reverse_iterator

Constructor & Destructor Documentation

◆ Image() [1/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( )
default

◆ Image() [2/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Image )
default

◆ Image() [3/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Image &&  image)
noexcept

◆ Image() [4/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  size)
explicit

◆ Image() [5/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  size,
Color  color 
)
explicit

◆ Image() [6/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  size,
Arg::generator_< Fty >  generator 
)

◆ Image() [7/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  size,
Arg::generator0_1_< Fty >  generator 
)

◆ Image() [8/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  width,
size_t  height 
)

◆ Image() [9/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  width,
size_t  height,
Color  color 
)

◆ Image() [10/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  width,
size_t  height,
Arg::generator_< Fty >  generator 
)

◆ Image() [11/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( size_t  width,
size_t  height,
Arg::generator0_1_< Fty >  generator 
)

◆ Image() [12/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Size  size)
explicit

◆ Image() [13/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Size  size,
Color  color 
)

◆ Image() [14/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Size  size,
Arg::generator_< Fty >  generator 
)

◆ Image() [15/24]

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Size  size,
Arg::generator0_1_< Fty >  generator 
)

◆ Image() [16/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( FilePathView  path,
ImageFormat  format = ImageFormat::Unspecified 
)
explicit

◆ Image() [17/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( IReader &&  reader,
ImageFormat  format = ImageFormat::Unspecified 
)
explicit

◆ Image() [18/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( FilePathView  rgb,
FilePathView  alpha 
)

◆ Image() [19/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( Color  rgb,
FilePathView  alpha 
)

◆ Image() [20/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Emoji emoji)
explicit

◆ Image() [21/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Icon icon,
int32  size 
)
explicit

◆ Image() [22/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Grid< Color > &  grid)
explicit

◆ Image() [23/24]

SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Grid< ColorF > &  grid)
explicit

◆ Image() [24/24]

template<class Type , class Fty , std::enable_if_t< std::is_invocable_r_v< Color, Fty, Type >> * = nullptr>
SIV3D_NODISCARD_CXX20 s3d::Image::Image ( const Grid< Type > &  grid,
Fty  converter 
)
explicit

Member Function Documentation

◆ adaptiveThreshold()

Image& s3d::Image::adaptiveThreshold ( AdaptiveThresholdMethod  method,
int32  blockSize,
double  c,
InvertColor  invertColor = InvertColor::No 
)

◆ adaptiveThresholded()

Image s3d::Image::adaptiveThresholded ( AdaptiveThresholdMethod  method,
int32  blockSize,
double  c,
InvertColor  invertColor = InvertColor::No 
) const

◆ alphaToPolygon()

Polygon s3d::Image::alphaToPolygon ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ alphaToPolygonCentered()

Polygon s3d::Image::alphaToPolygonCentered ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ alphaToPolygons()

MultiPolygon s3d::Image::alphaToPolygons ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ alphaToPolygonsCentered()

MultiPolygon s3d::Image::alphaToPolygonsCentered ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ applyAlphaFromRChannel()

bool s3d::Image::applyAlphaFromRChannel ( FilePathView  alpha)

◆ asArray() [1/2]

Array<Color> s3d::Image::asArray ( ) &&

◆ asArray() [2/2]

const Array<Color>& s3d::Image::asArray ( ) const &

◆ begin() [1/2]

const_iterator s3d::Image::begin ( ) const
noexcept

◆ begin() [2/2]

iterator s3d::Image::begin ( )
noexcept

◆ bilateralFilter()

Image& s3d::Image::bilateralFilter ( int32  d,
double  sigmaColor,
double  sigmaSpace,
BorderType  borderType = BorderType::Reflect_101 
)

◆ bilateralFiltered()

Image s3d::Image::bilateralFiltered ( int32  d,
double  sigmaColor,
double  sigmaSpace,
BorderType  borderType = BorderType::Reflect_101 
) const

◆ blur() [1/2]

Image& s3d::Image::blur ( int32  horizontal,
int32  vertical,
BorderType  borderType = BorderType::Reflect_101 
)

◆ blur() [2/2]

Image& s3d::Image::blur ( int32  size,
BorderType  borderType = BorderType::Reflect_101 
)

◆ blurred() [1/2]

Image s3d::Image::blurred ( int32  horizontal,
int32  vertical,
BorderType  borderType = BorderType::Reflect_101 
) const

◆ blurred() [2/2]

Image s3d::Image::blurred ( int32  size,
BorderType  borderType = BorderType::Reflect_101 
) const

◆ border() [1/2]

Image& s3d::Image::border ( int32  thickness,
const Color color = Palette::White 
)

◆ border() [2/2]

Image& s3d::Image::border ( int32  top,
int32  right,
int32  bottom,
int32  left,
const Color color = Palette::White 
)

◆ bordered() [1/2]

Image s3d::Image::bordered ( int32  thickness,
const Color color = Palette::White 
) const

◆ bordered() [2/2]

Image s3d::Image::bordered ( int32  top,
int32  right,
int32  bottom,
int32  left,
const Color color = Palette::White 
) const

◆ brighten()

Image& s3d::Image::brighten ( int32  level)

◆ brightened()

Image s3d::Image::brightened ( int32  level) const

◆ cbegin()

const_iterator s3d::Image::cbegin ( ) const
noexcept

◆ cend()

const_iterator s3d::Image::cend ( ) const
noexcept

◆ clear()

void s3d::Image::clear ( )
noexcept

画像を消去し、空の画像にします。

Remarks
メモリを解放したい場合は、さらに shrink_to_fit() を呼びます。

◆ clipped() [1/5]

Image s3d::Image::clipped ( const Point pos,
const Size size 
) const

◆ clipped() [2/5]

Image s3d::Image::clipped ( const Point pos,
int32  w,
int32  h 
) const

◆ clipped() [3/5]

Image s3d::Image::clipped ( const Rect rect) const

◆ clipped() [4/5]

Image s3d::Image::clipped ( int32  x,
int32  y,
const Size size 
) const

◆ clipped() [5/5]

Image s3d::Image::clipped ( int32  x,
int32  y,
int32  w,
int32  h 
) const

◆ cloned()

Image s3d::Image::cloned ( ) const

内容をコピーした新しい画像を作成して返します。

Returns
内容をコピーした新しい画像

◆ crbegin()

const_reverse_iterator s3d::Image::crbegin ( ) const
noexcept

◆ crend()

const_reverse_iterator s3d::Image::crend ( ) const
noexcept

◆ data() [1/2]

Color* s3d::Image::data ( )

画像データの先頭のポインタを返します。

Returns
画像データの先頭のポインタ

◆ data() [2/2]

const Color* s3d::Image::data ( ) const

画像データの先頭のポインタを返します。

Returns
画像データの先頭のポインタ

◆ dataAsUint8() [1/2]

uint8* s3d::Image::dataAsUint8 ( )

画像データの先頭のポインタを uint8* 型で返します。

Returns
画像データの先頭のポインタ

◆ dataAsUint8() [2/2]

const uint8* s3d::Image::dataAsUint8 ( ) const

画像データの先頭のポインタを uint8* 型で返します。

Returns
画像データの先頭のポインタ

◆ dilate()

Image& s3d::Image::dilate ( int32  iterations = 1)

◆ dilated()

Image s3d::Image::dilated ( int32  iterations = 1) const

◆ encode()

Blob s3d::Image::encode ( ImageFormat  format) const

◆ encodeJPEG()

Blob s3d::Image::encodeJPEG ( int32  quality = JPEGEncoder::DefaultQuality) const

◆ encodePNG()

Blob s3d::Image::encodePNG ( PNGFilter  filter = PNGEncoder::DefaultFilter) const

◆ encodePPM()

Blob s3d::Image::encodePPM ( PPMType  format = PPMEncoder::DefaultFromat) const

◆ encodeWebP()

Blob s3d::Image::encodeWebP ( Lossless  lossless = Lossless::No,
double  quality = WebPEncoder::DefaultQuality,
WebPMethod  method = WebPMethod::Default 
) const

◆ end() [1/2]

const_iterator s3d::Image::end ( ) const
noexcept

◆ end() [2/2]

iterator s3d::Image::end ( )
noexcept

◆ erode()

Image& s3d::Image::erode ( int32  iterations = 1)

◆ eroded()

Image s3d::Image::eroded ( int32  iterations = 1) const

◆ fill()

void s3d::Image::fill ( Color  color)
noexcept

画像を指定した色で塗りつぶします。

Parameters
color塗りつぶしの色

◆ fit() [1/2]

Image& s3d::Image::fit ( const Size size,
AllowScaleUp  allowScaleUp = AllowScaleUp::Yes,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
)

◆ fit() [2/2]

Image& s3d::Image::fit ( int32  width,
int32  height,
AllowScaleUp  allowScaleUp = AllowScaleUp::Yes,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
)

◆ fitted() [1/2]

Image s3d::Image::fitted ( const Size size,
AllowScaleUp  allowScaleUp = AllowScaleUp::Yes,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
) const

◆ fitted() [2/2]

Image s3d::Image::fitted ( int32  width,
int32  height,
AllowScaleUp  allowScaleUp = AllowScaleUp::Yes,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
) const

◆ flip()

Image& s3d::Image::flip ( )

画像を上下反転します。

Returns
*this

◆ flipped()

Image s3d::Image::flipped ( ) const

◆ floodFill()

Image& s3d::Image::floodFill ( const Point pos,
const Color color,
FloodFillConnectivity  connectivity = FloodFillConnectivity::Value4,
int32  lowerDifference = 0,
int32  upperDifference = 0 
)

◆ floodFilled()

Image s3d::Image::floodFilled ( const Point pos,
const Color color,
FloodFillConnectivity  connectivity = FloodFillConnectivity::Value4,
int32  lowerDifference = 0,
int32  upperDifference = 0 
) const

◆ forEach() [1/2]

template<class Fty >
Image& s3d::Image::forEach ( Fty  f)

◆ forEach() [2/2]

template<class Fty >
const Image& s3d::Image::forEach ( Fty  f) const

◆ gammaCorrect()

Image& s3d::Image::gammaCorrect ( double  gamma)

◆ gammaCorrected()

Image s3d::Image::gammaCorrected ( double  gamma) const

◆ gaussianBlur() [1/2]

Image& s3d::Image::gaussianBlur ( int32  horizontal,
int32  vertical,
BorderType  borderType = BorderType::Reflect_101 
)

◆ gaussianBlur() [2/2]

Image& s3d::Image::gaussianBlur ( int32  size,
BorderType  borderType = BorderType::Reflect_101 
)

◆ gaussianBlurred() [1/2]

Image s3d::Image::gaussianBlurred ( int32  horizontal,
int32  vertical,
BorderType  borderType = BorderType::Reflect_101 
) const

◆ gaussianBlurred() [2/2]

Image s3d::Image::gaussianBlurred ( int32  size,
BorderType  borderType = BorderType::Reflect_101 
) const

◆ Generate()

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty >, std::is_invocable_r< Color, Fty, Point >, std::is_invocable_r< Color, Fty, int32, int32 >>> * = nullptr>
static Image s3d::Image::Generate ( Size  size,
Fty  generator 
)
static

◆ Generate0_1()

template<class Fty , std::enable_if_t< std::disjunction_v< std::is_invocable_r< Color, Fty, Vec2 >, std::is_invocable_r< Color, Fty, double, double >>> * = nullptr>
static Image s3d::Image::Generate0_1 ( Size  size,
Fty  generator 
)
static

◆ getPixel() [1/2]

Color s3d::Image::getPixel ( int32  x,
int32  y,
ImageAddressMode  addressMode 
) const

◆ getPixel() [2/2]

Color s3d::Image::getPixel ( Point  pos,
ImageAddressMode  addressMode 
) const

◆ grayscale()

Image& s3d::Image::grayscale ( )

画像をグレイスケール画像に変換します。

Returns
*this

◆ grayscaled()

Image s3d::Image::grayscaled ( ) const

◆ grayscaleToPolygon()

Polygon s3d::Image::grayscaleToPolygon ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ grayscaleToPolygonCentered()

Polygon s3d::Image::grayscaleToPolygonCentered ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ grayscaleToPolygons()

MultiPolygon s3d::Image::grayscaleToPolygons ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ grayscaleToPolygonsCentered()

MultiPolygon s3d::Image::grayscaleToPolygonsCentered ( uint32  threshold = 160,
AllowHoles  allowHoles = AllowHoles::Yes 
) const

◆ height()

int32 s3d::Image::height ( ) const
noexcept

画像の高さ(ピクセル)を返します。

Returns
画像の高さ(ピクセル)

◆ horizontalAspectRatio()

template<class Type = double>
Type s3d::Image::horizontalAspectRatio ( ) const
noexcept

◆ isEmpty()

bool s3d::Image::isEmpty ( ) const
noexcept

画像が空であるかを返します。

Returns
画像が空である場合 true, それ以外の場合は false

◆ medianBlur()

Image& s3d::Image::medianBlur ( int32  apertureSize)

◆ medianBlurred()

Image s3d::Image::medianBlurred ( int32  apertureSize) const

◆ mirror()

Image& s3d::Image::mirror ( )

画像を左右反転します。

Returns
*this

◆ mirrored()

Image s3d::Image::mirrored ( ) const

◆ mosaic() [1/2]

Image& s3d::Image::mosaic ( int32  horizontal,
int32  vertical 
)

◆ mosaic() [2/2]

Image& s3d::Image::mosaic ( int32  size)

◆ mosaiced() [1/2]

Image s3d::Image::mosaiced ( int32  horizontal,
int32  vertical 
) const

◆ mosaiced() [2/2]

Image s3d::Image::mosaiced ( int32  size) const

◆ negate()

Image& s3d::Image::negate ( )

画像の色を反転します。

Returns
*this

◆ negated()

Image s3d::Image::negated ( ) const

◆ num_pixels()

uint32 s3d::Image::num_pixels ( ) const
noexcept

画像の総ピクセル数を返します。

Remarks
(width() * height()) です。
Returns
画像の総ピクセル数

◆ operator bool()

s3d::Image::operator bool ( ) const
explicitnoexcept

画像が空でないかを返します。

Returns
画像が空でない場合 true, それ以外の場合は false

◆ operator()() [1/10]

ImageROI s3d::Image::operator() ( const Point pos,
const Size size 
)

◆ operator()() [2/10]

ImageConstROI s3d::Image::operator() ( const Point pos,
const Size size 
) const

◆ operator()() [3/10]

ImageROI s3d::Image::operator() ( const Point pos,
int32  w,
int32  h 
)

◆ operator()() [4/10]

ImageConstROI s3d::Image::operator() ( const Point pos,
int32  w,
int32  h 
) const

◆ operator()() [5/10]

ImageROI s3d::Image::operator() ( const Rect rect)

◆ operator()() [6/10]

ImageConstROI s3d::Image::operator() ( const Rect rect) const

◆ operator()() [7/10]

ImageROI s3d::Image::operator() ( int32  x,
int32  y,
const Size size 
)

◆ operator()() [8/10]

ImageConstROI s3d::Image::operator() ( int32  x,
int32  y,
const Size size 
) const

◆ operator()() [9/10]

ImageROI s3d::Image::operator() ( int32  x,
int32  y,
int32  w,
int32  h 
)

◆ operator()() [10/10]

ImageConstROI s3d::Image::operator() ( int32  x,
int32  y,
int32  w,
int32  h 
) const

◆ operator=() [1/2]

Image& s3d::Image::operator= ( const Image )
default

◆ operator=() [2/2]

Image& s3d::Image::operator= ( Image &&  image)
noexcept

◆ operator[]() [1/4]

Color& s3d::Image::operator[] ( Point  pos)

指定した位置のピクセルの参照を返します。

Parameters
pos位置
Returns
指定した位置のピクセルの参照

◆ operator[]() [2/4]

const Color& s3d::Image::operator[] ( Point  pos) const

指定した位置のピクセルの参照を返します。

Parameters
pos位置
Returns
指定した位置のピクセルの参照

◆ operator[]() [3/4]

Color* s3d::Image::operator[] ( size_t  y)

指定した行の先頭ポインタを返します。

Parameters
y位置(行)
Remarks
image[y][x] で指定したピクセルにアクセスします。
Returns
指定した行の先頭ポインタ

◆ operator[]() [4/4]

const Color* s3d::Image::operator[] ( size_t  y) const

指定した行の先頭ポインタを返します。

Parameters
y位置(行)
Remarks
image[y][x] で指定したピクセルにアクセスします。
Returns
指定した行の先頭ポインタ

◆ overwrite() [1/2]

void s3d::Image::overwrite ( Image dst,
int32  x,
int32  y 
) const

◆ overwrite() [2/2]

void s3d::Image::overwrite ( Image dst,
Point  pos 
) const

◆ overwriteAt() [1/2]

void s3d::Image::overwriteAt ( Image dst,
int32  x,
int32  y 
) const

◆ overwriteAt() [2/2]

void s3d::Image::overwriteAt ( Image dst,
Point  pos 
) const

◆ paint() [1/2]

void s3d::Image::paint ( Image dst,
const Point pos,
const Color color = Palette::White 
) const

◆ paint() [2/2]

void s3d::Image::paint ( Image dst,
int32  x,
int32  y,
const Color color = Palette::White 
) const

◆ paintAt() [1/2]

void s3d::Image::paintAt ( Image dst,
const Point pos,
const Color color = Palette::White 
) const

◆ paintAt() [2/2]

void s3d::Image::paintAt ( Image dst,
int32  x,
int32  y,
const Color color = Palette::White 
) const

◆ posterize()

Image& s3d::Image::posterize ( int32  level)

◆ posterized()

Image s3d::Image::posterized ( int32  level) const

◆ rbegin() [1/2]

const_reverse_iterator s3d::Image::rbegin ( ) const
noexcept

◆ rbegin() [2/2]

reverse_iterator s3d::Image::rbegin ( )
noexcept

◆ release()

void s3d::Image::release ( )

画像を消去して空の画像にし、使用するメモリ量を切り詰めます。

Remarks
clear() + shrink_to_fit() と同じです。

◆ rend() [1/2]

const_reverse_iterator s3d::Image::rend ( ) const
noexcept

◆ rend() [2/2]

reverse_iterator s3d::Image::rend ( )
noexcept

◆ resize() [1/4]

void s3d::Image::resize ( Size  size)

◆ resize() [2/4]

void s3d::Image::resize ( Size  size,
Color  fillColor 
)

◆ resize() [3/4]

void s3d::Image::resize ( size_t  width,
size_t  height 
)

◆ resize() [4/4]

void s3d::Image::resize ( size_t  width,
size_t  height,
Color  fillColor 
)

◆ resizeRows()

void s3d::Image::resizeRows ( size_t  rows,
Color  fillColor 
)

◆ RGBAtoBGRA()

Image& s3d::Image::RGBAtoBGRA ( )

画像の R 成分と B 成分を入れ替えます。

Returns
*this

◆ rotate180()

Image& s3d::Image::rotate180 ( )

画像を時計回りに 180° 回転します。

Returns
*this

◆ rotate270()

Image& s3d::Image::rotate270 ( )

画像を時計回りに 270° 回転します。

Returns
*this

◆ rotate90()

Image& s3d::Image::rotate90 ( )

画像を時計回りに 90° 回転します。

Returns
*this

◆ rotated()

Image s3d::Image::rotated ( double  angle,
const Color background = Color{ 0, 0 } 
) const

◆ rotated180()

Image s3d::Image::rotated180 ( ) const

◆ rotated270()

Image s3d::Image::rotated270 ( ) const

◆ rotated90()

Image s3d::Image::rotated90 ( ) const

◆ samplePixel() [1/2]

ColorF s3d::Image::samplePixel ( double  x,
double  y,
ImageAddressMode  addressMode 
) const

◆ samplePixel() [2/2]

ColorF s3d::Image::samplePixel ( Vec2  pos,
ImageAddressMode  addressMode 
) const

◆ save()

bool s3d::Image::save ( FilePathView  path,
ImageFormat  format = ImageFormat::Unspecified 
) const

画像をファイルに保存します。

Parameters
path保存するファイルパス
format保存時のフォーマット。ImageFormat::Unspecified の場合拡張子から判断
Returns
保存に成功した場合 true, それ以外の場合は false

◆ saveJPEG()

bool s3d::Image::saveJPEG ( FilePathView  path,
int32  quality = JPEGEncoder::DefaultQuality 
) const

◆ savePNG()

bool s3d::Image::savePNG ( FilePathView  path,
PNGFilter  filter = PNGEncoder::DefaultFilter 
) const

◆ savePPM()

bool s3d::Image::savePPM ( FilePathView  path,
PPMType  format = PPMEncoder::DefaultFromat 
) const

◆ saveWebP()

bool s3d::Image::saveWebP ( FilePathView  path,
Lossless  lossless = Lossless::No,
double  quality = WebPEncoder::DefaultQuality,
WebPMethod  method = WebPMethod::Default 
) const

◆ saveWithDialog()

bool s3d::Image::saveWithDialog ( ) const

◆ scale() [1/3]

Image& s3d::Image::scale ( const Size size,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
)

◆ scale() [2/3]

Image& s3d::Image::scale ( double  scaling,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
)

◆ scale() [3/3]

Image& s3d::Image::scale ( int32  width,
int32  height,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
)

◆ scaled() [1/3]

Image s3d::Image::scaled ( const Size size,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
) const

◆ scaled() [2/3]

Image s3d::Image::scaled ( double  scaling,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
) const

◆ scaled() [3/3]

Image s3d::Image::scaled ( int32  width,
int32  height,
InterpolationAlgorithm  interpolation = InterpolationAlgorithm::Auto 
) const

◆ sepia()

Image& s3d::Image::sepia ( )

画像をセピア画像に変換します。

Returns
*this

◆ sepiaed()

Image s3d::Image::sepiaed ( ) const

◆ shrink_to_fit()

void s3d::Image::shrink_to_fit ( )

使用するメモリ量を現在のサイズまで切り詰めます。

◆ size()

Size s3d::Image::size ( ) const
noexcept

画像の幅と高さ(ピクセル)を返します。

Returns
画像の幅と高さ(ピクセル)

◆ size_bytes()

size_t s3d::Image::size_bytes ( ) const
noexcept

画像のデータサイズ(バイト)を返します。

Remarks
(stride() * height()) です。
Returns
画像のデータサイズ(バイト)

◆ spread() [1/2]

Image& s3d::Image::spread ( int32  horizontal,
int32  vertical 
)

◆ spread() [2/2]

Image& s3d::Image::spread ( int32  size)

◆ spreaded() [1/2]

Image s3d::Image::spreaded ( int32  horizontal,
int32  vertical 
) const

◆ spreaded() [2/2]

Image s3d::Image::spreaded ( int32  size) const

◆ squareClipped()

Image s3d::Image::squareClipped ( ) const

◆ stamp() [1/2]

void s3d::Image::stamp ( Image dst,
const Point pos,
const Color color = Palette::White 
) const

◆ stamp() [2/2]

void s3d::Image::stamp ( Image dst,
int32  x,
int32  y,
const Color color = Palette::White 
) const

◆ stampAt() [1/2]

void s3d::Image::stampAt ( Image dst,
const Point pos,
const Color color = Palette::White 
) const

◆ stampAt() [2/2]

void s3d::Image::stampAt ( Image dst,
int32  x,
int32  y,
const Color color = Palette::White 
) const

◆ stride()

uint32 s3d::Image::stride ( ) const
noexcept

画像の各行のサイズ(バイト)を返します。

Remarks
(width() * sizeof(Color)) です。
Returns
画像の各行のサイズ(バイト)

◆ swap()

void s3d::Image::swap ( Image image)
noexcept

画像を別の画像と交換します。

Parameters
image交換する画像

◆ threshold()

Image& s3d::Image::threshold ( uint8  threshold,
InvertColor  invertColor = InvertColor::No 
)

◆ threshold_Otsu()

Image& s3d::Image::threshold_Otsu ( InvertColor  invertColor = InvertColor::No)

◆ thresholded()

Image s3d::Image::thresholded ( uint8  threshold,
InvertColor  invertColor = InvertColor::No 
) const

◆ thresholded_Otsu()

Image s3d::Image::thresholded_Otsu ( InvertColor  invertColor = InvertColor::No) const

◆ warpAffine()

Image s3d::Image::warpAffine ( const Mat3x2 mat,
const Color background = Color{ 0, 0 } 
) const

◆ warpPerspective()

Image s3d::Image::warpPerspective ( const Quad quad,
const Color background = Color{ 0, 0 } 
) const

◆ width()

int32 s3d::Image::width ( ) const
noexcept

画像の幅(ピクセル)を返します。

Returns
画像の幅(ピクセル)

Member Data Documentation

◆ MaxHeight

constexpr int32 s3d::Image::MaxHeight = 16384
staticconstexpr

作成可能な最大の画像の高さ

◆ MaxWidth

constexpr int32 s3d::Image::MaxWidth = 16384
staticconstexpr

作成可能な最大の画像の幅


The documentation for this class was generated from the following file: