음악, 삶, 개발
Juce 로 만드는 GUI 파트3 : Component 관련 클래스들 본문
앞선 포스트에서 우리는 Component 클래스를 배우기위해,
Component 클래스의 멤버 함수들의 인자로 사용되는 다른 클래스들을 공부해야한다고하였다.
따라서, 이 포스트에서는 GUI 와 관련되어 자주 사용되는 클래스들의 설명을
Juce 공식 문서에서 가져와 정리해놓았다.
각 클래스 마다 어떻게 작동하는지에 관한 세세한 내용들은
앞으로 독립적인 포스트들로 만들어 소개할것이다.
이 포스트는 이 클래스들을 둘러보는 사전정도로 활용하면 좋을것이다.
여기세 적혀있는 대부분의 클래스들은 Graphics 클래스의 멤버 함수의 인자로 존재하는것들이다.
Graphics 클래스가 결국 paint() 함수내에서 그림을 그리는 부분이기때문이다.
< Component >
The base class for all JUCE user-interface objects.
In function argument :
ModalComponentManager::Callback
< Graphics >
A graphics context, used for drawing a component or image.
When a Component needs painting,
a Graphics context is passed to its Component::paint() method,
and this you then call methods within this object to actually draw the component's content.
A Graphics can also be created from an image, to allow drawing directly onto that image.
See also Component::paint
In function argument :
< Image >
Holds a fixed-size bitmap.
The image is stored in either 24-bit RGB or 32-bit premultiplied-ARGB format.
To draw into an image, create a Graphics object for it. e.g.
// create a transparent 500x500 image..
Image myImage (Image::RGB, 500, 500, true);
Graphics g (myImage);
g.setColour (Colours::red);
g.fillEllipse (20, 20, 300, 200); // draws a red ellipse in our image.
Other useful ways to create an image are with the ImageCache class, or the ImageFileFormat,
which provides a way to load common image files.
See also Graphics, ImageFileFormat, ImageCache, ImageConvolutionKernel
In function argument :
< Colour >
Represents a colour, also including a transparency value.
The colour is stored internally as unsigned 8-bit red, green, blue and alpha values.
In function argument :
< ColourGradient >
Describes the layout and colours that should be used to paint a colour gradient.
See also Graphics::setGradientFill
In function argument :
< String >
The JUCE String class!
Using a reference-counted internal representation,
these strings are fast and efficient,
and there are methods to do just about any operation you'll ever dream of.
See also StringArray, StringPairArray
In function argument :
굉장히 거대한 클래스라 생략. 따로 공부할것.
< Font >
Represents a particular font, including its size, style, etc.
Apart from the typeface to be used,
a Font object also dictates whether the font is bold, italic, underlined, how big it is,
and its kerning and horizontal scale factor.
See also Typeface
In function argument :
< Path >
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
To use a path, you can create an empty one, then add lines and curves to it to create shapes,
then it can be rendered by a Graphics context or used for geometric operations.
e.g.
Path myPath;
myPath.startNewSubPath (10.0f, 10.0f); // move the current position to (10, 10)
myPath.lineTo (100.0f, 200.0f); // draw a line from here to (100, 200)
myPath.quadraticTo (0.0f, 150.0f, 5.0f, 50.0f); // draw a curve that ends at (5, 50)
myPath.closeSubPath(); // close the subpath with a line back to (10, 10)
// add an ellipse as well, which will form a second sub-path within the path..
myPath.addEllipse (50.0f, 50.0f, 40.0f, 30.0f);
// double the width of the whole thing..
myPath.applyTransform (AffineTransform::scale (2.0f, 1.0f));
// and draw it to a graphics context with a 5-pixel thick outline.
g.strokePath (myPath, PathStrokeType (5.0f));
A path object can actually contain multiple sub-paths, which may themselves be open or closed.
See also PathFlatteningIterator, PathStrokeType, Graphics
In function argument :
< PathStrokeType >
Describes a type of stroke used to render a solid outline along a path.
A PathStrokeType object can be used directly to create the shape of an outline around a path,
and is used by Graphics::strokePath to specify the type of stroke to draw.
See also Path, Graphics::strokePath
In function argument :
< FillType >
Represents a colour or fill pattern to use for rendering paths.
This is used by the Graphics and DrawablePath classes as a way to encapsulate a brush type.
It can either be a solid colour, a gradient, or a tiled image.
See also Graphics::setFillType, DrawablePath::setFill
In function argument :
< Justification >
Represents a type of justification to be used when positioning graphical items.
e.g. it indicates whether something should be placed top-left, top-right, centred, etc.
It is used in various places wherever this kind of information is needed.
In function argument :
< Line >
Represents a line.
This class contains a bunch of useful methods for various geometric tasks.
The ValueType template parameter should be a primitive type - float or double are what it's designed for.
Integer types will work in a basic way, but some methods that perform mathematical operations may not compile,
or they may not produce sensible results.
See also Point, Rectangle, Path, Graphics::drawLine
In function argument :
< Rectangle >
Manages a rectangle and allows geometric operations to be performed on it.
See also RectangleList, Path, Line, Point
In function argument :
< RectangleList >
Maintains a set of rectangles as a complex region.
This class allows a set of rectangles to be treated as a solid shape,
and can add and remove rectangular sections of it, and simplify overlapping or adjacent rectangles.
See also Rectangle
< AffineTransform >
Represents a 2D affine-transformation matrix.
An affine transformation is a transformation such as a rotation, scale, shear, resize or translation.
These are used for various 2D transformation tasks, e.g. with Path objects.