MovieLibrary
Class CropSettings

java.lang.Object
  extended by MovieLibrary.CropSettings

public class CropSettings
extends java.lang.Object

class to store and access crop settings easily

Author:
Alex Della-Croce

Constructor Summary
CropSettings(CropSettings reqCropSet)
          crop settings constructor from given crop setting
CropSettings(java.lang.String cropSettings, int originalWidth, int originalHeight)
          Constructor for a crop settings object
Will take a string containing crop values and uncropped width and height.
crop settings will be parsed and crop values will be extracted and calculated appropriately.
 
Method Summary
 int getCropBottom()
          gets crop bottom value
 int getCropHeight()
          gets cropped height value
 int getCropLeft()
          gets crop left value
 int getCropRight()
          gets crop right value
 int getCropTop()
          gets crop top value
 int getCropWidth()
          gets cropped width value
 int getUnCroppedHeight()
          get uncropped height
 int getUnCroppedWidth()
          get uncropped width
 void setCropSettings(int leftCrop, int rightCrop, int topCrop, int bottomCrop)
          sets the crop values to this crop settings object
 java.lang.String toString()
          displays the crop settings in a string form such as "640:480:8:16"
 java.lang.String toStringNice()
          displays the crop settings in a more detailed string form such as "Left: 8, Right: 16, Top: 32, Bottom: 16.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CropSettings

public CropSettings(java.lang.String cropSettings,
                    int originalWidth,
                    int originalHeight)
Constructor for a crop settings object
Will take a string containing crop values and uncropped width and height.
crop settings will be parsed and crop values will be extracted and calculated appropriately.

Parameters:
cropSettings - cropdetect string from mencoder such as "720:480:10:2"
which means 720=cropped width, 480=cropped height, 10=left crop, 2=top crop
originalWidth - original source video uncropped width
originalHeight - original source video uncropped height

CropSettings

public CropSettings(CropSettings reqCropSet)
crop settings constructor from given crop setting

Parameters:
reqCropSet - crop settings to use to create new crop setting
Method Detail

toString

public java.lang.String toString()
displays the crop settings in a string form such as "640:480:8:16"

Overrides:
toString in class java.lang.Object
Returns:
string settings in form, cropped width,cropped height, left crop, top crop

toStringNice

public java.lang.String toStringNice()
displays the crop settings in a more detailed string form such as "Left: 8, Right: 16, Top: 32, Bottom: 16. --> Resulting image size: 720x320"

Returns:
a detailed string version of the crop settings (used for displaying in GUI)

getCropLeft

public int getCropLeft()
gets crop left value

Returns:
left crop value

getCropRight

public int getCropRight()
gets crop right value

Returns:
right crop value

getCropTop

public int getCropTop()
gets crop top value

Returns:
top crop value

getCropBottom

public int getCropBottom()
gets crop bottom value

Returns:
bottom crop value

getCropWidth

public int getCropWidth()
gets cropped width value

Returns:
width value to crop

getCropHeight

public int getCropHeight()
gets cropped height value

Returns:
height value to crop

getUnCroppedWidth

public int getUnCroppedWidth()
get uncropped width

Returns:
uncropped video width

getUnCroppedHeight

public int getUnCroppedHeight()
get uncropped height

Returns:
uncropped video height

setCropSettings

public void setCropSettings(int leftCrop,
                            int rightCrop,
                            int topCrop,
                            int bottomCrop)
sets the crop values to this crop settings object

Parameters:
leftCrop - left crop value to be used
rightCrop - right crop value to be used
topCrop - top crop value to be used
bottomCrop - bottom crop value to be used