ObjFW
OFMutableImage.h
1 /*
2  * Copyright (c) 2008-2026 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License version 3.0 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13  * version 3.0 for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * version 3.0 along with this program. If not, see
17  * <https://www.gnu.org/licenses/>.
18  */
19 
20 #import "OFImage.h"
21 
22 OF_ASSUME_NONNULL_BEGIN
23 
30 {
31  OF_RESERVE_IVARS(OFMutableImage, 4)
32 }
33 
37 @property (readonly, nonatomic) void *mutablePixels OF_RETURNS_INNER_POINTER;
38 
45 @property (readwrite, retain, nonatomic) OFColorSpace *colorSpace;
46 
50 @property (readwrite, nonatomic) OFSize dotsPerInch;
51 
60 + (instancetype)imageWithSize: (OFSize)size
61  pixelFormat: (OFPixelFormat)pixelFormat;
62 
73 + (instancetype)imageWithSize: (OFSize)size
74  pixelFormat: (OFPixelFormat)pixelFormat
75  colorSpace: (OFColorSpace *)colorSpace;
76 
86 - (instancetype)initWithSize: (OFSize)size
87  pixelFormat: (OFPixelFormat)pixelFormat;
88 
99 - (instancetype)initWithSize: (OFSize)size
100  pixelFormat: (OFPixelFormat)pixelFormat
101  colorSpace: (OFColorSpace *)colorSpace;
102 
116 - (void)setColor: (OFColor *)color atPoint: (OFPoint)point;
117 
121 - (void)makeImmutable;
122 @end
123 
124 OF_ASSUME_NONNULL_END
A class representing a color space.
Definition: OFColorSpace.h:51
A class for storing a color.
Definition: OFColor.h:31
A class representing an image.
Definition: OFImage.h:117
A class representing a mutable image.
Definition: OFMutableImage.h:30
A point in 2D space.
Definition: OFObject.h:251
A size.
Definition: OFObject.h:297