1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
|
/*
* UFRaw - Unidentified Flying Raw converter for digital camera images
*
* ufraw_ui.h - Common definitions for UFRaw's GUI.
* Copyright 2004-2014 by Udi Fuchs
*
* 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.
*/
#ifndef _UFRAW_UI_H
#define _UFRAW_UI_H
#define raw_his_size 320
#define live_his_size 256
#define max_scale 20
typedef struct {
GtkLabel *labels[5];
int num;
int format;
gboolean zonep; /* non-zero to display value/zone */
} colorLabels;
typedef enum { render_default, render_overexposed, render_underexposed
} RenderModeType;
typedef enum { options_button, cancel_button, ok_button, save_button,
gimp_button, delete_button, num_buttons
} ControlButtons;
typedef enum { spot_cursor, crop_cursor,
left_cursor, right_cursor, top_cursor, bottom_cursor,
top_left_cursor, top_right_cursor, bottom_left_cursor, bottom_right_cursor,
move_cursor, cursor_num
} CursorType;
enum { base_curve, luminosity_curve };
/* All the "global" information is here: */
typedef struct {
ufraw_data *UF;
conf_data *rc;
int raw_his[raw_his_size][4];
int TypeComboMap[num_types];
GdkPixbuf *PreviewPixbuf;
GdkCursor *Cursor[cursor_num];
/* Remember the Gtk Widgets that we need to access later */
GtkWidget *Controls, *PreviewWidget, *RawHisto, *LiveHisto;
GtkLabel *DarkFrameLabel;
GtkWidget *BaseCurveWidget, *CurveWidget, *BlackLabel;
GtkComboBox *BaseCurveCombo, *CurveCombo,
*ProfileCombo[profile_types], *BitDepthCombo, *TypeCombo;
GtkWidget *GrayscaleButtons[6];
GtkTable *SpotTable;
GtkTable *GrayscaleMixerTable;
GtkLabel *GrayscaleMixerColor;
GtkLabel *SpotPatch;
GtkLabel *HotpixelCount;
colorLabels *SpotLabels, *AvrLabels, *DevLabels, *OverLabels, *UnderLabels;
GtkToggleButton *AutoExposureButton, *AutoBlackButton;
GtkToggleButton *AutoCropButton, *LockAspectButton;
GtkWidget *AutoCurveButton;
GtkWidget *ResetGammaButton, *ResetLinearButton;
GtkWidget *ResetExposureButton, *ResetSaturationButton;
GtkWidget *ResetThresholdButton;
GtkWidget *ResetHotpixelButton;
#ifdef UFRAW_CONTRAST
GtkWidget *ResetContrastButton;
#endif
GtkWidget *ResetBlackButton, *ResetBaseCurveButton, *ResetCurveButton;
GtkWidget *ResetGrayscaleChannelMixerButton;
GtkWidget *ResetDespeckleButton;
GtkWidget *SaveButton;
GtkWidget *ControlButton[num_buttons];
guint16 ButtonMnemonic[num_buttons];
GtkProgressBar *ProgressBar;
GtkSpinButton *CropX1Spin;
GtkSpinButton *CropY1Spin;
GtkSpinButton *CropX2Spin;
GtkSpinButton *CropY2Spin;
GtkSpinButton *ShrinkSpin;
GtkSpinButton *HeightSpin;
GtkSpinButton *WidthSpin;
/* We need the adjustments for update_scale() */
GtkAdjustment *GammaAdjustment;
GtkAdjustment *LinearAdjustment;
GtkAdjustment *ExposureAdjustment;
GtkAdjustment *ThresholdAdjustment;
GtkAdjustment *HotpixelAdjustment;
GtkAdjustment *SaturationAdjustment;
#ifdef UFRAW_CONTRAST
GtkAdjustment *ContrastAdjustment;
#endif
GtkWidget *LightnessHueSelectNewButton;
GtkTable *LightnessAdjustmentTable[max_adjustments];
GtkAdjustment *LightnessAdjustment[max_adjustments];
GtkWidget *ResetLightnessAdjustmentButton[max_adjustments];
GtkWidget *LightnessHueSelectButton[max_adjustments];
GtkWidget *LightnessHueRemoveButton[max_adjustments];
GtkAdjustment *CropX1Adjustment;
GtkAdjustment *CropY1Adjustment;
GtkAdjustment *CropX2Adjustment;
GtkAdjustment *CropY2Adjustment;
GtkAdjustment *ZoomAdjustment;
GtkAdjustment *ShrinkAdjustment;
GtkAdjustment *HeightAdjustment;
GtkAdjustment *WidthAdjustment;
GtkAdjustment *RotationAdjustment;
GtkWidget *ResetRotationAdjustment;
GtkAdjustment *GrayscaleMixers[3];
GtkAdjustment *DespeckleWindowAdj[4];
GtkAdjustment *DespeckleDecayAdj[4];
GtkAdjustment *DespecklePassesAdj[4];
GtkToggleButton *DespeckleLockChannelsButton;
GtkToggleButton *ChannelSelectButton[4];
int ChannelSelect;
#ifdef HAVE_LENSFUN
/* The GtkEntry with camera maker/model name */
GtkWidget *CameraModel;
/* The menu used to choose camera - either full or limited by search criteria */
GtkWidget *CameraMenu;
/* The GtkEntry with lens maker/model name */
GtkWidget *LensModel;
/* The menu used to choose lens - either full or limited by search criteria */
GtkWidget *LensMenu;
/* The lens fix notebook distortion page */
GtkWidget *LensDistortionTable, *LensDistortionDesc;
/* The lens fix notebook TCA page */
GtkWidget *LensTCATable, *LensTCADesc;
/* The lens fix notebook vignetting page */
GtkWidget *LensVignettingTable, *LensVignettingDesc;
/* The hbox containing focal, aperture, distance combos */
GtkWidget *LensParamBox;
#endif /* HAVE_LENSFUN */
long(*SaveFunc)();
RenderModeType RenderMode;
/* Current subarea index (0-31). If negative, rendering has stopped */
int RenderSubArea;
/* Some actions update the progress bar while working, but meanwhile we
* want to freeze all other actions. After we thaw the dialog we must
* call update_scales() which was also frozen. */
gboolean FreezeDialog;
/* Since the event-box can be larger than the preview pixbuf we need: */
gboolean PreviewButtonPressed, SpotDraw;
int SpotX1, SpotY1, SpotX2, SpotY2;
CursorType CropMotionType;
int DrawnCropX1, DrawnCropX2, DrawnCropY1, DrawnCropY2;
double shrink, height, width;
gboolean OptionsChanged;
int PageNum;
int PageNumSpot;
int PageNumGray;
int PageNumLensfun;
int PageNumLightness;
int PageNumCrop;
int HisMinHeight;
int UnnormalizedOrientation;
/* Original aspect ratio (0) or actual aspect ratio */
/* The aspect ratio entry field */
GtkEntry *AspectEntry;
/* Output base filename (without the path) */
GtkEntry *OutFileEntry;
/* Mouse coordinates in previous frame (used when dragging crop area) */
int OldMouseX, OldMouseY;
int OverUnderTicker;
/* The event source number when the highlight blink function is enabled. */
guint BlinkTimer;
guint DrawCropID;
} preview_data;
/* Response can be any unique positive integer */
#define UFRAW_RESPONSE_DELETE 1
#define UFRAW_NO_RESPONSE 2
/* These #defines are not very elegant, but otherwise things get tooo long */
#define CFG data->UF->conf
#define RC data->rc
#define Developer data->UF->developer
#define CFG_cameraCurve (CFG->BaseCurve[camera_curve].m_numAnchors>0)
/* Start the render preview refresh thread for invalid layers in background */
void render_preview(preview_data *data);
void lens_fill_interface(preview_data *data, GtkWidget *page);
GtkWidget *table_with_frame(GtkWidget *box, char *label, gboolean expand);
GtkWidget *notebook_page_new(GtkNotebook *notebook, char *text, char *icon);
GtkWidget *stock_icon_button(const gchar *stock_id,
const char *tip, GCallback callback, void *data);
void ufnumber_adjustment_scale(UFObject *obj,
GtkTable *table, int x, int y, const char *label, const char *tip);
#endif /* _UFRAW_UI_H */
|