|
Class: ImageEditView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ImageView
|
+--ImageEditView
- Package:
- stx:libwidg2
- Category:
- Views-Misc
- Version:
- rev:
1.384
date: 2023/11/21 14:45:59
- user: cg
- file: ImageEditView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
An ImageEditView is a view which can be used by applications
like the Image Editor for editing or inspecting (bitmap-) images.
copyrightCOPYRIGHT (c) 1997 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing
-
editModeBox
-
-
editModeCopy
-
-
editModeFill
-
-
editModeFilledBox
-
-
editModePaste
-
-
editModePasteMasked
-
-
editModePasteUnder
-
-
editModePasteWithMask
-
-
editModePoint
-
-
editModeSmooth
-
-
editModeSpecialOperation
-
-
gridMagnificationLimit
-
-
gridMagnificationLimit: anInteger
-
-
lastSaveDirectory
-
-
lastSaveDirectory: aStringOrFilename
-
helpers
-
copyImageToClipboard: copiedImage
-
initialization
-
initialize
-
self initialize
resources
-
classResources
-
(comment from inherited method)
if not already loaded, get the classes resourcePack and return it
accessing
-
activityInfoHolder
-
return the value of the instance variable 'activityInfoHolder' (automatically generated)
-
activityInfoHolder: something
-
set the value of the instance variable 'activityInfoHolder' (automatically generated)
-
clearModified
-
-
clickInfoCallBack: aTwoArgBlock
-
-
clipBoard
-
-
clipBoardImage
-
if there is an image in the clobal clipboard,
return that (and thus support copy-paste from another smalltalk application).
Otherwise return the local clipboardImage from a classVar to support copy-paste
within this smalltalk session.
-
drawingAlpha
-
return the alpha value for drawing;
if the current drawing color is nil, ONLY the alpha value will be changed
-
drawingAlpha: anAlphaValue
-
set the alpha value for drawing;
if the current drawing color is nil, ONLY the alpha value will be changed
-
drawingColorHolders
-
left/right mouse colors
-
drawingColors
-
return the two colors in which I will draw (left / right mouse button colors)
-
drawingColors: anArrayTwoColors
-
set the two colors in which I will draw (left / right mouse button colors)
-
editMode
-
is one of the edit modes:
EditModePoint
EditModeBox
EditModePaste
EditModePasteUnder
EditModePasteMasked
EditModePasteWithMask
EditModeFilledBox
EditModeFill
EditModeCopy
EditModeSpecialOperation
EditModeSpray
EditModeCircle
EditModeSmooth
EditModePointBlend
EditModePointBrighter
EditModePointDarker
-
editMode: anEditModeSymbol
-
must be one of the edit modes:
EditModePoint
EditModeBox
EditModePaste
EditModePasteUnder
EditModePasteWithMask
EditModePasteMasked
EditModeFilledBox
EditModeFill
EditModeCopy
EditModeSpecialOperation
EditModeSpray
EditModeCircle
EditModeSmooth
EditModePointBlend
EditModePointBrighter
EditModePointDarker
-
floodFillMaxHueError: aFraction
-
Modified (format): / 17-02-2017 / 15:26:59 / cg
-
floodFillMaxLightError: aFraction
-
Modified (format): / 17-02-2017 / 15:27:03 / cg
-
image: anImage scroll: doScroll
-
(comment from inherited method)
set the image possibly scroll as set by adjust
- may show a wait cursor, if image dithering may take a while
-
image: anImage scroll: doScroll invalidate: doInvalidate
-
(image isNil or: [self checkModified])
-
imageInfoHolder
-
-
imageInfoHolder: something
-
-
magnification
-
-
magnification: aPoint
-
self scrollToTopLeft.
-
modified
-
-
modified: aBoolean
-
-
modifiedHolder
-
-
mouseKeyColorMode
-
-
mouseKeyColorMode: aMode
-
-
penWidth
-
-
penWidth: anInteger
-
-
readOnly
-
-
readOnly: aBoolean
-
-
removelastUndo
-
-
resourceClass
-
-
resourceClass: aClassOrClassNameString
-
support for names will vanish - obsolete left over from tz
-
resourceClassName
-
-
resourceMessage
-
-
resourceSelector
-
-
resourceSelector: aStringOrSymbol
-
-
selectMaskForDrawing
-
self selectedColorIndex:1.
-
selectedColor
-
the mask is selected - return a pseudoColor holding ONLY the alpha value
-
selectedColor: aColor
-
-
selectedColorIndex
-
-
selectedColorIndex: aPixelIndex
-
-
setModified
-
remember being modified (to ask about saving, when closing)
-
spraySpot
-
-
spraySpot: something
-
-
undoImages
-
-
userAllowedToChangeDrawingColor: aBoolean
-
for special applications, whre user is only allowed to draw
in the predefined color (eg. expecco)
drawing
-
drawFrame
-
draws a black frame around the image's bounds
-
drawFramesIn: aRectangle
-
draws the pixel frame grid
-
drawPasteRectangleAt: aPoint
-
currentPoint := currentPoint - self viewOrigin.
-
fillFramedRectangle: aRectangle
-
-
redraw: aRectangle
-
+ self viewOrigin
-
redrawImageX: x y: y width: w height: h
-
-
redrawImageX: x y: y width: w height: h unmaskedOnly: unmaskedOnly
-
redraw the magnified (editing) view of the image
-
redrawImageX: x y: y width: w height: h unmaskedOnly: unmaskedOnly processColorsWith: aColorBlockOrNil
-
redraw the magnified (editing) view of the image
-
redrawX: x y: y width: w height: h
-
self clippingRectangle: (x@y extent:w@h).
-
startSpray
-
the angle is uniformly ditributed
-
stopSpray
-
event handling
-
buttonMotion: state x: x y: y
-
readOnly ifTrue:[^ self].
-
buttonPress: button x: x y: y
-
with shift, paste is offset by pasted image's size
-
buttonRelease: button x: x y: y
-
"/ cg: what a kludge - please change to use a valueHolder,
-
inPasteMode
-
-
keyboardZoom: largerBoolean
-
ALT+/- (was: CTRL+/-) zoom action
-
pointerLeave: state
-
(comment from inherited method)
mouse pointer left
image editing
-
askForSpecialOperation
-
let user ask for which special operation to apply to the selected imageBox,
then perform it.
-
autoCropLeft: doLeft right: doRight top: doTop bottom: doBottom
-
self warn:'extract subImage '
-
copyImageToClipboard
-
-
copyImageToClipboard: someImage
-
-
copyRotatedSubImageToClipBoard: degrees in: imageBox
-
-
cropLeft: doLeft right: doRight top: doTop bottom: doBottom
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
drawingColorOrNil
-
care for mask in 24bit mode.
-
drawingPixelOrNil
-
-
flipSubImage: how in: imageBox
-
now, do it
-
gradientFillIn: imageBox orientation: orientation auto: auto
-
with auto, pick 2 bounding pixels and do a gradient fill with those;
-
magnifyAntiAliasedImageTo: newSize
-
-
magnifyImageTo: newSize
-
-
magnifySmoothingBy: scale
-
-
magnifySmoothingTo: newSize
-
-
makeNewColorMapByMapping: functionOfColor
-
wrong name: no longer needs a colormap - can also process the pixels
undoable make a new image by processing colors with a function.
If the image is a true-color image (rgb), the function is applied
to every pixel's color and a new pixel-array is created (this is slow).
Currently not done (why?):
If the image is a palette image,
the function is applied to the colormap only and a new colormap is
created (i.e. this is very fast).
This is the internal low level function to brighten, darken
or hue-shift the image.
Returns true, if there was any change.
-
makeSubImageX: oldX y: oldY width: newWidth height: newHeight
-
-
makeUndo
-
-
pasteAt: aPoint mode: modeSymbol
-
called from button-press/button motion while in paste mode:
paste the image in the clipboard at aPoint.
Mode is one of:
nil - ?
#withMask - paste both mask and pixel
#masked - only unmasked source pixels are pasted
#under - only paste source pixel if unmasked in dest
-
shiftImageHorizontal: shiftH vertical: shiftV
-
-
shiftImageHorizontal: shiftH vertical: shiftV wrap: doWrap
-
shift the pixels;
shift<0 is left-shift/up-shift; shift>0 is right-shift/down-shift;
doWrap controls if shifted-out pixels are to be shifted in at the opposite side.
i.e.:
0123456789 -> 3456789789 (shift: -3) 0123456789 -> 0120123456 (shift:3)
or, with wrap:
0123456789 -> 3456789012 (shift: -3) 0123456789 -> 7890123456 (shift:3)
-
shifted: image horizontal: shiftH vertical: shiftV wrap: doWrap
-
shift the pixels;
shift<0 is left-shift/up-shift; shift>0 is right-shift/down-shift;
doWrap controls if shifted-out pixels are to be shifted in at the opposite side.
i.e.:
0123456789 -> 3456789789 (shift: -3) 0123456789 -> 0120123456 (shift:3)
or, with wrap:
0123456789 -> 3456789012 (shift: -3) 0123456789 -> 7890123456 (shift:3)
-
specialOperation: operation on: imageBox withColor: clr
-
ask for and perform one of the special operations on the previously selected imageBox;
then redraw as required
-
text: aString at: aPoint
-
draw a character
-
undo
-
image editing-editmode button actions
-
arrow1At: aPoint
-
called from button-press/button motion while in arrow-at-start-drawing mode:
drag a line,
when released, draw the line with the currently selected color
-
arrow2At: aPoint
-
called from button-press/button motion while in arrow-at-end-drawing mode:
drag a line,
when released, draw the line with the currently selected color
-
boxAt: aPoint
-
called from button-press/button motion while in box-drawing mode:
drag a rectangular outline,
when released, draw a rectangle with the currently selected color
-
circleAt: aPoint
-
called from button-press/button motion while in circle-drawing mode:
drag an ellipse,
when released, draw an ellipse with the currently selected color
-
commonBoxOperation: action at: aPoint
-
common code for filling/drawing.
-
copyAt: aPoint
-
called from button-press/button motion while in copy-drawing mode:
drag a filled box,
when released, copy the selected rectangle to the clipboard
-
cropSubImageAt: aPoint
-
called from button-press/button motion while in crop-subImage mode:
drag a filled box,
when released, change the image to the new bounds
-
ensureColorInImage: aColor
-
ensure that image can represent aColor
(if image has a colorMap)
-
fillAt: aPoint
-
called from button-press motion while in floo-fill drawing mode:
perform a flood-fill with the currently selected color
-
filledBoxAt: aPoint
-
called from button-press/button motion while in filled rectangle-drawing mode:
drag a filled box,
when released, fill a rectangular area with the currently selected color
-
filledCircleAt: aPoint
-
called from button-press/button motion while in filled circle-drawing mode:
drag a filled ellipse,
when released, fill an ellipse with the currently selected color
-
lineAt: aPoint
-
called from button-press/button motion while in line-drawing mode:
drag a line,
when released, draw the line with the currently selected color
-
lineAt: aPoint arrowStyle: arrowStyleOrNil
-
called from button-press/button motion while in line-drawing mode:
drag a line,
when released, draw the line with the currently selected color
-
maskOutsideCircleAt: aPoint
-
called from button-press/button motion while in filled rectangle-drawing mode:
drag a box,
when released, mask everything outside the rectangular area
-
maskOutsideRectAt: aPoint
-
called from button-press/button motion while in filled rectangle-drawing mode:
drag a box,
when released, mask everything outside the rectangular area
-
pasteAt: aPoint
-
called from button-press/button motion while in paste mode:
paste the image in the clipboard at aPoint
-
pasteMaskedAt: aPoint
-
called from button-press/button motion while in paste mode:
paste the image in the clipboard at aPoint.
In this mode, only pixels which are not masked in the source image
are pasted.
-
pasteUnderAt: aPoint
-
called from button-press/button motion while in paste mode:
pasteUnder the image in the clipboard at aPoint.
In this mode, only pixels which are not equal to
the current color or masked are pasted.
-
pasteWithMaskAt: aPoint
-
called from button-press/button motion while in paste mode:
paste the image in the clipboard at aPoint.
In this mode, both the mask and the image pixel are pasted
-
pointAt: aPoint
-
called from button-press/button motion while in point-drawing mode:
draw a single pixel with the currently selected color
-
pointAt: aPoint width: pw
-
called from button-press/button motion while in point-drawing mode:
draw a single pixel (or dot of width pw) with the currently selected color,
or blend it with the selected color or make it brighter/darker
-
pointBlendAt: aPoint
-
called from button-press/button motion while in point-blending drawing mode:
blend a single pixel with the currently selected color.
Notice: this is called via #perform (editMode+At:)
-
pointBrighterAt: aPoint
-
called from button-press/button motion while in point-brighter drawing mode:
makes a single pixel slightly brighter.
Notice: this is called via #perform (editMode+At:)
-
pointDarkerAt: aPoint
-
called from button-press/button motion while in point-darker drawing mode:
makes a single pixel slightly darker.
Notice: this is called via #perform (editMode+At:)
-
smoothAt: aPoint
-
called from button-press/button motion while in smoothing mode:
smoth (average) a single pixel with pixels around
-
specialOperationAt: aPoint
-
special operation on a rectangular area
-
sprayAt: aPoint
-
called from button-press/button motion while in spray mode:
start spraying with the currently selected color
image manipulation
-
brightenImage
-
make the image brighter
-
darkenImage
-
make the image darker
-
exchangeGreenBlueChannels
-
exchange red and blue channels
-
exchangeRedBlueChannels
-
exchange red and blue channels
-
exchangeRedGreenChannels
-
exchange red and green channels
-
flipHorizontal
-
flip the whole image horizontally
-
flipVertical
-
flip the whole image vertivally
-
makeBorderedImageX: newX y: newY width: newWidth height: newHeight
-
-
makeBrighter
-
make the image brighter (obsolete, backward compatible entry)
-
makeDarker
-
make the image darker (obsolete, backward compatible entry)
-
makeGrayScaleImage
-
-
makeInverse
-
-
makeInvertedBits
-
invert the pixels
for palette images, this will lead to funny results;
for all others, this makes it a negative
-
makeNegative
-
make a real negative.
For non-palette images, this is done by inverting the pixels;
for palette images, we need new colors.
-
makeSlightlyBrighter
-
-
makeSlightlyDarker
-
-
newImageWithUndo: newImage
-
undoable set a new image (after processing)
-
performSpecialOperation: operation on: imageBox withColor: clr
-
actually perform one of the special operations on the previously selected imageBox
-
reduceColorResolutionBy: numBits
-
reduce by masking off numBits r/g/b bits
-
resizeImageTo: newSize
-
-
resizedImage: image to: newSize
-
helper for image resize and mask resize.
return a resized version of image
-
rotateImageBy: rotation
-
rotate by (degrees)
-
slightlyBrighter: aColor
-
-
slightlyDarker: aColor
-
-
threeDProjection: dx1 and: dx2
-
3D projection
image-dragging & info
-
dragRectangleStartingAt: aPointIn emphasis: emphasis
-
draw a drag rectangle (filled or unfilled, depending on the emphasis arg).
This is called by operations like rectangle, filledRectangle, copy etc.
(i.e. any operation which operates on a box).
The cpu stays in this method dragging the mouse pointer,
until the button is released.
Emphasis is one of:
box - a frame is drawn
inverseFilledBox - the dragged box is filled by the inverse color
filledBox - the dragged box is filled with black
grayedBox - the dragged box is drawn with a gray shadow
-
drawCursorAt: aPoint
-
the mouse was moved to aPoint (in the image).
Update the info (showing rgb + other info) in the lower info bar.
Also changes the cursor to a stop-cursor, if outside the image
-
imageInfoString
-
-
showCursorAt: aPoint andInformation: aLabel
-
-
updateActivity: something
-
-
updateImageInfo: someTextOrObject
-
show someText in the lower info area
-
updateImageInfoFor: aPoint
-
show info about the pixel at aPoint in the lower info area
initialization & release
-
destroy
-
(comment from inherited method)
image := nil.
-
initialize
-
left/right mouse colors
-
release
-
keep the edited image here (it is nilled in ImageView)
- we want to get it after close
loading & saving
-
askForFileNameToSave: msg
-
ask for a fileName
-
loadFromClass
-
-
loadFromClass: aClassOrClassName andSelector: aStringOrSymbol
-
support for names will vanish - obsolete left over from tz
-
loadFromFile: aFileName
-
-
loadFromFile: aFileName readerClass: imageReaderClassOrNil
-
imageReaderClass := ImageReader allSubclasses
-
loadFromMessage: classAndSelector
-
switch to the class and selector specified by classAndSelector.
-
loadfromClass: aClassOrSymbol andSelector: aStringOrSymbol
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
save
-
-
save: image imageOrMask: what
-
save the image or the mask only (if what == #mask)
-
save: image imageOrMask: what as: fileNameArg
-
save the image or the mask only (if what == #mask)
-
saveAs
-
-
saveButtonImageToFileAs
-
-
saveButtonImageToFileAs: aFileName
-
save the image as if in a button in aFileName
-
saveImageFileAs
-
ask for a fileName and save the image
-
saveImageFileAs: aFileName
-
save the image in aFileName
-
saveImageMaskFileAs
-
ask for a fileName and save the mask only
-
saveImageMaskFileAs: aFileName
-
save the mask only in aFileName
-
saveImageOrMask: what
-
save the image or the mask only (if what == #mask)
-
saveMethod
-
save the image as a resource method.
Return true if ok; false if not
-
saveMethodAs
-
ask for method/selector; save the image there.
Return true if saved, false if not
-
saveMethodAsInFormat: formatOrNil
-
ask for method/selector; save the image there.
Return true if saved, false if not
-
saveMethodInFormat: formatOrNil
-
save the image as a resource method.
Return true if ok; false if not
printing
-
print
-
(comment from inherited method)
print the receiver on the standard output stream (which is not the Transcript)
-
printMagnified
-
-
printWithMagnification: magnification
-
queries
-
imageContainsPastePoint: aPoint
-
- 1
-
imageContainsPoint: aPoint
-
-
selfIsNotImageEditor
-
queries-contents
-
heightOfContents
-
(comment from inherited method)
return the image's height - scrollbar needs this info
-
widthOfContents
-
(comment from inherited method)
return the image's width - scrollbar needs this info
release
-
releasePasteDrawing
-
-self viewOrigin
-
releaseUndos
-
testing
-
checkModified
-
|