summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/filters/Gotham.xml30
-rwxr-xr-xindra/newview/app_settings/filters/Hefe.xml23
-rwxr-xr-xindra/newview/app_settings/filters/Inkwell.xml14
-rwxr-xr-xindra/newview/app_settings/filters/Lomofi.xml23
-rwxr-xr-xindra/newview/app_settings/filters/Poprocket.xml25
-rwxr-xr-xindra/newview/app_settings/filters/Sutro.xml19
-rwxr-xr-xindra/newview/app_settings/filters/Toaster.xml23
-rw-r--r--indra/newview/llfloaterflickr.cpp32
-rw-r--r--indra/newview/llfloaterflickr.h1
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp16
-rw-r--r--indra/newview/llsnapshotlivepreview.h3
-rw-r--r--indra/newview/skins/default/xui/en/panel_flickr_photo.xml31
12 files changed, 207 insertions, 33 deletions
diff --git a/indra/newview/app_settings/filters/Gotham.xml b/indra/newview/app_settings/filters/Gotham.xml
new file mode 100755
index 0000000000..eb0725e6bf
--- /dev/null
+++ b/indra/newview/app_settings/filters/Gotham.xml
@@ -0,0 +1,30 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>gamma</string>
+ <real>1.5</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Hefe.xml b/indra/newview/app_settings/filters/Hefe.xml
new file mode 100755
index 0000000000..527aaee847
--- /dev/null
+++ b/indra/newview/app_settings/filters/Hefe.xml
@@ -0,0 +1,23 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>blend</string>
+ <real>4.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>contrast</string>
+ <real>2.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Inkwell.xml b/indra/newview/app_settings/filters/Inkwell.xml
new file mode 100755
index 0000000000..77c88b5fbb
--- /dev/null
+++ b/indra/newview/app_settings/filters/Inkwell.xml
@@ -0,0 +1,14 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.05</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>grayscale</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Lomofi.xml b/indra/newview/app_settings/filters/Lomofi.xml
new file mode 100755
index 0000000000..f5ec911e59
--- /dev/null
+++ b/indra/newview/app_settings/filters/Lomofi.xml
@@ -0,0 +1,23 @@
+<llsd>
+ <array>
+ <array>
+ <string>blend</string>
+ <real>4.0</real>
+ <real>0.0</real>
+ </array>
+ <array>
+ <string>linearize</string>
+ <real>0.2</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>20.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Poprocket.xml b/indra/newview/app_settings/filters/Poprocket.xml
new file mode 100755
index 0000000000..7e64003908
--- /dev/null
+++ b/indra/newview/app_settings/filters/Poprocket.xml
@@ -0,0 +1,25 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>fade</string>
+ <real>4.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>colorize</string>
+ <real>1.0</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ <real>0.4</real>
+ <real>0.0</real>
+ <real>0.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Sutro.xml b/indra/newview/app_settings/filters/Sutro.xml
new file mode 100755
index 0000000000..3b0a58f01e
--- /dev/null
+++ b/indra/newview/app_settings/filters/Sutro.xml
@@ -0,0 +1,19 @@
+<llsd>
+ <array>
+ <array>
+ <string>linearize</string>
+ <real>0.05</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>fade</string>
+ <real>4.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>sepia</string>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/app_settings/filters/Toaster.xml b/indra/newview/app_settings/filters/Toaster.xml
new file mode 100755
index 0000000000..170a1183ed
--- /dev/null
+++ b/indra/newview/app_settings/filters/Toaster.xml
@@ -0,0 +1,23 @@
+<llsd>
+ <array>
+ <array>
+ <string>contrast</string>
+ <real>0.8</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ <array>
+ <string>fade</string>
+ <real>4.0</real>
+ <real>0.5</real>
+ </array>
+ <array>
+ <string>brighten</string>
+ <real>10.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ <real>1.0</real>
+ </array>
+ </array>
+</llsd>
diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp
index 0a4c3f091b..675266143d 100644
--- a/indra/newview/llfloaterflickr.cpp
+++ b/indra/newview/llfloaterflickr.cpp
@@ -92,6 +92,8 @@ BOOL LLFlickrPhotoPanel::postBuild()
mSnapshotPanel = getChild<LLUICtrl>("snapshot_panel");
mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
mResolutionComboBox->setCommitCallback(boost::bind(&LLFlickrPhotoPanel::updateResolution, this, TRUE));
+ mFilterComboBox = getChild<LLUICtrl>("filters_combobox");
+ mFilterComboBox->setCommitCallback(boost::bind(&LLFlickrPhotoPanel::updateResolution, this, TRUE));
mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
mWorkingLabel = getChild<LLUICtrl>("working_lbl");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
@@ -301,33 +303,18 @@ void LLFlickrPhotoPanel::clearAndClose()
void LLFlickrPhotoPanel::updateControls()
{
LLSnapshotLivePreview* previewp = getPreviewView();
- BOOL got_bytes = previewp && previewp->getDataSize() > 0;
BOOL got_snap = previewp && previewp->getSnapshotUpToDate();
- LLSnapshotLivePreview::ESnapshotType shot_type = (previewp ? previewp->getSnapshotType() : LLSnapshotLivePreview::SNAPSHOT_POSTCARD);
// *TODO: Separate maximum size for Web images from postcards
lldebugs << "Is snapshot up-to-date? " << got_snap << llendl;
- LLLocale locale(LLLocale::USER_LOCALE);
- std::string bytes_string;
- if (got_snap)
- {
- LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 );
- }
-
- //getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string
- getChild<LLUICtrl>("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown");
- getChild<LLUICtrl>("file_size_label")->setColor(
- shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
- && got_bytes
- && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
-
updateResolution(FALSE);
}
void LLFlickrPhotoPanel::updateResolution(BOOL do_update)
{
- LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+ LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox);
+ LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox);
std::string sdstring = combobox->getSelectedValue();
LLSD sdres;
@@ -336,6 +323,9 @@ void LLFlickrPhotoPanel::updateResolution(BOOL do_update)
S32 width = sdres[0];
S32 height = sdres[1];
+
+ const std::string& filter_name = filterbox->getSimple();
+ llinfos << "Merov : filter name is : " << filter_name << llendl;
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
if (previewp && combobox->getCurrentIndex() >= 0)
@@ -359,10 +349,16 @@ void LLFlickrPhotoPanel::updateResolution(BOOL do_update)
checkAspectRatio(width);
previewp->getSize(width, height);
+ // Merov :
+ // Get the old filter, compare to the current one "filter_name" and set if changed
+ // If changed, also force the updateSnapshot() here under
+ S32 original_filter = previewp->getFilter();
+ S32 filter = ("Gray Scale" == filter_name ? 1 : 0);
- if(original_width != width || original_height != height)
+ if ((original_width != width) || (original_height != height) || (original_filter != filter))
{
previewp->setSize(width, height);
+ previewp->setFilter(filter);
// hide old preview as the aspect ratio could be wrong
lldebugs << "updating thumbnail" << llendl;
diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h
index 9a329d4451..1d9e649899 100644
--- a/indra/newview/llfloaterflickr.h
+++ b/indra/newview/llfloaterflickr.h
@@ -63,6 +63,7 @@ private:
LLUICtrl * mSnapshotPanel;
LLUICtrl * mResolutionComboBox;
+ LLUICtrl * mFilterComboBox;
LLUICtrl * mRefreshBtn;
LLUICtrl * mWorkingLabel;
LLUICtrl * mThumbnailPlaceholder;
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 7f578975db..2931178ace 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -89,7 +89,8 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param
mCameraPos(LLViewerCamera::getInstance()->getOrigin()),
mCameraRot(LLViewerCamera::getInstance()->getQuaternion()),
mSnapshotActive(FALSE),
- mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR)
+ mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR),
+ mFilterType(0)
{
setSnapshotQuality(gSavedSettings.getS32("SnapshotQuality"));
mSnapshotDelayTimer.setTimerExpirySec(0.0f);
@@ -585,7 +586,12 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
if(raw)
{
raw->expandToPowerOfTwo();
- mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
+ // Merov : Filter also the thumbnail?
+ if (getFilter() == 1)
+ {
+ raw->filterGrayScale();
+ }
+ mThumbnailImage = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE);
mThumbnailUpToDate = TRUE ;
}
@@ -689,6 +695,12 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
}
else
{
+ // Merov : Time to apply the filter to mPreviewImage!!!
+ if (previewp->getFilter() == 1)
+ {
+ previewp->mPreviewImage->filterGrayScale();
+ }
+
// delete any existing image
previewp->mFormattedImage = NULL;
// now create the new one of the appropriate format.
diff --git a/indra/newview/llsnapshotlivepreview.h b/indra/newview/llsnapshotlivepreview.h
index 0c63bf47c7..d5ae3b491b 100644
--- a/indra/newview/llsnapshotlivepreview.h
+++ b/indra/newview/llsnapshotlivepreview.h
@@ -95,6 +95,8 @@ public:
void setSnapshotFormat(LLFloaterSnapshot::ESnapshotFormat type) { mSnapshotFormat = type; }
bool setSnapshotQuality(S32 quality, bool set_by_user = true);
void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; }
+ void setFilter(S32 filter) { mFilterType = filter; }
+ S32 getFilter() { return mFilterType; }
void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f);
void saveWeb();
void saveTexture();
@@ -154,6 +156,7 @@ private:
LLQuaternion mCameraRot;
BOOL mSnapshotActive;
LLViewerWindow::ESnapshotType mSnapshotBufferType;
+ S32 mFilterType; // *TODO: eventually use a string and a named filter
public:
static std::set<LLSnapshotLivePreview*> sList;
diff --git a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml
index b3af271f34..28e3557e15 100644
--- a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml
@@ -40,19 +40,24 @@
name="1024x768"
value="[i1024,i768]" />
</combo_box>
- <text
- follows="left|top"
- font="SansSerifSmall"
- height="14"
- left="208"
- length="1"
- halign="right"
- name="file_size_label"
- top="9"
- type="string"
- width="50">
- [SIZE] KB
- </text>
+ <combo_box
+ control_name="SocialPhotoFilters"
+ follows="right|top"
+ name="filters_combobox"
+ tool_tip="Image filters"
+ top="6"
+ left="165"
+ height="21"
+ width="135">
+ <combo_box.item
+ label="No Filter"
+ name="NoFilter"
+ value="NoFilter" />
+ <combo_box.item
+ label="Gray Scale"
+ name="GrayScale"
+ value="GrayScale" />
+ </combo_box>
<panel
height="150"
width="250"