📄 image.cpp
字号:
try { oImage->gaussianBlur(width, sigma); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Implode(double factor, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->implode(factor); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::MedianFilter(double radius, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->medianFilter(radius); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Minify(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->minify(); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Modulate(double brightness, double saturation, double hue, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->modulate(brightness, saturation, hue); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Negate(VARIANT_BOOL grayscale, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->negate(grayscale); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::OilPaint(unsigned int radius, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->oilPaint(radius); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Opacity(unsigned int opacity, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->opacity(opacity); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Roll(int columns, int rows, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->roll(columns, rows); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Solarize(double factor, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->solarize(factor); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Spread(unsigned int amount, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->spread(amount); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Sharpen(double radius, double sigma, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->sharpen(radius, sigma); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Shade(double azimuth, double elevation, VARIANT_BOOL colorShading, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->shade(azimuth, elevation, colorShading); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Shear(double xShearAngle, double yShearAngle, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->shear(xShearAngle, yShearAngle); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Swirl(double degrees, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->swirl(degrees); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Wave(double amplitude, double wavelength, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->wave(amplitude, wavelength); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::UnsharpMask(double radius, double sigma, double amount, double threshold, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->unsharpmask(radius, sigma, amount, threshold); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Trim(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->trim(); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Blur(double radius, double sigma, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->blur(radius, sigma); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Charcoal(double radius, double sigma, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->charcoal(radius, sigma); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Erase(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->erase(); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Magnify(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->magnify(); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Quantize(VARIANT_BOOL measureError, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->quantize(); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Threshold(double threshold, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here ErrorMsg.Empty(); try { oImage->threshold(threshold); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::Crop(BSTR geometry, VARIANT_BOOL *pVal){ // TODO: Add your implementation code here USES_CONVERSION; try { oImage->crop(geometry ? OLE2A(geometry) : ""); *pVal = true; } catch( Exception &error_ ) { string ErrorG = error_.what(); CImage::SetErrorMessage(ErrorG.c_str()); *pVal = false; } return S_OK;}STDMETHODIMP CImage::get_Format(BSTR *pVal){ // TODO: Add your implementation code here USES_CONVERSION; string strFormat = oImage->format(); CComBSTR cstrFormat = A2OLE(strFormat.c_str()); *pVal = cstrFormat; return S_OK;}STDMETHODIMP CImage::get_meanErrorPerPixel(double *pVal){ // TODO: Add your implementation code here *pVal = oImage->meanErrorPerPixel(); return S_OK;}STDMETHODIMP CImage::get_Quality(unsigned int *pVal){ // TODO: Add your implementation code here *pVal = oImage->quality(); return S_OK;}STDMETHODIMP CImage::put_Quality(unsigned int Quality){ // TODO: Add your implementation code here oImage->quality(Quality); return S_OK;}STDMETHODIMP CImage::get_Depth(unsigned int *pVal){ // TODO: Add your implementation code here *pVal = oImage->depth(); return S_OK;}STDMETHODIMP CImage::put_Depth(unsigned int newVal){ // TODO: Add your implementation code here oImage->depth(newVal); return S_OK;}STDMETHODIMP CImage::get_FileSize(long *pVal){ // TODO: Add your implementation code here *pVal = oImage->fileSize(); return S_OK;}STDMETHODIMP CImage::get_Adjoin(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here *pVal = oImage->adjoin(); return S_OK;}STDMETHODIMP CImage::put_Adjoin(VARIANT_BOOL newVal){ // TODO: Add your implementation code here oImage->adjoin(newVal); return S_OK;}STDMETHODIMP CImage::get_AntiAlias(VARIANT_BOOL *pVal){ // TODO: Add your implementation code here *pVal = oImage->antiAlias(); return S_OK;}STDMETHODIMP CImage::put_AntiAlias(VARIANT_BOOL newVal){ // TODO: Add your implementation code here oImage->antiAlias(newVal); return S_OK;}STDMETHODIMP CImage::get_AnimationDelay(unsigned int *pVal){ // TODO: Add your implementation code here *pVal = oImage->animationDelay(); return S_OK;}STDMETHODIMP CImage::put_AnimationDelay(unsigned int newVal){ // TODO: Add your implementation code here oImage->animationDelay(newVal); return S_OK;}STDMETHODIMP CImage::get_AnimationIterations(unsigned int *pVal){ // TODO: Add your implementation code here *pVal = oImage->animationIterations(); return S_OK;}STDMETHODIMP CImage::put_AnimationIterations(unsigned int newVal){ // TODO: Add your implementation code here oImage->animationIterations(newVal); return S_OK;}STDMETHODIMP CImage::get_BackgroundTexture(BSTR *pVal){ // TODO: Add your implementation code here USES_CONVERSION; string strFormat = oImage->backgroundTexture(); CComBSTR cstrFormat = A2OLE(strFormat.c_str()); *pVal = cstrFormat; return S_OK;}STDMETHODIMP CImage::put_BackgroundTexture(BSTR newVal){ // TODO: Add your implementation code here USES_CONVERSION; oImage->backgroundTexture(newVal ? OLE2A(newVal) : ""); return S_OK;}STDMETHODIMP CImage::get_BaseColumns(unsigned int *pVal){ // TODO: Add your implementation code here
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -