7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2024-11-24 00:34:47 +00:00
kicad/include/dialogs/panel_image_editor.h
John Beard 3f131e2011 Abstract REFERENCE_IMAGE to a separate class
Break the non-PCB-specfic parts of PCB_REFERENCE_IMAGE out
to a common REFERENCE_IMAGE class, which is then composed into
the PCB_REFERENCE_IMAGE. This will make it easier to bring the
transform origin logic to eeschema without repetition.
2024-09-30 10:20:20 +01:00

57 lines
1.8 KiB
C++

/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2018 jean-pierre.charras
* Copyright (C) 2018-2024 Kicad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#pragma once
#include <panel_image_editor_base.h>
#include <memory>
class BITMAP_BASE;
class PANEL_IMAGE_EDITOR : public PANEL_IMAGE_EDITOR_BASE
{
public:
PANEL_IMAGE_EDITOR( wxWindow* aParent, const BITMAP_BASE& aItem );
~PANEL_IMAGE_EDITOR();
public:
bool TransferDataFromWindow() override;
/**
* Function TransferToImage
* copy edited image to aItem
*/
void TransferToImage( BITMAP_BASE& aItem );
private:
void OnGreyScaleConvert( wxCommandEvent& event ) override;
void OnRedrawPanel( wxPaintEvent& event ) override;
bool CheckValues();
// A copy of BITMAP_BASE to be edited
std::unique_ptr<BITMAP_BASE> m_workingImage;
};