2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Image.h>
4 #include<Framework/ImagePack.h>
15 static bool Mono( Image* 処理イメージ ,
int 青色差 ,
int 赤色差)
23 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_MONO ,青色差 , 赤色差);
28 static bool Mono( ImagePack *処理イメージ郡 ,
int 青色差 ,
int 赤色差)
31 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
33 Mono( 処理イメージ郡[0][i] , 青色差 , 赤色差 );
42 static bool Gauss( Image* 処理イメージ ,
int 使用ピクセル幅 ,
double ぼかし強さ)
54 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_GAUSS , 使用ピクセル幅 , int(ぼかし強さ*100) );
59 static bool Gauss( ImagePack *処理イメージ郡 ,
int 使用ピクセル幅 ,
double ぼかし強さ)
62 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
64 Gauss( 処理イメージ郡[0][i] , 使用ピクセル幅 ,
int(ぼかし強さ*100));
73 static bool DownScale( Image* 処理イメージ ,
int 分母)
80 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_DOWN_SCALE , 分母 );
85 static bool DownScale( ImagePack *処理イメージ郡 ,
int 分母)
88 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
99 static bool BrightClip( Image* 処理イメージ , ClipType cmpType,
int cmpParam ,
int clipFillColor ,
int clipFillAlpha)
106 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_BRIGHT_CLIP , cmpType, cmpParam , true , clipFillColor , clipFillAlpha);
111 static bool BrightClip( ImagePack *処理イメージ郡 , ClipType cmpType,
int cmpParam ,
int clipFillColor ,
int clipFillAlpha)
114 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
116 BrightClip( 処理イメージ郡[0][i] , cmpType , cmpParam , clipFillColor , clipFillAlpha);
125 static bool Hsb( Image* 処理イメージ ,
int 色相 ,
double 彩度 ,
double 明度)
132 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_HSB , TRUE , 色相 , int(彩度*255) , int(明度*255) );
137 static bool Hsb( ImagePack *処理イメージ郡 ,
int 色相 ,
double 彩度 ,
double 明度)
140 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
142 Hsb( 処理イメージ郡[0][i] , 色相 , 彩度 , 明度);
151 static bool MonoHsb( Image* 処理イメージ ,
int 色相 ,
double 彩度 ,
double 明度)
158 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_HSB , FALSE , 色相 , int(彩度*255) , int(明度*255) );
163 static bool MonoHsb( ImagePack *処理イメージ郡 ,
int 色相 ,
double 彩度 ,
double 明度)
166 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
168 MonoHsb( 処理イメージ郡[0][i] , 色相 , 彩度 , 明度);
177 bool Invert( Image* 処理イメージ )
181 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_INVERT );
186 bool Invert( ImagePack *処理イメージ郡 )
189 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
200 bool Level( Image* 処理イメージ ,
int 処理前下限 ,
int 処理前上限 ,
int 処理後下限 ,
int 処理後上限,
double ガンマ値 )
209 if( ガンマ値 < 0.01 ) ガンマ値 = 0.01;
210 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_LEVEL , 処理前下限 , 処理前上限 , int(ガンマ値*100) , 処理後下限 , 処理後上限);
216 bool Level( ImagePack *処理イメージ郡 ,
int 処理前下限 ,
int 処理前上限 ,
int 処理後下限 ,
int 処理後上限,
double ガンマ値 )
219 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
221 Level( 処理イメージ郡[0][i] , 処理前下限 , 処理前上限 , 処理後下限 , 処理後上限, ガンマ値);
230 bool TwoColor( Image* 処理イメージ ,
int 閾値 ,
int 暗色 ,
int 暗色α値 ,
int 明色 ,
int 明色α値 )
234 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_TWO_COLOR , 閾値 , 暗色 , 暗色α値 , 明色 , 明色α値 );
240 bool TwoColor( ImagePack *処理イメージ郡 ,
int 閾値 ,
int 暗色 ,
int 暗色α値 ,
int 明色 ,
int 明色α値 )
243 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
245 TwoColor( 処理イメージ郡[0][i] , 閾値 , 暗色 , 暗色α値 , 明色 , 明色α値 );
254 bool GradientMap( Image* 処理イメージ ,
const Image *入力イメージ ,
bool 反転フラグ)
261 return !DxLib::GraphFilter( 処理イメージ->GetHandle() , DX_GRAPH_FILTER_GRADIENT_MAP , 入力イメージ->GetHandle(), 反転フラグ );
266 bool GradientMap( ImagePack *処理イメージ郡 ,
const Image *入力イメージ ,
bool 反転フラグ)
269 for(
int i=0 ; i<処理イメージ郡->GetSize() ;++i )
290 DxLib::GraphFilterBlt(元イメージ->
GetHandle(), outPut.GetHandle(), DX_GRAPH_FILTER_MONO, 青色差, 赤色差);
295 static Image Mono(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int 青色差,
int 赤色差)
299 DxLib::GraphFilterRectBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_MONO ,青色差 , 赤色差);
310 DxLib::GraphFilterBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_GAUSS , 使用ピクセル幅 , ぼかし強さ);
315 static Image Gauss(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int 使用ピクセル幅,
int ぼかし強さ)
319 DxLib::GraphFilterRectBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_GAUSS , 使用ピクセル幅 , ぼかし強さ);
330 DxLib::GraphFilterBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_DOWN_SCALE , num );
335 static Image DownScale(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int num)
339 DxLib::GraphFilterRectBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_DOWN_SCALE , num );
346 static Image BrightClip(
const Image *元イメージ, ClipType cmpType,
int cmpParam,
bool isClipFill,
int clipFillColor,
int clipFillAlpha)
350 DxLib::GraphFilterBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_BRIGHT_CLIP , cmpType, cmpParam , isClipFill , clipFillColor , clipFillAlpha);
355 static Image BrightClip(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY, ClipType cmpType,
int cmpParam,
bool isClipFill,
int clipFillColor,
int clipFillAlpha)
359 DxLib::GraphFilterRectBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_BRIGHT_CLIP , cmpType, cmpParam , isClipFill , clipFillColor , clipFillAlpha);
370 DxLib::GraphFilterBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_HSB , true , hue , saturation , bright );
375 static Image Hsb(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int hue,
int saturation,
int bright)
379 DxLib::GraphFilterRectBlt( 元イメージ->
GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_HSB , true , hue , saturation , bright );
390 DxLib::GraphFilterBlt(元イメージ->
GetHandle(), outPut.GetHandle(), DX_GRAPH_FILTER_HSB,
false, hue, saturation, bright);
395 static Image MonoHsb(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int hue,
int saturation,
int bright)
399 DxLib::GraphFilterRectBlt(元イメージ->
GetHandle(), outPut.GetHandle(), srcX1, srcY1, srcX2, srcY2, destX, destY, DX_GRAPH_FILTER_HSB,
false, hue, saturation, bright);
406 static Image
Invert(
const Image *元イメージ)
409 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
411 DxLib::GraphFilterBlt( 元イメージ->GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_INVERT );
416 static Image
Invert(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY)
418 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
420 DxLib::GraphFilterRectBlt( 元イメージ->GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_INVERT );
427 static Image
Level(
const Image *元イメージ,
int min,
int max,
int gammma,
int affterMin,
int affterMax)
435 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
437 DxLib::GraphFilterBlt( 元イメージ->GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_LEVEL , min , max , gammma , affterMin , affterMax);
442 static Image
Level(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int min,
int max,
int gammma,
int affterMin,
int affterMax)
444 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
446 DxLib::GraphFilterRectBlt( 元イメージ->GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_LEVEL , min , max , gammma , affterMin , affterMax);
453 static Image
TwoColor(
const Image *元イメージ,
int threshold,
int lowColor,
int lowAlpha,
int highColor,
int highAlpha)
456 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
458 DxLib::GraphFilterBlt( 元イメージ->GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_TWO_COLOR , threshold , lowColor , lowAlpha , highColor , highAlpha );
463 static Image
TwoColor(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
int threshold,
int lowColor,
int lowAlpha,
int highColor,
int highAlpha)
465 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
467 DxLib::GraphFilterRectBlt( 元イメージ->GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_TWO_COLOR , threshold , lowColor , lowAlpha , highColor , highAlpha );
474 static Image
GradientMap(
const Image *元イメージ,
const Image *mapGraph,
bool isReverse)
480 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
482 DxLib::GraphFilterBlt( 元イメージ->GetHandle(), outPut.GetHandle() , DX_GRAPH_FILTER_GRADIENT_MAP , mapGraph->GetHandle() , isReverse );
487 static Image
GradientMap(
const Image *元イメージ,
int srcX1,
int srcY1,
int srcX2,
int srcY2,
int destX,
int destY,
const Image *mapGraph,
bool isReverse)
489 Image outPut(元イメージ->GetWidth(), 元イメージ->GetHeight(),
true,
true,
true);
491 DxLib::GraphFilterRectBlt( 元イメージ->GetHandle(), outPut.GetHandle() , srcX1, srcY1, srcX2, srcY2, destX, destY , DX_GRAPH_FILTER_GRADIENT_MAP , mapGraph->GetHandle() , isReverse );
static bool Mono(Image *処理イメージ, int 青色差, int 赤色差)
モノトーンフィルタ.
Definition: Filter.h:20
static Image DownScale(const Image *元イメージ, int num)
縮小フィルタ.
Definition: Filter.h:326
static Image Gauss(const Image *元イメージ, int 使用ピクセル幅, int ぼかし強さ)
ガウスフィルタ.
Definition: Filter.h:306
static bool BrightClip(Image *処理イメージ, ClipType cmpType, int cmpParam, int clipFillColor, int clipFillAlpha)
明るさクリップフィルタ.
Definition: Filter.h:103
static bool Hsb(Image *処理イメージ, int 色相, double 彩度, double 明度)
色相・彩度・明度フィルタ.
Definition: Filter.h:129
static Image MonoHsb(const Image *元イメージ, int hue, int saturation, int bright)
色相・彩度・明度フィルタ.
Definition: Filter.h:386
ImageHandle GetHandle() const
ハンドルを取得.
Definition: Image.h:189
static Image BrightClip(const Image *元イメージ, ClipType cmpType, int cmpParam, bool isClipFill, int clipFillColor, int clipFillAlpha)
明るさクリップフィルタ.
Definition: Filter.h:346
static bool DownScale(Image *処理イメージ, int 分母)
縮小フィルタ.
Definition: Filter.h:77
bool Level(Image *処理イメージ, int 処理前下限, int 処理前上限, int 処理後下限, int 処理後上限, double ガンマ値)
レベル補正フィルタ.
Definition: Filter.h:206
static Image Mono(const Image *元イメージ, int 青色差, int 赤色差)
モノトーンフィルタ.
Definition: Filter.h:286
static bool MonoHsb(Image *処理イメージ, int 色相, double 彩度, double 明度)
色相・彩度・明度フィルタ.
Definition: Filter.h:155
画像データを表すクラス.
Definition: Image.h:37
bool Invert(Image *処理イメージ)
階調反転フィルタ.
Definition: Filter.h:178
static Image GradientMap(const Image *元イメージ, const Image *mapGraph, bool isReverse)
グラデーションマップフィルタ.
Definition: Filter.h:478
int GetHeight() const
高さを取得.
Definition: Image.h:385
int GetWidth() const
幅を取得.
Definition: Image.h:375
static Image Invert(const Image *元イメージ)
階調反転フィルタ.
Definition: Filter.h:407
static Image TwoColor(const Image *元イメージ, int threshold, int lowColor, int lowAlpha, int highColor, int highAlpha)
2階調フィルタ.
Definition: Filter.h:454
bool GradientMap(Image *処理イメージ, const Image *入力イメージ, bool 反転フラグ)
グラデーションマップフィルタ.
Definition: Filter.h:258
bool TwoColor(Image *処理イメージ, int 閾値, int 暗色, int 暗色α値, int 明色, int 明色α値)
2階調フィルタ.
Definition: Filter.h:231
static Image Hsb(const Image *元イメージ, int hue, int saturation, int bright)
色相・彩度・明度フィルタ.
Definition: Filter.h:366
static bool Gauss(Image *処理イメージ, int 使用ピクセル幅, double ぼかし強さ)
ガウスフィルタ.
Definition: Filter.h:51
static Image Level(const Image *元イメージ, int min, int max, int gammma, int affterMin, int affterMax)
レベル補正フィルタ.
Definition: Filter.h:433