Browse Source

Removed the Image::setPixelData method - this can be done with Image::BitmapData instead. OSX file chooser options change for aliased files.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
098400ef31
5 changed files with 7 additions and 29 deletions
  1. +3
    -3
      extras/JuceDemo/Source/ApplicationStartup.cpp
  2. +1
    -0
      modules/juce_core/text/juce_CharPointer_UTF8.h
  3. +0
    -18
      modules/juce_graphics/images/juce_Image.cpp
  4. +1
    -8
      modules/juce_graphics/images/juce_Image.h
  5. +2
    -0
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm

+ 3
- 3
extras/JuceDemo/Source/ApplicationStartup.cpp View File

@@ -43,13 +43,13 @@ public:
//==============================================================================
void initialise (const String& /*commandLine*/)
{
#if JUCE_IOS || JUCE_ANDROID
#if JUCE_IOS || JUCE_ANDROID
theMainWindow.setVisible (true);
theMainWindow.setFullScreen (true);
#else
#else
theMainWindow.centreWithSize (700, 600);
theMainWindow.setVisible (true);
#endif
#endif
// this little function just demonstrates a few system info calls
Logger::outputDebugString (collectSomeSystemInfo());


+ 1
- 0
modules/juce_core/text/juce_CharPointer_UTF8.h View File

@@ -289,6 +289,7 @@ public:
*/
size_t sizeInBytes() const noexcept
{
jassert (data != nullptr);
return strlen (data) + 1;
}


+ 0
- 18
modules/juce_graphics/images/juce_Image.cpp View File

@@ -334,24 +334,6 @@ void Image::BitmapData::setPixelColour (const int x, const int y, const Colour&
}
}
void Image::setPixelData (int x, int y, int w, int h,
const uint8* const sourcePixelData, const int sourceLineStride)
{
jassert (x >= 0 && y >= 0 && w > 0 && h > 0 && x + w <= getWidth() && y + h <= getHeight());
if (Rectangle<int>::intersectRectangles (x, y, w, h, 0, 0, getWidth(), getHeight()))
{
const BitmapData dest (*this, x, y, w, h, BitmapData::writeOnly);
for (int i = 0; i < h; ++i)
{
memcpy (dest.getLinePointer(i),
sourcePixelData + sourceLineStride * i,
(size_t) (w * dest.pixelStride));
}
}
}
//==============================================================================
void Image::clear (const Rectangle<int>& area, const Colour& colourToClearTo)
{


+ 1
- 8
modules/juce_graphics/images/juce_Image.h View File

@@ -352,14 +352,7 @@ public:
JUCE_DECLARE_NON_COPYABLE (BitmapData);
};
/** Copies some pixel values to a rectangle of the image.
The format of the pixel data must match that of the image itself, and the
rectangle supplied must be within the image's bounds.
*/
void setPixelData (int destX, int destY, int destW, int destH,
const uint8* sourcePixelData, int sourceLineStride);
//==============================================================================
/** Copies a section of the image to somewhere else within itself. */
void moveImageSection (int destX, int destY,
int sourceX, int sourceY,


+ 2
- 0
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -125,6 +125,7 @@ void FileChooser::showPlatformDialog (Array<File>& results,
[openPanel setCanChooseDirectories: selectsDirectory];
[openPanel setCanChooseFiles: selectsFiles];
[openPanel setAllowsMultipleSelection: selectMultipleFiles];
[openPanel setResolvesAliases: YES];
}
[panel setDelegate: delegate];
@@ -156,6 +157,7 @@ void FileChooser::showPlatformDialog (Array<File>& results,
{
NSOpenPanel* openPanel = (NSOpenPanel*) panel;
NSArray* urls = [openPanel filenames];
for (unsigned int i = 0; i < [urls count]; ++i)
{
NSString* f = [urls objectAtIndex: i];


Loading…
Cancel
Save