|
Class: ImageEditView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--ImageView
|
+--ImageEditView
- Package:
- stx:libwidg2
- Category:
- Views-Misc
- Version:
- rev:
1.340
date: 2019/07/10 16:31:50
- user: cg
- file: ImageEditView.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
- Author:
- Thomas Zwick
An ImageEditView is a view which can be used by applications
like the Image Editor for editing or inspecting (bitmap-) images.
ImageEditor
Image
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
-
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
-
editMode: anEditModeSymbol
-
must be one of the edit modes:
EditModePoint
EditModeBox
EditModePaste
EditModePasteUnder
EditModePasteWithMask
EditModePasteMasked
EditModeFilledBox
EditModeFill
EditModeCopy
EditModeSpecialOperation
EditModeSpray
EditModeCircle
EditModeSmooth
-
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
-
-
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: aColorBlock
-
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
-
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
-
-
cropLeft: doLeft right: doRight top: doTop bottom: doBottom
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
drawingColorOrNil
-
-
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
-
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
-
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
-
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
-
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
-
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
-
Modified (format): / 31-08-2017 / 12:13:03 / cg
-
flipVertical
-
-
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)
-
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 operation 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
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
-
-
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
printing
-
print
-
-
printMagnified
-
-
printWithMagnification: magnification
-
queries
-
heightOfContents
-
-
imageContainsPastePoint: aPoint
-
- 1
-
imageContainsPoint: aPoint
-
-
selfIsNotImageEditor
-
-
widthOfContents
-
release
-
releasePasteDrawing
-
-self viewOrigin
-
releaseUndos
-
testing
-
checkModified
-
|