summaryrefslogtreecommitdiffstats
path: root/libhb/common.h
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-06-10 17:17:13 +0000
committerjstebbins <[email protected]>2014-06-10 17:17:13 +0000
commit9491a0b137116e8606d4d08f419514d0c298debd (patch)
tree88566f3110666210127c4c8de8cc97afaa461d67 /libhb/common.h
parentfce43d9b98a4d7c88b43b80d70feffbbec048889 (diff)
macui: fix PcitureController geometry calculations
simplifies the code and makes it work better also updates preview window size calculations git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6209 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r--libhb/common.h58
1 files changed, 49 insertions, 9 deletions
diff --git a/libhb/common.h b/libhb/common.h
index 236f96895..a5ba78730 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -78,6 +78,9 @@ typedef struct hb_dither_s hb_dither_t;
typedef struct hb_mixdown_s hb_mixdown_t;
typedef struct hb_encoder_s hb_encoder_t;
typedef struct hb_container_s hb_container_t;
+typedef struct hb_rational_s hb_rational_t;
+typedef struct hb_geometry_s hb_geometry_t;
+typedef struct hb_ui_geometry_s hb_ui_geometry_t;
typedef struct hb_job_s hb_job_t;
typedef struct hb_title_set_s hb_title_set_t;
typedef struct hb_title_s hb_title_t;
@@ -133,8 +136,9 @@ void hb_reduce( int *x, int *y, int num, int den );
void hb_reduce64( int64_t *x, int64_t *y, int64_t num, int64_t den );
void hb_limit_rational64( int64_t *x, int64_t *y, int64_t num, int64_t den, int64_t limit );
-#define HB_KEEP_WIDTH 0
-#define HB_KEEP_HEIGHT 1
+#define HB_KEEP_WIDTH 0x01
+#define HB_KEEP_HEIGHT 0x02
+#define HB_KEEP_DISPLAY_ASPECT 0x04
void hb_fix_aspect( hb_job_t * job, int keep );
void hb_job_set_encoder_preset (hb_job_t *job, const char *preset);
@@ -232,6 +236,34 @@ struct hb_container_s
int format;
};
+struct hb_rational_s
+{
+ int num;
+ int den;
+};
+
+struct hb_geometry_s
+{
+ int width;
+ int height;
+ hb_rational_t par;
+};
+
+struct hb_ui_geometry_s
+{
+ int mode; // Anamorphic mode, see job struct anamorphic
+ int keep; // Specifies settings that shouldn't be changed
+ int itu_par; // use dvd dimensions to determine PAR
+ int modulus; // pixel alignment for loose anamorphic
+ int crop[4]; // Pixels cropped from source before scaling
+ int width; // destination storage width
+ int height; // destination storage height
+ int maxWidth; // max destination storage width
+ int maxHeight; // max destination storage height
+ hb_rational_t par; // Pixel aspect used in custom anamorphic
+ hb_rational_t dar; // Display aspect used in custom anamorphic
+};
+
// Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_subtitle_config_s.cs when changing this struct
struct hb_subtitle_config_s
{
@@ -379,6 +411,14 @@ struct hb_title_set_s
extern int hb_gui_use_hwd_flag;
+typedef enum
+{
+ HB_ANAMORPHIC_NONE,
+ HB_ANAMORPHIC_STRICT,
+ HB_ANAMORPHIC_LOOSE,
+ HB_ANAMORPHIC_CUSTOM
+} hb_anamorphic_mode_t;
+
/******************************************************************************
* hb_job_t: settings to be filled by the UI
* Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs when changing this struct
@@ -422,13 +462,13 @@ struct hb_job_s
struct
{
- int mode;
- int itu_par;
- int par_width;
- int par_height;
- int dar_width; // 0 if normal
- int dar_height; // 0 if normal
- int keep_display_aspect;
+ hb_anamorphic_mode_t mode;
+ int itu_par;
+ int par_width;
+ int par_height;
+ int dar_width; // 0 if normal
+ int dar_height; // 0 if normal
+ int keep_display_aspect;
} anamorphic;
int modulus;