28#include <vigra/impex.hxx>
29#include <wx/busyinfo.h>
30#include <wx/stdpaths.h>
38template <
class PixelType>
42 srcImage.setSize(
input.size());
45 std::vector<PixelType>
outLut;
50 vigra::BasicImage<vigra::RGBValue<PixelType>>
output(
input.size());
58 wxXmlResource::Get()->LoadDialog(
this,
parent,
"enfuse_create_file");
91 const std::string
pixeltype(info.getPixelType());
94 errorMsg =
_(
"The creation of brighter and darker images works only for 8 and 16 bit images.");
99 ImageCache::getInstance().softFlush();
102 catch (std::exception& e)
105 errorMsg = wxString::Format(
_(
"Could not load image %s"), filename.c_str());;
111 SetLabel(GetLabel() +
" " + filename);
239 vigra::resizeImageLinearInterpolation(vigra::srcImageRange(*
m_image->get8BitImage()), vigra::destImageRange(
m_scaledImg));
256 resizedImage.SetData((
unsigned char*)img.data(), img.width(), img.height(),
true);
263 offset.x = (bitmap.GetWidth() -
resizedImage.GetWidth()) / 2;
264 offset.y = (bitmap.GetHeight() -
resizedImage.GetHeight()) / 2;
266 if (!
m_image->iccProfile->empty() ||
wxGetApp().GetToolboxFrame()->HasMonitorProfile())
284 info.setFileType(
"TIFF");
286 if (!
m_image->iccProfile->empty())
288 info.setICCProfile(*
m_image->iccProfile);
290 if (
m_image->image16->size().area() > 0)
293 info.setPixelType(
"UINT16");
297 if (
m_image->mask->size().area() > 0)
303 vigra::exportImage(vigra::srcImageRange(
finalImg), info);
318 info.setPixelType(
"UINT8");
319 if (
m_image->mask->size().area() > 0)
325 vigra::exportImage(vigra::srcImageRange(
finalImg), info);
338 exiftoolCmd.Append(
"-ExposureTime<${exposuretime#;$_*=" + wxString::FromCDouble(std::pow(2,
correction)) +
"} ");
vigra::BasicImage< vigra::RGBValue< PixelType > > CreateBrightVersion(const vigra::BasicImage< vigra::RGBValue< PixelType > > &input, const double correction)
creates a brighter or darker version of the input image using HuginBase::Photometric::InvResponse
Definition of dialog class to create brighter/darker versions of the image.
basic classes and function for queuing commands in wxWidgets
CreateBrightImgDlg(wxWindow *parent)
Constructor, read from xrc ressource; restore position.
void OnSize(wxSizeEvent &e)
handler called when size of control was changed
wxStaticBitmap * m_previewBitmap
long GetCheckedItemCount()
return the number of checked exposures
wxArrayString m_tempFiles
bool CreateAndSaveExposureCorrectedImage(const wxString &filename, const double correction)
create the exposure corrected image and save it to the file
wxChoice * m_stepWidthChoice
std::vector< double > m_exposures
~CreateBrightImgDlg()
destructor, save position
void OnOk(wxCommandEvent &e)
process all images
void OnCreateExposureLevels(wxCommandEvent &e)
update listbox with new exposure values
void CreatewxBitmap(const vigra::BRGBImage &img)
create the wxBitmap version and apply color profiles
void OnExposureChecked(wxListEvent &e)
prevent checking of exposure value 0
void OnExposureSelected(wxListEvent &e)
one exposure selected
ImageCache::EntryPtr m_image
image cache entry for current image
void RescaleImage()
create rescaled image
bool SetImage(const wxString &filename, wxString &errorMsg)
load the image, return true on success, otherwise false, error cause is in errorMsg
double GetExposureStepWidth() const
returns the current selected exposure step width
wxBitmap m_scaledwxBitmap
current image as wxBitmap
wxArrayString GetTempFiles() const
wxListCtrl * m_exposuresListBox
vigra::BRGBImage m_scaledImg
current image as vigra::RGBImage
All variables of a source image.
class AlphaIterator class AlphaAccessor inline void exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const ImageExportInfo &export_info)
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
str wxEscapeFilename(const str &arg)
special escaping routine for CommandQueues
wxString GetExternalProgram(wxConfigBase *config, const wxString &bindir, const wxString &name)
return path and name of external program, which can be overwritten by the user
const wxString GetConfigTempDir(const wxConfigBase *config)
return the temp dir from the preferences, ensure that it ends with path separator
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void createEMoRLUT(const std::vector< float > ¶ms, VECTOR &lut)
void transformImageSpatial(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, Functor const &f, vigra::Diff2D ul)
void enforceMonotonicity(LUT &lut)
enforce monotonicity of an array (mostly used for lookup tables)
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.