Files
Work/meshwrp/imageview.hpp
2024-08-07 09:16:27 -04:00

177 lines
4.2 KiB
C++

#ifndef _MESHWRP_IMAGEVIEW_HPP_
#define _MESHWRP_IMAGEVIEW_HPP_
#ifndef _COMMON_MDIWIN_HPP_
#include <common/mdiwin.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _COMMON_BRUSH_HPP_
#include <common/brush.hpp>
#endif
#ifndef _TOOLBAR_TOOLBAR_HPP_
#include <toolbar/toolbar.hpp>
#endif
#ifndef _MESHWRP_MESH_HPP_
#include <meshwrp/mesh.hpp>
#endif
#ifndef _MESHWRP_SCROLLINFO_HPP_
#include <meshwrp/scroll.hpp>
#endif
#ifndef _MESHWRP_IMAGE_HPP_
#include <meshwrp/image.hpp>
#endif
/*
#include <meshwrp/main.hpp>
#include <meshwrp/capture.hpp>
#include <meshwrp/mdiwin.hpp>
#include <meshwrp/gif.hpp>
#include <meshwrp/process.hpp>
#include <meshwrp/spacial.hpp>
#include <meshwrp/pwarp.hpp>
#include <meshwrp/convex.hpp>
#include <meshwrp/average.hpp>
#include <meshwrp/clipbrd.hpp>
#include <meshwrp/toolbar.hpp>
#include <meshwrp/mesh.hpp>
#include <meshwrp/dslvdlg.hpp>
#include <meshwrp/rgb.hpp>
#include <meshwrp/schedule.hpp>
*/
class BWindow;
class ImageView : public MDIWindow
{
public:
enum Direction{WarpForward,WarpReverse};
ImageView(void);
ImageView(const ImageView &someImageView);
virtual ~ImageView();
bool open(const String &strPathFileName);
bool operator==(const ImageView &imageView)const;
bool hasMesh(void)const;
void showMesh(void);
void noMesh(void);
void handleFrames(void);
void resizeImage(void);
void handleWarpConvex(void);
void meshWarp(Direction warpDirection=WarpForward);
protected:
virtual void preRegister(WNDCLASS &wndClass);
virtual void preCreate(MDICREATESTRUCT &createStruct);
private:
enum {DefaultFrames=3};
enum {MenuConform=0x0F};
CallbackData::ReturnType paintHandler(CallbackData &callbackData);
CallbackData::ReturnType sizeHandler(CallbackData &callbackData);
CallbackData::ReturnType createHandler(CallbackData &callbackData);
CallbackData::ReturnType verticalScrollHandler(CallbackData &callbackData);
CallbackData::ReturnType horizontalScrollHandler(CallbackData &callbackData);
CallbackData::ReturnType eraseBackgroundHandler(CallbackData &callbackData);
void clearEmptyRegion(PureDevice &pureDevice);
ImageView &operator=(const ImageView &imageView);
void setTitle(const String &strTitle);
void installHandlers(void);
void removeHandlers(void);
void handleMeshRequest(WPARAM wParam,LPARAM lParam);
void handleDestroyEvent(void);
void handleActivateEvent(WPARAM wParam,LPARAM lParam);
void handleSystemMenuEvent(WPARAM wParam)const;
void handleToolbarToggle(void);
void enableMenu(const char isEnabled)const;
void modifySystemMenu(void);
void updateCaption(void)const;
void operator=(Bitmap &someBitmap);
void imageProcessing(void);
void menuClip(void);
void meshWarp(ImageView *lpTargetView);
void warpPerspective(void);
void warpConvex(void);
void translateMatrix(void);
void shearTransform(void);
void saveBitmap(void);
void sequentialNames(const String &pathFileName,Block<String> &pathFileNames,int nFrames);
void createProjectFile(Block<String> &pathFileNames);
Image mImage;
ScrollInfo mScrollInfo;
Brush mBkBrush;
SmartPointer<GridMesh> mGridMesh;
SmartPointer<ToolBar> mToolControl;
Callback<ImageView> mCreateHandler;
Callback<ImageView> mSizeHandler;
Callback<ImageView> mPaintHandler;
Callback<ImageView> mVerticalScrollHandler;
Callback<ImageView> mHorizontalScrollHandler;
Callback<ImageView> mEraseBackgroundHandler;
DWORD mCurrentMeshFrames;
// static char szClassName[];
// static char szMenuName[];
// static HINSTANCE smhInstance;
/* int mCurrentMeshFrames;
WORD mToolbarVisibility;
WORD mMaxColors;
WORD mWidth;
WORD mHeight;
char mPathFileName[MaxFileName+1];
Capture mCapture;
HWND mhClientWindow;
HWND mhFrameWindow;
WORD mIsDestroyed;
HMENU mhSystemMenu;
HMENU mhFrameMenu;
HMENU mhViewMenu;
HPALETTE mhPalette;
HGLOBAL mhGlobalInvert;
HGLOBAL mhGlobal;
HGLOBAL mhBMPGlobal;
Clipboard *mlpClipboard;
BWindow *mpStatusBar;
Process *mpProcessImage;
SpacialTransform *mpSpacial;
PerspectiveWarp *mpPerspectiveWarp;
Convex *mlpConvexTransform;
BITMAPINFO FAR *mpBI;
UHUGE *mhpImageInvert;
UHUGE *mhpImage;
ToolBar *mlpToolBar;
GridMesh *mlpGridMesh;
Block<RGBStruct> mPaletteData;
Block<Schedule> mDissolveSchedule; */
};
inline
bool ImageView::hasMesh(void)const
{
return mGridMesh.isOkay();
}
#endif